git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH v1 0/2] run GETTEXT_POISON on TravisCI
@ 2017-05-05 15:40 Lars Schneider
  2017-05-05 15:40 ` [PATCH v1 1/2] travis-ci: setup "prove cache" in "script" step Lars Schneider
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Lars Schneider @ 2017-05-05 15:40 UTC (permalink / raw)
  To: git; +Cc: gitster, avarab

Hi,

this adds GETTEXT_POISON tests to TravisCI. Patch 1/2 is preparation
and 2/2 adds the build job.

You can see a test run here:
https://travis-ci.org/larsxschneider/git/jobs/229120495

On "next" this generates a bunch of failures (see below).

@Ævar: Are your GETTEXT_POISON fixes in already or are these failures expected?

Cheers,
Lars


t5316-pack-delta-depth.sh                        (Wstat: 256 Tests: 3 Failed: 2)
  Failed tests:  2-3
  Non-zero exit status: 1
t6134-pathspec-in-submodule.sh                   (Wstat: 256 Tests: 3 Failed: 2)
  Failed tests:  2-3
  Non-zero exit status: 1
t3415-rebase-autosquash.sh                       (Wstat: 256 Tests: 19 Failed: 6)
  Failed tests:  13-17, 19
  Non-zero exit status: 1
t7509-commit.sh                                  (Wstat: 256 Tests: 12 Failed: 2)
  Failed tests:  6-7
  Non-zero exit status: 1
t1309-early-config.sh                            (Wstat: 256 Tests: 8 Failed: 1)
  Failed test:  6
  Non-zero exit status: 1
t3203-branch-output.sh                           (Wstat: 256 Tests: 23 Failed: 1)
  Failed test:  23
  Non-zero exit status: 1
t7800-difftool.sh                                (Wstat: 256 Tests: 71 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
t3404-rebase-interactive.sh                      (Wstat: 256 Tests: 95 Failed: 46)
  Failed tests:  26-38, 40-43, 45, 47-74
  Non-zero exit status: 1
t3903-stash.sh                                   (Wstat: 256 Tests: 75 Failed: 2)
  Failed tests:  70-71
  Non-zero exit status: 1
t7406-submodule-update.sh                        (Wstat: 256 Tests: 52 Failed: 1)
  Failed test:  23
  Non-zero exit status: 1
t7508-status.sh                                  (Wstat: 256 Tests: 102 Failed: 3)
  Failed tests:  18-19, 43
  Non-zero exit status: 1


Base Ref: next
Web-Diff: https://github.com/larsxschneider/git/commit/a835cd4775
Checkout: git fetch https://github.com/larsxschneider/git travisci/poison-v1 && git checkout a835cd4775

Lars Schneider (2):
  travis-ci: setup "prove cache" in "script" step
  travis-ci: add job to run tests with GETTEXT_POISON

 .travis.yml | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)


base-commit: 813ba54fc35ef2b9c03fe84a4803e4365c22cf49
--
2.12.2


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v1 1/2] travis-ci: setup "prove cache" in "script" step
  2017-05-05 15:40 [PATCH v1 0/2] run GETTEXT_POISON on TravisCI Lars Schneider
@ 2017-05-05 15:40 ` Lars Schneider
  2017-05-05 19:26   ` Ævar Arnfjörð Bjarmason
  2017-05-05 15:40 ` [PATCH v1 2/2] travis-ci: add job to run tests with GETTEXT_POISON Lars Schneider
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Lars Schneider @ 2017-05-05 15:40 UTC (permalink / raw)
  To: git; +Cc: gitster, avarab

The command that made the "prove cache" persistent across builds was
executed in the "before_install" step. Consequently, every job that
wanted to make use of the cache had to run this step.

The "prove cache" is only used in the "script" step for the
"make test" command. Therefore, we should configure the "prove cache"
in this step.

This change is useful for a subsequent patch that adds a job which does
not need the "before_install" step but wants to run the "script" step to
execute the tests.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
---
 .travis.yml | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 48cb00a581..aa03f8eb82 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -135,12 +135,14 @@ before_install:
     p4 -V | grep Rev.;
     echo "$(tput setaf 6)Git-LFS Version$(tput sgr0)";
     git-lfs version;
-    mkdir -p $HOME/travis-cache;
-    ln -s $HOME/travis-cache/.prove t/.prove;
 
 before_script: make --jobs=2
 
-script: make --quiet test
+script:
+  - >
+    mkdir -p $HOME/travis-cache;
+    ln -s $HOME/travis-cache/.prove t/.prove;
+    make --quiet test;
 
 after_failure:
   - >
-- 
2.12.2


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v1 2/2] travis-ci: add job to run tests with GETTEXT_POISON
  2017-05-05 15:40 [PATCH v1 0/2] run GETTEXT_POISON on TravisCI Lars Schneider
  2017-05-05 15:40 ` [PATCH v1 1/2] travis-ci: setup "prove cache" in "script" step Lars Schneider
@ 2017-05-05 15:40 ` Lars Schneider
  2017-05-05 16:08   ` Jonathan Nieder
  2017-05-05 17:38 ` [PATCH] t7406: fix i18n expectation of error message Stefan Beller
  2017-05-05 18:19 ` [PATCH v2] tests: fix tests broken under GETTEXT_POISON=YesPlease Ævar Arnfjörð Bjarmason
  3 siblings, 1 reply; 11+ messages in thread
From: Lars Schneider @ 2017-05-05 15:40 UTC (permalink / raw)
  To: git; +Cc: gitster, avarab

Add a job to run Git tests with GETTEXT_POISON. In this job we don't run
the git-p4, git-svn, and HTTPD tests to save resources/time (those tests
are already executed in other jobs). Since we don't run these tests, we
can also skip the "before_install" step (which would install the
necessary dependencies) with an empty override.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
---
 .travis.yml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/.travis.yml b/.travis.yml
index aa03f8eb82..278943d14a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -39,6 +39,11 @@ env:
 
 matrix:
   include:
+    - env: GETTEXT_POISON=YesPlease
+      os: linux
+      compiler:
+      addons:
+      before_install:
     - env: Windows
       os: linux
       compiler:
-- 
2.12.2


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v1 2/2] travis-ci: add job to run tests with GETTEXT_POISON
  2017-05-05 15:40 ` [PATCH v1 2/2] travis-ci: add job to run tests with GETTEXT_POISON Lars Schneider
@ 2017-05-05 16:08   ` Jonathan Nieder
  0 siblings, 0 replies; 11+ messages in thread
From: Jonathan Nieder @ 2017-05-05 16:08 UTC (permalink / raw)
  To: Lars Schneider; +Cc: git, gitster, avarab

Hi,

Lars Schneider wrote:

> Add a job to run Git tests with GETTEXT_POISON. In this job we don't run
> the git-p4, git-svn, and HTTPD tests to save resources/time (those tests
> are already executed in other jobs). Since we don't run these tests, we
> can also skip the "before_install" step (which would install the
> necessary dependencies) with an empty override.
>
> Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
> ---
>  .travis.yml | 5 +++++
>  1 file changed, 5 insertions(+)

Yay!  I like this.

What I like most about GETTEXT_POISON is that it verifies that
translatable strings are not affecting other functionality of Git.
It's a valuable thing to test continuously.

For what it's worth,
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

Thanks.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] t7406: fix i18n expectation of error message
  2017-05-05 15:40 [PATCH v1 0/2] run GETTEXT_POISON on TravisCI Lars Schneider
  2017-05-05 15:40 ` [PATCH v1 1/2] travis-ci: setup "prove cache" in "script" step Lars Schneider
  2017-05-05 15:40 ` [PATCH v1 2/2] travis-ci: add job to run tests with GETTEXT_POISON Lars Schneider
@ 2017-05-05 17:38 ` Stefan Beller
  2017-05-05 17:50   ` Ævar Arnfjörð Bjarmason
  2017-05-05 18:19 ` [PATCH v2] tests: fix tests broken under GETTEXT_POISON=YesPlease Ævar Arnfjörð Bjarmason
  3 siblings, 1 reply; 11+ messages in thread
From: Stefan Beller @ 2017-05-05 17:38 UTC (permalink / raw)
  To: larsxschneider; +Cc: git, gitster, avarab, Stefan Beller

The error message from "submodule update" is internationalized, which
makes sense. The test however did not check for the translated version,
but used a hardcoded string, which breaks the test when run with
GETTEXT_POISON.

Signed-off-by: Stefan Beller <sbeller@google.com>
---
 t/t7406-submodule-update.sh | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index 4ac386d98b..12f6435ab0 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -441,13 +441,11 @@ test_expect_success 'submodule update - command in .git/config catches failure -
 	test_i18ncmp actual expect
 '
 
+sq="'"
 test_expect_success 'submodule update - command run for initial population of submodule' '
-	cat >expect <<-EOF &&
-	Execution of '\''false $submodulesha1'\'' failed in submodule path '\''submodule'\''
-	EOF
 	rm -rf super/submodule &&
 	test_must_fail git -C super submodule update 2>actual &&
-	test_cmp expect actual &&
+	test_i18ngrep "Execution of ${sq}false $submodulesha1${sq} failed in submodule path ${sq}submodule${sq}" actual &&
 	git -C super submodule update --checkout
 '
 
-- 
2.13.0.rc2.dirty


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] t7406: fix i18n expectation of error message
  2017-05-05 17:38 ` [PATCH] t7406: fix i18n expectation of error message Stefan Beller
@ 2017-05-05 17:50   ` Ævar Arnfjörð Bjarmason
  2017-05-05 17:53     ` Stefan Beller
  2017-05-05 22:43     ` Johannes Sixt
  0 siblings, 2 replies; 11+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-05-05 17:50 UTC (permalink / raw)
  To: Stefan Beller; +Cc: Lars Schneider, Git Mailing List, Junio C Hamano

On Fri, May 5, 2017 at 7:38 PM, Stefan Beller <sbeller@google.com> wrote:
> The error message from "submodule update" is internationalized, which
> makes sense. The test however did not check for the translated version,
> but used a hardcoded string, which breaks the test when run with
> GETTEXT_POISON.
>
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
>  t/t7406-submodule-update.sh | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
> index 4ac386d98b..12f6435ab0 100755
> --- a/t/t7406-submodule-update.sh
> +++ b/t/t7406-submodule-update.sh
> @@ -441,13 +441,11 @@ test_expect_success 'submodule update - command in .git/config catches failure -
>         test_i18ncmp actual expect
>  '
>
> +sq="'"
>  test_expect_success 'submodule update - command run for initial population of submodule' '
> -       cat >expect <<-EOF &&
> -       Execution of '\''false $submodulesha1'\'' failed in submodule path '\''submodule'\''
> -       EOF
>         rm -rf super/submodule &&
>         test_must_fail git -C super submodule update 2>actual &&
> -       test_cmp expect actual &&
> +       test_i18ngrep "Execution of ${sq}false $submodulesha1${sq} failed in submodule path ${sq}submodule${sq}" actual &&
>         git -C super submodule update --checkout
>  '

I have a fix for this in my gettext fixup series (so far lingering on
the list, not in pu):
https://public-inbox.org/git/20170421185757.28978-1-avarab@gmail.com/

The diff is quite a bit smaller than yours:

diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index 4ac386d98b..034914a14f 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -447,7 +447,7 @@ test_expect_success 'submodule update - command
run for initial population of su
        EOF
        rm -rf super/submodule &&
        test_must_fail git -C super submodule update 2>actual &&
-       test_cmp expect actual &&
+       test_i18ncmp expect actual &&
        git -C super submodule update --checkout
 '

Do you prefer to use i18ngrep for whatever reason? Seems better to use
i18ncmp there.

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] t7406: fix i18n expectation of error message
  2017-05-05 17:50   ` Ævar Arnfjörð Bjarmason
@ 2017-05-05 17:53     ` Stefan Beller
  2017-05-05 22:43     ` Johannes Sixt
  1 sibling, 0 replies; 11+ messages in thread
From: Stefan Beller @ 2017-05-05 17:53 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Lars Schneider, Git Mailing List, Junio C Hamano

On Fri, May 5, 2017 at 10:50 AM, Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
>
> I have a fix for this in my gettext fixup series (so far lingering on
> the list, not in pu):
> https://public-inbox.org/git/20170421185757.28978-1-avarab@gmail.com/

Oh, should have checked the list more closely before.

>
> The diff is quite a bit smaller than yours:

I agree that this is the way to fix it best.

Sorry for the noise,
Stefan

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2] tests: fix tests broken under GETTEXT_POISON=YesPlease
  2017-05-05 15:40 [PATCH v1 0/2] run GETTEXT_POISON on TravisCI Lars Schneider
                   ` (2 preceding siblings ...)
  2017-05-05 17:38 ` [PATCH] t7406: fix i18n expectation of error message Stefan Beller
@ 2017-05-05 18:19 ` Ævar Arnfjörð Bjarmason
  2017-05-08  2:02   ` Junio C Hamano
  3 siblings, 1 reply; 11+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-05-05 18:19 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Michael J Gruber, Lars Schneider, Jiang Xin,
	Stefan Beller, Jeff King, Ævar Arnfjörð Bjarmason

The GETTEXT_POISON=YesPlease compile-time testing option added in my
bb946bba76 ("i18n: add GETTEXT_POISON to simulate unfriendly
translator", 2011-02-22) has been slowly bitrotting as strings have
been marked for translation, and new tests have been added without
running it.

I brought this up on the list ("[BUG] test suite broken with
GETTEXT_POISON=YesPlease", [1]) asking whether this mode was useful at
all anymore. At least one person occasionally uses it, and Lars
Schneider offered to change one of the the Travis builds to run in
this mode, so fix up the failing ones.

My test setup runs most of the tests, with the notable exception of
skipping all the p4 tests, so it's possible that there's still some
lurking regressions I haven't fixed.

1. <CACBZZX62+acvi1dpkknadTL827mtCm_QesGSZ=6+UnyeMpg8+Q@mail.gmail.com>

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---

On Fri, May 5, 2017 at 5:40 PM, Lars Schneider <larsxschneider@gmail.com> wrote:
> Hi,
>
> this adds GETTEXT_POISON tests to TravisCI. Patch 1/2 is preparation
> and 2/2 adds the build job.
>
> You can see a test run here:
> https://travis-ci.org/larsxschneider/git/jobs/229120495
>
> On "next" this generates a bunch of failures (see below).
>
> @Ævar: Are your GETTEXT_POISON fixes in already or are these failures expected?

My v1 in <20170421185757.28978-1-avarab@gmail.com> didn't get picked
up, so these are all known failures.

In addition the t7508-status.sh test was broken on pu. I've just based
this version of the patch on pu, it's identical on master except for
the addition of the t7508-status.sh fix, meaning if this lands on pu
GETTEXT_POISON runs will be clean.

Junio: I think between Travis now testing for this & the scary i18n
reflog regression (not that poison caught that, but that was lack of
testing, poisoining catches that class of issue) it makes sense to
discard my patch for removing GETTEXT_POISON & queue this up instead.

 t/t1309-early-config.sh          |  2 +-
 t/t1430-bad-ref-name.sh          |  2 +-
 t/t3203-branch-output.sh         |  2 +-
 t/t3404-rebase-interactive.sh    | 14 +++++++-------
 t/t3415-rebase-autosquash.sh     | 10 +++++-----
 t/t3903-stash.sh                 |  4 ++--
 t/t4205-log-pretty-formats.sh    |  4 ++--
 t/t5316-pack-delta-depth.sh      |  8 ++++++--
 t/t6134-pathspec-in-submodule.sh |  4 ++--
 t/t7004-tag.sh                   |  4 ++--
 t/t7406-submodule-update.sh      |  2 +-
 t/t7508-status.sh                |  6 +++---
 t/t7509-commit.sh                |  4 ++--
 t/t7800-difftool.sh              |  4 ++--
 14 files changed, 37 insertions(+), 33 deletions(-)

diff --git a/t/t1309-early-config.sh b/t/t1309-early-config.sh
index 1af8c454cf..3dda215e8e 100755
--- a/t/t1309-early-config.sh
+++ b/t/t1309-early-config.sh
@@ -77,7 +77,7 @@ test_with_config () {
 
 test_expect_success 'ignore .git/ with incompatible repository version' '
 	test_with_config "[core]repositoryformatversion = 999999" 2>err &&
-	grep "warning:.* Expected git repo version <= [1-9]" err
+	test_i18ngrep "warning:.* Expected git repo version <= [1-9]" err
 '
 
 test_expect_failure 'ignore .git/ with invalid repository version' '
diff --git a/t/t1430-bad-ref-name.sh b/t/t1430-bad-ref-name.sh
index 8937e25e49..e88349c8a0 100755
--- a/t/t1430-bad-ref-name.sh
+++ b/t/t1430-bad-ref-name.sh
@@ -122,7 +122,7 @@ test_expect_success 'push cannot create a badly named ref' '
 	! grep -e "broken\.\.\.ref" output
 '
 
-test_expect_failure 'push --mirror can delete badly named ref' '
+test_expect_failure C_LOCALE_OUTPUT 'push --mirror can delete badly named ref' '
 	top=$(pwd) &&
 	git init src &&
 	git init dest &&
diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh
index 5778c0afe1..a428ae6703 100755
--- a/t/t3203-branch-output.sh
+++ b/t/t3203-branch-output.sh
@@ -236,7 +236,7 @@ test_expect_success 'git branch --format option' '
 	Refname is refs/heads/ref-to-remote
 	EOF
 	git branch --format="Refname is %(refname)" >actual &&
-	test_cmp expect actual
+	test_i18ncmp expect actual
 '
 
 test_done
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 61113be08a..3b411ea8f1 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -366,7 +366,7 @@ test_expect_success 'verbose flag is heeded, even after --continue' '
 	grep "^ file1 | 2 +-$" output
 '
 
-test_expect_success 'multi-squash only fires up editor once' '
+test_expect_success C_LOCALE_OUTPUT 'multi-squash only fires up editor once' '
 	base=$(git rev-parse HEAD~4) &&
 	set_fake_editor &&
 	FAKE_COMMIT_AMEND="ONCE" FAKE_LINES="1 squash 2 squash 3 squash 4" \
@@ -376,7 +376,7 @@ test_expect_success 'multi-squash only fires up editor once' '
 	test 1 = $(git show | grep ONCE | wc -l)
 '
 
-test_expect_success 'multi-fixup does not fire up editor' '
+test_expect_success C_LOCALE_OUTPUT 'multi-fixup does not fire up editor' '
 	git checkout -b multi-fixup E &&
 	base=$(git rev-parse HEAD~4) &&
 	set_fake_editor &&
@@ -426,7 +426,7 @@ D
 ONCE
 EOF
 
-test_expect_success 'squash and fixup generate correct log messages' '
+test_expect_success C_LOCALE_OUTPUT 'squash and fixup generate correct log messages' '
 	git checkout -b squash-fixup E &&
 	base=$(git rev-parse HEAD~4) &&
 	set_fake_editor &&
@@ -439,7 +439,7 @@ test_expect_success 'squash and fixup generate correct log messages' '
 	git branch -D squash-fixup
 '
 
-test_expect_success 'squash ignores comments' '
+test_expect_success C_LOCALE_OUTPUT 'squash ignores comments' '
 	git checkout -b skip-comments E &&
 	base=$(git rev-parse HEAD~4) &&
 	set_fake_editor &&
@@ -452,7 +452,7 @@ test_expect_success 'squash ignores comments' '
 	git branch -D skip-comments
 '
 
-test_expect_success 'squash ignores blank lines' '
+test_expect_success C_LOCALE_OUTPUT 'squash ignores blank lines' '
 	git checkout -b skip-blank-lines E &&
 	base=$(git rev-parse HEAD~4) &&
 	set_fake_editor &&
@@ -860,7 +860,7 @@ test_expect_success 'rebase -ix with several instances of --exec' '
 	test_cmp expected actual
 '
 
-test_expect_success 'rebase -ix with --autosquash' '
+test_expect_success C_LOCALE_OUTPUT 'rebase -ix with --autosquash' '
 	git reset --hard execute &&
 	git checkout -b autosquash &&
 	echo second >second.txt &&
@@ -943,7 +943,7 @@ test_expect_success 'rebase -i --root fixup root commit' '
 	test 0 = $(git cat-file commit HEAD | grep -c ^parent\ )
 '
 
-test_expect_success 'rebase --edit-todo does not works on non-interactive rebase' '
+test_expect_success C_LOCALE_OUTPUT 'rebase --edit-todo does not work on non-interactive rebase' '
 	git reset --hard &&
 	git checkout conflict-branch &&
 	set_fake_editor &&
diff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh
index 2f88f50c05..e364c12622 100755
--- a/t/t3415-rebase-autosquash.sh
+++ b/t/t3415-rebase-autosquash.sh
@@ -234,23 +234,23 @@ test_auto_fixup_fixup () {
 	fi
 }
 
-test_expect_success 'fixup! fixup!' '
+test_expect_success C_LOCALE_OUTPUT 'fixup! fixup!' '
 	test_auto_fixup_fixup fixup fixup
 '
 
-test_expect_success 'fixup! squash!' '
+test_expect_success C_LOCALE_OUTPUT 'fixup! squash!' '
 	test_auto_fixup_fixup fixup squash
 '
 
-test_expect_success 'squash! squash!' '
+test_expect_success C_LOCALE_OUTPUT 'squash! squash!' '
 	test_auto_fixup_fixup squash squash
 '
 
-test_expect_success 'squash! fixup!' '
+test_expect_success C_LOCALE_OUTPUT 'squash! fixup!' '
 	test_auto_fixup_fixup squash fixup
 '
 
-test_expect_success 'autosquash with custom inst format' '
+test_expect_success C_LOCALE_OUTPUT 'autosquash with custom inst format' '
 	git reset --hard base &&
 	git config --add rebase.instructionFormat "[%an @ %ar] %s"  &&
 	echo 2 >file1 &&
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index b71d1e659e..3b4bed5c9a 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -865,7 +865,7 @@ test_expect_success 'stash push -p with pathspec shows no changes only once' '
 	git stash push -p foo >actual &&
 	echo "No local changes to save" >expect &&
 	git reset --hard HEAD~ &&
-	test_cmp expect actual
+	test_i18ncmp expect actual
 '
 
 test_expect_success 'stash push with pathspec shows no changes when there are none' '
@@ -875,7 +875,7 @@ test_expect_success 'stash push with pathspec shows no changes when there are no
 	git stash push foo >actual &&
 	echo "No local changes to save" >expect &&
 	git reset --hard HEAD~ &&
-	test_cmp expect actual
+	test_i18ncmp expect actual
 '
 
 test_expect_success 'stash push with pathspec not in the repository errors out' '
diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh
index 21eb8c8587..18aa1b5889 100755
--- a/t/t4205-log-pretty-formats.sh
+++ b/t/t4205-log-pretty-formats.sh
@@ -126,12 +126,12 @@ test_expect_success 'NUL separation with --stat' '
 	test_i18ncmp expected actual
 '
 
-test_expect_failure 'NUL termination with --stat' '
+test_expect_failure C_LOCALE_OUTPUT 'NUL termination with --stat' '
 	stat0_part=$(git diff --stat HEAD^ HEAD) &&
 	stat1_part=$(git diff-tree --no-commit-id --stat --root HEAD^) &&
 	printf "add bar\n$stat0_part\n\0$(commit_msg)\n$stat1_part\n0" >expected &&
 	git log -z --stat --pretty="tformat:%s" >actual &&
-	test_i18ncmp expected actual
+	test_cmp expected actual
 '
 
 test_expect_success 'setup more commits' '
diff --git a/t/t5316-pack-delta-depth.sh b/t/t5316-pack-delta-depth.sh
index 37143ea0ac..2ed479b712 100755
--- a/t/t5316-pack-delta-depth.sh
+++ b/t/t5316-pack-delta-depth.sh
@@ -82,12 +82,16 @@ test_expect_success 'packing produces a long delta' '
 	# Use --window=0 to make sure we are seeing reused deltas,
 	# not computing a new long chain.
 	pack=$(git pack-objects --all --window=0 </dev/null pack) &&
-	test 9 = "$(max_chain pack-$pack.pack)"
+	echo 9 >expect &&
+	max_chain pack-$pack.pack >actual &&
+	test_i18ncmp expect actual
 '
 
 test_expect_success '--depth limits depth' '
 	pack=$(git pack-objects --all --depth=5 </dev/null pack) &&
-	test 5 = "$(max_chain pack-$pack.pack)"
+	echo 5 >expect &&
+	max_chain pack-$pack.pack >actual &&
+	test_i18ncmp expect actual
 '
 
 test_done
diff --git a/t/t6134-pathspec-in-submodule.sh b/t/t6134-pathspec-in-submodule.sh
index fd401ca605..99a8982ab1 100755
--- a/t/t6134-pathspec-in-submodule.sh
+++ b/t/t6134-pathspec-in-submodule.sh
@@ -21,7 +21,7 @@ EOF
 test_expect_success 'error message for path inside submodule' '
 	echo a >sub/a &&
 	test_must_fail git add sub/a 2>actual &&
-	test_cmp expect actual
+	test_i18ncmp expect actual
 '
 
 cat <<EOF >expect
@@ -30,7 +30,7 @@ EOF
 
 test_expect_success 'error message for path inside submodule from within submodule' '
 	test_must_fail git -C sub add . 2>actual &&
-	test_cmp expect actual
+	test_i18ncmp expect actual
 '
 
 test_done
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index bb2e4d704d..0ef7b94394 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -87,7 +87,7 @@ test_expect_success 'creating a tag with --create-reflog should create reflog' '
 	git tag --create-reflog tag_with_reflog &&
 	git reflog exists refs/tags/tag_with_reflog &&
 	sed -e "s/^.*	//" .git/logs/refs/tags/tag_with_reflog >actual &&
-	test_cmp expected actual
+	test_i18ncmp expected actual
 '
 
 test_expect_success 'annotated tag with --create-reflog has correct message' '
@@ -98,7 +98,7 @@ test_expect_success 'annotated tag with --create-reflog has correct message' '
 	git tag -m "annotated tag" --create-reflog tag_with_reflog &&
 	git reflog exists refs/tags/tag_with_reflog &&
 	sed -e "s/^.*	//" .git/logs/refs/tags/tag_with_reflog >actual &&
-	test_cmp expected actual
+	test_i18ncmp expected actual
 '
 
 test_expect_success '--create-reflog does not create reflog on failure' '
diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index 4ac386d98b..034914a14f 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -447,7 +447,7 @@ test_expect_success 'submodule update - command run for initial population of su
 	EOF
 	rm -rf super/submodule &&
 	test_must_fail git -C super submodule update 2>actual &&
-	test_cmp expect actual &&
+	test_i18ncmp expect actual &&
 	git -C super submodule update --checkout
 '
 
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index 567c4d4bab..79427840a4 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -392,7 +392,7 @@ EOF
 test_expect_success 'status -s -b' '
 
 	git status -s -b >output &&
-	test_cmp expect output
+	test_i18ncmp expect output
 
 '
 
@@ -402,7 +402,7 @@ test_expect_success 'status -s -z -b' '
 	git status -s -z -b >output &&
 	nul_to_q <output >output.q &&
 	mv output.q output &&
-	test_cmp expect output
+	test_i18ncmp expect output
 '
 
 test_expect_success 'setup dir3' '
@@ -744,7 +744,7 @@ EOF
 test_expect_success 'status -s -b with color.status' '
 
 	git status -s -b | test_decode_color >output &&
-	test_cmp expect output
+	test_i18ncmp expect output
 
 '
 
diff --git a/t/t7509-commit.sh b/t/t7509-commit.sh
index db9774e345..ddef7ea6b0 100755
--- a/t/t7509-commit.sh
+++ b/t/t7509-commit.sh
@@ -101,7 +101,7 @@ test_expect_success '--amend option with empty author' '
 	echo "Empty author test" >>foo &&
 	test_tick &&
 	test_must_fail git commit -a -m "empty author" --amend 2>err &&
-	grep "empty ident" err
+	test_i18ngrep "empty ident" err
 '
 
 test_expect_success '--amend option with missing author' '
@@ -114,7 +114,7 @@ test_expect_success '--amend option with missing author' '
 	echo "Missing author test" >>foo &&
 	test_tick &&
 	test_must_fail git commit -a -m "malformed author" --amend 2>err &&
-	grep "empty ident" err
+	test_i18ngrep "empty ident" err
 '
 
 test_expect_success '--reset-author makes the commit ours even with --amend option' '
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index 7f09867478..668bbee73c 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -25,14 +25,14 @@ prompt_given ()
 
 test_expect_success 'basic usage requires no repo' '
 	test_expect_code 129 git difftool -h >output &&
-	grep ^usage: output &&
+	test_i18ngrep ^usage: output &&
 	# create a ceiling directory to prevent Git from finding a repo
 	mkdir -p not/repo &&
 	test_when_finished rm -r not &&
 	test_expect_code 129 \
 	env GIT_CEILING_DIRECTORIES="$(pwd)/not" \
 	git -C not/repo difftool -h >output &&
-	grep ^usage: output
+	test_i18ngrep ^usage: output
 '
 
 # Create a file on master and change it on branch
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v1 1/2] travis-ci: setup "prove cache" in "script" step
  2017-05-05 15:40 ` [PATCH v1 1/2] travis-ci: setup "prove cache" in "script" step Lars Schneider
@ 2017-05-05 19:26   ` Ævar Arnfjörð Bjarmason
  0 siblings, 0 replies; 11+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-05-05 19:26 UTC (permalink / raw)
  To: Lars Schneider; +Cc: Git Mailing List, Junio C Hamano

On Fri, May 5, 2017 at 5:40 PM, Lars Schneider <larsxschneider@gmail.com> wrote:
> The command that made the "prove cache" persistent across builds was
> executed in the "before_install" step. Consequently, every job that
> wanted to make use of the cache had to run this step.
>
> The "prove cache" is only used in the "script" step for the
> "make test" command. Therefore, we should configure the "prove cache"
> in this step.
>
> This change is useful for a subsequent patch that adds a job which does
> not need the "before_install" step but wants to run the "script" step to
> execute the tests.
>
> Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
> ---
>  .travis.yml | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/.travis.yml b/.travis.yml
> index 48cb00a581..aa03f8eb82 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -135,12 +135,14 @@ before_install:
>      p4 -V | grep Rev.;
>      echo "$(tput setaf 6)Git-LFS Version$(tput sgr0)";
>      git-lfs version;
> -    mkdir -p $HOME/travis-cache;
> -    ln -s $HOME/travis-cache/.prove t/.prove;
>
>  before_script: make --jobs=2
>
> -script: make --quiet test
> +script:
> +  - >
> +    mkdir -p $HOME/travis-cache;
> +    ln -s $HOME/travis-cache/.prove t/.prove;
> +    make --quiet test;
>
>  after_failure:
>    - >

This reminded me to submit a patch to prove itself to allow for
customizing the location of the .prove file:
https://github.com/Perl-Toolchain-Gang/Test-Harness/pull/66

Hopefully in the not too distant future we can then do away with this
minor hack. Doesn't matter much to us, but just inflexible that such
symlink hacks are needed.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] t7406: fix i18n expectation of error message
  2017-05-05 17:50   ` Ævar Arnfjörð Bjarmason
  2017-05-05 17:53     ` Stefan Beller
@ 2017-05-05 22:43     ` Johannes Sixt
  1 sibling, 0 replies; 11+ messages in thread
From: Johannes Sixt @ 2017-05-05 22:43 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason, Stefan Beller
  Cc: Lars Schneider, Git Mailing List, Junio C Hamano

Am 05.05.2017 um 19:50 schrieb Ævar Arnfjörð Bjarmason:
> On Fri, May 5, 2017 at 7:38 PM, Stefan Beller <sbeller@google.com> wrote:
>> The error message from "submodule update" is internationalized, which
>> makes sense. The test however did not check for the translated version,
>> but used a hardcoded string, which breaks the test when run with
>> GETTEXT_POISON.
>>
>> Signed-off-by: Stefan Beller <sbeller@google.com>
>> ---
>>  t/t7406-submodule-update.sh | 6 ++----
>>  1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
>> index 4ac386d98b..12f6435ab0 100755
>> --- a/t/t7406-submodule-update.sh
>> +++ b/t/t7406-submodule-update.sh
>> @@ -441,13 +441,11 @@ test_expect_success 'submodule update - command in .git/config catches failure -
>>         test_i18ncmp actual expect
>>  '
>>
>> +sq="'"
>>  test_expect_success 'submodule update - command run for initial population of submodule' '
>> -       cat >expect <<-EOF &&
>> -       Execution of '\''false $submodulesha1'\'' failed in submodule path '\''submodule'\''
>> -       EOF
>>         rm -rf super/submodule &&
>>         test_must_fail git -C super submodule update 2>actual &&
>> -       test_cmp expect actual &&
>> +       test_i18ngrep "Execution of ${sq}false $submodulesha1${sq} failed in submodule path ${sq}submodule${sq}" actual &&
>>         git -C super submodule update --checkout
>>  '
>
> I have a fix for this in my gettext fixup series (so far lingering on
> the list, not in pu):
> https://public-inbox.org/git/20170421185757.28978-1-avarab@gmail.com/
>
> The diff is quite a bit smaller than yours:
>
> diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
> index 4ac386d98b..034914a14f 100755
> --- a/t/t7406-submodule-update.sh
> +++ b/t/t7406-submodule-update.sh
> @@ -447,7 +447,7 @@ test_expect_success 'submodule update - command
> run for initial population of su
>         EOF
>         rm -rf super/submodule &&
>         test_must_fail git -C super submodule update 2>actual &&
> -       test_cmp expect actual &&
> +       test_i18ncmp expect actual &&
>         git -C super submodule update --checkout
>  '
>
> Do you prefer to use i18ngrep for whatever reason? Seems better to use
> i18ncmp there.

With grep, you can focus on the important parts. Programs on different 
platforms or in different environments sometimes poison stderr with 
unexpected stuff (we've observed this recently with the nd/fopen-errors 
series, also sh -x output can end up in the >2 destination).

Also, grep allows to write

test_i18ngrep "Execution of .false.* failed in submodule path 
.submodule." actual

Note the lack of ugly single-quote hacks and volatile object names.

-- Hannes


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] tests: fix tests broken under GETTEXT_POISON=YesPlease
  2017-05-05 18:19 ` [PATCH v2] tests: fix tests broken under GETTEXT_POISON=YesPlease Ævar Arnfjörð Bjarmason
@ 2017-05-08  2:02   ` Junio C Hamano
  0 siblings, 0 replies; 11+ messages in thread
From: Junio C Hamano @ 2017-05-08  2:02 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: git, Michael J Gruber, Lars Schneider, Jiang Xin, Stefan Beller,
	Jeff King

Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> Junio: I think between Travis now testing for this & the scary i18n
> reflog regression (not that poison caught that, but that was lack of
> testing, poisoining catches that class of issue) it makes sense to
> discard my patch for removing GETTEXT_POISON & queue this up instead.

Let's queue this and then the travis patches on top.  Thanks.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-05-08  2:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-05 15:40 [PATCH v1 0/2] run GETTEXT_POISON on TravisCI Lars Schneider
2017-05-05 15:40 ` [PATCH v1 1/2] travis-ci: setup "prove cache" in "script" step Lars Schneider
2017-05-05 19:26   ` Ævar Arnfjörð Bjarmason
2017-05-05 15:40 ` [PATCH v1 2/2] travis-ci: add job to run tests with GETTEXT_POISON Lars Schneider
2017-05-05 16:08   ` Jonathan Nieder
2017-05-05 17:38 ` [PATCH] t7406: fix i18n expectation of error message Stefan Beller
2017-05-05 17:50   ` Ævar Arnfjörð Bjarmason
2017-05-05 17:53     ` Stefan Beller
2017-05-05 22:43     ` Johannes Sixt
2017-05-05 18:19 ` [PATCH v2] tests: fix tests broken under GETTEXT_POISON=YesPlease Ævar Arnfjörð Bjarmason
2017-05-08  2:02   ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).