git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* make test
@ 2012-10-15 10:36 Joachim Schmitz
  2012-10-15 10:53 ` Johannes Sixt
  0 siblings, 1 reply; 13+ messages in thread
From: Joachim Schmitz @ 2012-10-15 10:36 UTC (permalink / raw)
  To: git

Hi folks

I'm trying to understand why certain tests in 'make test' fail. Here's the 
first one

$ ../git --version
git version 1.8.0.rc2.5.g6b89306
$ GIT_TEST_CMP_USE_COPIED_CONTEXT=true ./t0000-basic.sh # our diff doesn't 
understand -u
ok 1 - .git/objects should be empty after git init in an empty repo
...
ok 3 - success is reported like this
not ok 4 - pretend we have a known breakage # TODO known breakage

    This is expected, right?

ok 5 - pretend we have fixed a known breakage (run in sub test-lib)
...
ok 11 - tests clean up after themselves

    the next is not though? Why might it be failing, where to check?

not ok - 12 tests clean up even on failures
#
#               mkdir failing-cleanup &&
#               (
#               cd failing-cleanup &&
#
#               cat >failing-cleanup.sh <<-EOF &&
#               #!/bin/sh
#
#               test_description='Failing tests with cleanup commands'
#
#               # Point to the t/test-lib.sh, which isn't in ../ as usual
#               TEST_DIRECTORY="/home/jojo/git/git/t"
#               . "$TEST_DIRECTORY"/test-lib.sh
#
#               test_expect_success 'tests clean up even after a failure' '
#                       touch clean-after-failure &&
#                       test_when_finished rm clean-after-failure &&
#                       (exit 1)
#               '
#               test_expect_success 'failure to clean up causes the test to 
fail' '
#                       test_when_finished "(exit 2)"
#               '
#               test_done
#
#               EOF
#
#               chmod +x failing-cleanup.sh &&
#               test_must_fail ./failing-cleanup.sh >out 2>err &&
#               ! test -s err &&
#               ! test -f "trash 
directory.failing-cleanup/clean-after-failure" &&
#               sed -e 's/Z$//' -e 's/^> //' >expect <<-\EOF &&
#               > not ok - 1 tests clean up even after a failure
#               > #     Z
#               > #     touch clean-after-failure &&
#               > #     test_when_finished rm clean-after-failure &&
#               > #     (exit 1)
#               > #     Z
#               > not ok - 2 failure to clean up causes the test to fail
#               > #     Z
#               > #     test_when_finished "(exit 2)"
#               > #     Z
#               > # failed 2 among 2 test(s)
#               > 1..2
#               EOF
#               test_cmp expect out
#               )
#
ok 13 - git update-index without --add should fail adding
...
ok 47 - very long name in the index handled sanely
# still have 1 known breakage(s)
# failed 1 among remaining 46 test(s)
1..47

Bye, Jojo 

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

* Re: make test
  2012-10-15 10:36 Joachim Schmitz
@ 2012-10-15 10:53 ` Johannes Sixt
  2012-10-15 11:00   ` Joachim Schmitz
  0 siblings, 1 reply; 13+ messages in thread
From: Johannes Sixt @ 2012-10-15 10:53 UTC (permalink / raw)
  To: Joachim Schmitz; +Cc: git

Am 10/15/2012 12:36, schrieb Joachim Schmitz:
> not ok 4 - pretend we have a known breakage # TODO known breakage
> 
>    This is expected, right?

Right.

>    the next is not though? Why might it be failing, where to check?
> 
> not ok - 12 tests clean up even on failures
> #
> #               mkdir failing-cleanup &&
> #...
> #               test_cmp expect out
> #               )
> #

First thing:

  ./t0000-basic.sh -v -i

and if that does not give sufficient clues,

  $SHELL_PATH -x ./t0000-basic.sh -v -i

(Beware, though: in some cases, the latter gives additional failures, in
particular, when the stderr of a command is checked for with test_cmp
instead of grep because the 'actual' results contain the shell command
logs, which are not in the 'expected' results.)

-- Hannes,

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

* RE: make test
  2012-10-15 10:53 ` Johannes Sixt
@ 2012-10-15 11:00   ` Joachim Schmitz
  2012-10-15 11:18     ` Johannes Sixt
  0 siblings, 1 reply; 13+ messages in thread
From: Joachim Schmitz @ 2012-10-15 11:00 UTC (permalink / raw)
  To: 'Johannes Sixt'; +Cc: git

> From: Johannes Sixt [mailto:j.sixt@viscovery.net]
> Sent: Monday, October 15, 2012 12:53 PM
> To: Joachim Schmitz
> Cc: git@vger.kernel.org
> Subject: Re: make test
> 
> Am 10/15/2012 12:36, schrieb Joachim Schmitz:
> > not ok 4 - pretend we have a known breakage # TODO known breakage
> >
> >    This is expected, right?
> 
> Right.
> 
> >    the next is not though? Why might it be failing, where to check?
> >
> > not ok - 12 tests clean up even on failures
> > #
> > #               mkdir failing-cleanup &&
> > #...
> > #               test_cmp expect out
> > #               )
> > #
> 
> First thing:
> 
>   ./t0000-basic.sh -v -i

OK, I should have mentioned that I did look with -v :
not ok - 12 tests clean up even on failures
#
#               mkdir failing-cleanup &&
#               (
#               cd failing-cleanup &&
#
#               cat >failing-cleanup.sh <<-EOF &&
#               #!/bin/sh
#
#               test_description='Failing tests with cleanup commands'
#
#               # Point to the t/test-lib.sh, which isn't in ../ as usual
#               TEST_DIRECTORY="/home/jojo/git/git/t"
#               . "$TEST_DIRECTORY"/test-lib.sh
#
#               test_expect_success 'tests clean up even after a failure' '
#                       touch clean-after-failure &&
#                       test_when_finished rm clean-after-failure &&
#                       (exit 1)
#               '
#               test_expect_success 'failure to clean up causes the test to fail' '
#                       test_when_finished "(exit 2)"
#               '
#               test_done
#
#               EOF
#
#               chmod +x failing-cleanup.sh &&
#               test_must_fail ./failing-cleanup.sh >out 2>err &&
#               ! test -s err &&
#               ! test -f "trash directory.failing-cleanup/clean-after-failure" &&
#               sed -e 's/Z$//' -e 's/^> //' >expect <<-\EOF &&
#               > not ok - 1 tests clean up even after a failure
#               > #     Z
#               > #     touch clean-after-failure &&
#               > #     test_when_finished rm clean-after-failure &&
#               > #     (exit 1)
#               > #     Z
#               > not ok - 2 failure to clean up causes the test to fail
#               > #     Z
#               > #     test_when_finished "(exit 2)"
#               > #     Z
#               > # failed 2 among 2 test(s)
#               > 1..2
#               EOF
#               test_cmp expect out
#               )
#

> and if that does not give sufficient clues,
> 
>   $SHELL_PATH -x ./t0000-basic.sh -v -i

not ok - 12 tests clean up even on failures
#
#               mkdir failing-cleanup &&
#               (
#               cd failing-cleanup &&
#
#               cat >failing-cleanup.sh <<-EOF &&
#               #!/bin/sh
#
#               test_description='Failing tests with cleanup commands'
#
#               # Point to the t/test-lib.sh, which isn't in ../ as usual
#               TEST_DIRECTORY="/home/jojo/git/git/t"
#               . "$TEST_DIRECTORY"/test-lib.sh
#
#               test_expect_success 'tests clean up even after a failure' '
#                       touch clean-after-failure &&
#                       test_when_finished rm clean-after-failure &&
#                       (exit 1)
#               '
#               test_expect_success 'failure to clean up causes the test to fail' '
#                       test_when_finished "(exit 2)"
#               '
#               test_done
#
#               EOF
#
#               chmod +x failing-cleanup.sh &&
#               test_must_fail ./failing-cleanup.sh >out 2>err &&
#               ! test -s err &&
#               ! test -f "trash directory.failing-cleanup/clean-after-failure" &&
#               sed -e 's/Z$//' -e 's/^> //' >expect <<-\EOF &&
#               > not ok - 1 tests clean up even after a failure
#               > #     Z
#               > #     touch clean-after-failure &&
#               > #     test_when_finished rm clean-after-failure &&
#               > #     (exit 1)
#               > #     Z
#               > not ok - 2 failure to clean up causes the test to fail
#               > #     Z
#               > #     test_when_finished "(exit 2)"
#               > #     Z
#               > # failed 2 among 2 test(s)
#               > 1..2
#               EOF
#               test_cmp expect out
#               )
#
+ die

Looks identical, except for the "die" at the end. And still leaves me without a clue...

> (Beware, though: in some cases, the latter gives additional failures, in
> particular, when the stderr of a command is checked for with test_cmp
> instead of grep because the 'actual' results contain the shell command
> logs, which are not in the 'expected' results.)
> 
> -- Hannes,

Bye, Jojo

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

* Re: make test
  2012-10-15 11:00   ` Joachim Schmitz
@ 2012-10-15 11:18     ` Johannes Sixt
  2012-10-15 11:37       ` Joachim Schmitz
  0 siblings, 1 reply; 13+ messages in thread
From: Johannes Sixt @ 2012-10-15 11:18 UTC (permalink / raw)
  To: Joachim Schmitz; +Cc: git

Am 10/15/2012 13:00, schrieb Joachim Schmitz:
>> From: Johannes Sixt [mailto:j.sixt@viscovery.net]
>> and if that does not give sufficient clues,
>>
>>   $SHELL_PATH -x ./t0000-basic.sh -v -i
> 
> not ok - 12 tests clean up even on failures
> #...
> + die
> 
> Looks identical, except for the "die" at the end. And still leaves me without a clue...

When I do that it begins like this (I'm on Windows):

D:\Src\mingw-git\t>bash -x t0000-basic.sh -v -i
+ test_description='Test the very basics part #1.
...
'
+ . ./test-lib.sh
++ ORIGINAL_TERM=cygwin
++ test -z ''
+++ pwd
++ TEST_DIRECTORY=/d/Src/mingw-git/t
++ test -z ''
++ TEST_OUTPUT_DIRECTORY=/d/Src/mingw-git/t
++ GIT_BUILD_DIR=/d/Src/mingw-git/t/..
++ /d/Src/mingw-git/t/../git
++ test 1 '!=' 1
++ . /d/Src/mingw-git/t/../GIT-BUILD-OPTIONS
+++ SHELL_PATH=/bin/sh
+++ PERL_PATH=/usr/bin/perl
+++ DIFF=diff
+++ PYTHON_PATH=/usr/bin/python
+++ TAR=tar
...

It seems you need a shell that is verbose under -x.

-- Hannes

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

* RE: make test
  2012-10-15 11:18     ` Johannes Sixt
@ 2012-10-15 11:37       ` Joachim Schmitz
  2012-10-15 11:52         ` Johannes Sixt
  0 siblings, 1 reply; 13+ messages in thread
From: Joachim Schmitz @ 2012-10-15 11:37 UTC (permalink / raw)
  To: 'Johannes Sixt'; +Cc: git

> From: Johannes Sixt [mailto:j.sixt@viscovery.net]
> Sent: Monday, October 15, 2012 1:18 PM
> To: Joachim Schmitz
> Cc: git@vger.kernel.org
> Subject: Re: make test
> 
> Am 10/15/2012 13:00, schrieb Joachim Schmitz:
> >> From: Johannes Sixt [mailto:j.sixt@viscovery.net]
> >> and if that does not give sufficient clues,
> >>
> >>   $SHELL_PATH -x ./t0000-basic.sh -v -i
> >
> > not ok - 12 tests clean up even on failures
> > #...
> > + die
> >
> > Looks identical, except for the "die" at the end. And still leaves me without a clue...
> 
> When I do that it begins like this (I'm on Windows):
> 
> D:\Src\mingw-git\t>bash -x t0000-basic.sh -v -i
> + test_description='Test the very basics part #1.
> ...
> '
> + . ./test-lib.sh
> ++ ORIGINAL_TERM=cygwin
> ++ test -z ''
> +++ pwd
> ++ TEST_DIRECTORY=/d/Src/mingw-git/t
> ++ test -z ''
> ++ TEST_OUTPUT_DIRECTORY=/d/Src/mingw-git/t
> ++ GIT_BUILD_DIR=/d/Src/mingw-git/t/..
> ++ /d/Src/mingw-git/t/../git
> ++ test 1 '!=' 1
> ++ . /d/Src/mingw-git/t/../GIT-BUILD-OPTIONS
> +++ SHELL_PATH=/bin/sh
> +++ PERL_PATH=/usr/bin/perl
> +++ DIFF=diff
> +++ PYTHON_PATH=/usr/bin/python
> +++ TAR=tar
> ...
> 
> It seems you need a shell that is verbose under -x.


Erm, no, I left that part out...

+ . ./test-lib.sh
++ ORIGINAL_TERM=dumb
++ test -z ''
+++ pwd
++ TEST_DIRECTORY=/home/jojo/git/git/t
++ test -z ''
++ TEST_OUTPUT_DIRECTORY=/home/jojo/git/git/t
++ GIT_BUILD_DIR=/home/jojo/git/git/t/..
++ /home/jojo/git/git/t/../git
++ test 1 '!=' 1
++ . /home/jojo/git/git/t/../GIT-BUILD-OPTIONS
+++ SHELL_PATH=/bin/sh
+++ PERL_PATH=/usr/local/bin/perl
+++ DIFF=diff
+++ PYTHON_PATH=/usr/local/bin/python
+++ TAR=tar
+++ NO_CURL=
+++ USE_LIBPCRE=
+++ NO_PERL=
+++ NO_PYTHON=
+++ NO_UNIX_SOCKETS=
+++ GIT_TEST_CMP_USE_COPIED_CONTEXT=YesPlease
+++ NO_GETTEXT=
+++ GETTEXT_POISON=
++ export PERL_PATH SHELL_PATH
++ case "$GIT_TEST_TEE_STARTED, $* " in
++ LANG=C
++ LC_ALL=C
++ PAGER=cat
++ TZ=UTC
++ TERM=dumb
++ export LANG LC_ALL PAGER TERM TZ
++ EDITOR=:
+++ /usr/local/bin/perl -e '
        my @env = keys %ENV;
        my $ok = join("|", qw(
                TRACE
                DEBUG
                USE_LOOKUP
                TEST
                .*_TEST
                PROVE
                VALGRIND
                PERF_AGGREGATING_LATER
        ));
        my @vars = grep(/^GIT_/ && !/^GIT_($ok)/o, @env);
        print join("\n", @vars);
'
++ unset VISUAL EMAIL LANGUAGE COLUMNS GIT_AUTHOR_NAME GIT_MERGE_AUTOEDIT GIT_EXEC_PATH GIT_ATTR_NOSYSTEM GIT_MERGE_VERBOSITY
GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_AUTHOR_EMAIL GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL
++ unset XDG_CONFIG_HOME
++ GIT_AUTHOR_EMAIL=author@example.com
++ GIT_AUTHOR_NAME='A U Thor'
++ GIT_COMMITTER_EMAIL=committer@example.com
++ GIT_COMMITTER_NAME='C O Mitter'
++ GIT_MERGE_VERBOSITY=5
++ GIT_MERGE_AUTOEDIT=no
++ export GIT_MERGE_VERBOSITY GIT_MERGE_AUTOEDIT
++ export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME
++ export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME
++ export EDITOR
++ expr '  ' : '.* --valgrind '
++ test -n ''
++ unset CDPATH
++ unset GREP_OPTIONS
++ case $(echo $GIT_TRACE |tr "[A-Z]" "[a-z]") in
+++ echo
+++ tr '[A-Z]' '[a-z]'
++ _x05='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
++
_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-
f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0
-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
++ _z40=0000000000000000000000000000000000000000
++ LF='
'
++ export _x05 _x40 _z40 LF
++ '[' xdumb '!=' xdumb ']'
++ test 2 -ne 0
++ case "$1" in
++ verbose=t
++ shift
++ test 1 -ne 0
++ case "$1" in
++ immediate=t
++ shift
++ test 0 -ne 0
++ test -n ''
++ test 'Test the very basics part #1.
The rest of the test suite does not check the basic operation of git
plumbing commands to work very carefully.  Their job is to concentrate
on tricky features that caused bugs in the past to detect regression.

This test runs very basic features, like registering things in cache,
writing tree, etc.

Note that this test *deliberately* hard-codes many expected object
IDs.  When object ID computation changes, like in the previous case of
swapping compression and hashing order, the person who is making the
modification *should* take notice and update the test vectors here.
' '!=' ''
++ test '' = t
++ exec
++ exec
++ test t = t
++ exec
++ test_failure=0
++ test_count=0
++ test_fixed=0
++ test_broken=0
++ test_success=0
++ test_external_has_tap=0
++ GIT_EXIT_OK=
++ trap die EXIT
++ . /home/jojo/git/git/t/test-lib-functions.sh
+++ satisfied_prereq=' '
+++ lazily_testable_prereq=
+++ lazily_tested_prereq=
++ test -n ''
++ test -n ''
++ git_bin_dir=/home/jojo/git/git/t/../bin-wrappers
++ test -x /home/jojo/git/git/t/../bin-wrappers/git
++
PATH=/home/jojo/git/git/t/../bin-wrappers:/home/jojo/git/git/t/../bin-wrappers:/bin:/bin/unsupported:/usr/bin:/usr/ucb:/usr/local/bi
n:/usr/tandem/java/bin:/home/jojo/bin
++ GIT_EXEC_PATH=/home/jojo/git/git/t/..
++ test -n ''
++ GIT_TEMPLATE_DIR=/home/jojo/git/git/t/../templates/blt
++ unset GIT_CONFIG
++ GIT_CONFIG_NOSYSTEM=1
++ GIT_ATTR_NOSYSTEM=1
++ export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_ATTR_NOSYSTEM
++ test -z ''
++ test -n YesPlease
++ GIT_TEST_CMP='diff -c'
++ GITPERLLIB=/home/jojo/git/git/t/../perl/blib/lib:/home/jojo/git/git/t/../perl/blib/arch/auto/Git
++ export GITPERLLIB
++ test -d /home/jojo/git/git/t/../templates/blt
++ test -z ''
++ test -z ''
++ GITPYTHONLIB=/home/jojo/git/git/t/../git_remote_helpers/build/lib
++ export GITPYTHONLIB
++ test -d /home/jojo/git/git/t/../git_remote_helpers/build
++ test -x /home/jojo/git/git/t/../test-chmtime
+++ basename ./t0000-basic.sh .sh
++ test='trash directory.t0000-basic'
++ test -n ''
++ case "$test" in
++ TRASH_DIRECTORY='/home/jojo/git/git/t/trash directory.t0000-basic'
++ test '!' -z ''
++ remove_trash='/home/jojo/git/git/t/trash directory.t0000-basic'
++ rm -fr 'trash directory.t0000-basic'
++ HOME='/home/jojo/git/git/t/trash directory.t0000-basic'
++ export HOME
++ test -z ''
++ test_create_repo 'trash directory.t0000-basic'
++ test 1 = 1
++ repo='trash directory.t0000-basic'
++ mkdir -p 'trash directory.t0000-basic'
++ cd 'trash directory.t0000-basic'
++ /home/jojo/git/git/t/../git-init --template=/home/jojo/git/git/t/../templates/blt/
Initialized empty Git repository in /home/jojo/git/git/t/trash directory.t0000-basic/.git/
++ mv .git/hooks .git/hooks-disabled
++ cd -P 'trash directory.t0000-basic'
++ this_test=t0000-basic.sh
++ this_test=t0000
++ case $(uname -s) in
+++ uname -s
++ test_set_prereq POSIXPERM
++ satisfied_prereq=' POSIXPERM '
++ test_set_prereq BSLASHPSPEC
++ satisfied_prereq=' POSIXPERM BSLASHPSPEC '
++ test_set_prereq EXECKEEPSPID
++ satisfied_prereq=' POSIXPERM BSLASHPSPEC EXECKEEPSPID '
++ test_set_prereq NOT_MINGW
++ satisfied_prereq=' POSIXPERM BSLASHPSPEC EXECKEEPSPID NOT_MINGW '
++ COLUMNS=1
++ test 1 = 1
++ test_set_prereq COLUMNS_CAN_BE_1
++ satisfied_prereq=' POSIXPERM BSLASHPSPEC EXECKEEPSPID NOT_MINGW COLUMNS_CAN_BE_1 '
++ test -z ''
++ test_set_prereq PERL
++ satisfied_prereq=' POSIXPERM BSLASHPSPEC EXECKEEPSPID NOT_MINGW COLUMNS_CAN_BE_1 PERL '
++ test -z ''
++ test_set_prereq PYTHON
++ satisfied_prereq=' POSIXPERM BSLASHPSPEC EXECKEEPSPID NOT_MINGW COLUMNS_CAN_BE_1 PERL PYTHON '
++ test -n ''
++ test -z ''
++ test_set_prereq GETTEXT
++ satisfied_prereq=' POSIXPERM BSLASHPSPEC EXECKEEPSPID NOT_MINGW COLUMNS_CAN_BE_1 PERL PYTHON GETTEXT '
++ test -n ''
++ test_set_prereq C_LOCALE_OUTPUT
++ satisfied_prereq=' POSIXPERM BSLASHPSPEC EXECKEEPSPID NOT_MINGW COLUMNS_CAN_BE_1 PERL PYTHON GETTEXT C_LOCALE_OUTPUT '
++ test_lazy_prereq SYMLINKS '
        # test whether the filesystem supports symbolic links
        ln -s x y && test -h y
'
++ lazily_testable_prereq='SYMLINKS '
++ eval 'test_prereq_lazily_SYMLINKS=$2'
+++ test_prereq_lazily_SYMLINKS='
        # test whether the filesystem supports symbolic links
        ln -s x y && test -h y
'
++ test_lazy_prereq CASE_INSENSITIVE_FS '
        echo good >CamelCase &&
        echo bad >camelcase &&
        test "$(cat CamelCase)" != good
'
++ lazily_testable_prereq='SYMLINKS CASE_INSENSITIVE_FS '
++ eval 'test_prereq_lazily_CASE_INSENSITIVE_FS=$2'
+++ test_prereq_lazily_CASE_INSENSITIVE_FS='
        echo good >CamelCase &&
        echo bad >camelcase &&
        test "$(cat CamelCase)" != good
'
++ test_lazy_prereq UTF8_NFD_TO_NFC '
        # check whether FS converts nfd unicode to nfc
        auml=$(printf "\303\244")
        aumlcdiar=$(printf "\141\314\210")
        >"$auml" &&
        case "$(echo *)" in
        "$aumlcdiar")
                true ;;
        *)
                false ;;
        esac
'
++ lazily_testable_prereq='SYMLINKS CASE_INSENSITIVE_FS UTF8_NFD_TO_NFC '
++ eval 'test_prereq_lazily_UTF8_NFD_TO_NFC=$2'
+++ test_prereq_lazily_UTF8_NFD_TO_NFC='
        # check whether FS converts nfd unicode to nfc
        auml=$(printf "\303\244")
        aumlcdiar=$(printf "\141\314\210")
        >"$auml" &&
        case "$(echo *)" in
        "$aumlcdiar")
                true ;;
        *)
                false ;;
        esac
'
++ test -w /
++ test_set_prereq SANITY
++ satisfied_prereq=' POSIXPERM BSLASHPSPEC EXECKEEPSPID NOT_MINGW COLUMNS_CAN_BE_1 PERL PYTHON GETTEXT C_LOCALE_OUTPUT SANITY '
+ test_expect_success '.git/objects should be empty after git init in an empty repo' '
        find .git/objects -type f -print >should-be-empty &&
        test_line_count = 0 should-be-empty
'
+ test 2 = 3
+ test_prereq=
+ test 2 = 2
+ export test_prereq
+ test_skip '.git/objects should be empty after git init in an empty repo' '
        find .git/objects -type f -print >should-be-empty &&
        test_line_count = 0 should-be-empty
'
+ test_count=1
+ to_skip=
+ test -z ''
+ test -n ''
+ case "$to_skip" in
+ false
+ say 'expecting success:
        find .git/objects -type f -print >should-be-empty &&
        test_line_count = 0 should-be-empty
'
+ say_color info 'expecting success:
        find .git/objects -type f -print >should-be-empty &&
        test_line_count = 0 should-be-empty
'
+ test -z info
+ shift
+ echo 'expecting success:
        find .git/objects -type f -print >should-be-empty &&
        test_line_count = 0 should-be-empty
'
expecting success:
        find .git/objects -type f -print >should-be-empty &&
        test_line_count = 0 should-be-empty

+ test_run_ '
        find .git/objects -type f -print >should-be-empty &&
        test_line_count = 0 should-be-empty
'
+ test_cleanup=:
+ expecting_failure=
+ test_eval_ '
        find .git/objects -type f -print >should-be-empty &&
        test_line_count = 0 should-be-empty
'
+ eval '
        find .git/objects -type f -print >should-be-empty &&
        test_line_count = 0 should-be-empty
'
++ find .git/objects -type f -print
++ test_line_count = 0 should-be-empty
++ test 3 '!=' 3
+++ wc -l
++ test 0 = 0
+ eval_ret=0
+ test -z t
+ test 0 = 0
+ setup_malloc_check
+ MALLOC_CHECK_=3
+ MALLOC_PERTURB_=165
+ export MALLOC_CHECK_ MALLOC_PERTURB_
+ test_eval_ :
+ eval :
++
+ teardown_malloc_check
+ unset MALLOC_CHECK_ MALLOC_PERTURB_
+ test t = t
+ test -n ''
+ return 0
+ test_ok_ '.git/objects should be empty after git init in an empty repo'
+ test_success=1
+ say_color '' 'ok 1 - .git/objects should be empty after git init in an empty repo'
+ test -z ''
+ test -n ''
+ shift
+ echo 'ok 1 - .git/objects should be empty after git init in an empty repo'
ok 1 - .git/objects should be empty after git init in an empty repo
+ echo ''

+ test_expect_success '.git/objects should have 3 subdirectories' '
        find .git/objects -type d -print >full-of-directories &&
        test_line_count = 3 full-of-directories
'
+ test 2 = 3
+ test_prereq=
...

Bye, Jojo

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

* Re: make test
  2012-10-15 11:37       ` Joachim Schmitz
@ 2012-10-15 11:52         ` Johannes Sixt
  2012-10-15 11:58           ` Joachim Schmitz
  0 siblings, 1 reply; 13+ messages in thread
From: Johannes Sixt @ 2012-10-15 11:52 UTC (permalink / raw)
  To: Joachim Schmitz; +Cc: git

Am 10/15/2012 13:37, schrieb Joachim Schmitz:
> ...
> + eval '
>         find .git/objects -type f -print >should-be-empty &&
>         test_line_count = 0 should-be-empty
> '
> ++ find .git/objects -type f -print
> ++ test_line_count = 0 should-be-empty
> ++ test 3 '!=' 3
> +++ wc -l
> ++ test 0 = 0
> + eval_ret=0

This is the key line. If it is 'eval_ret=1' (or other non-zero value),
then the test failed, and the lines above it usually indicate where in the
test snippet the failure occurred.

-- Hannes

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

* RE: make test
  2012-10-15 11:52         ` Johannes Sixt
@ 2012-10-15 11:58           ` Joachim Schmitz
  2012-10-15 12:09             ` Johannes Sixt
  0 siblings, 1 reply; 13+ messages in thread
From: Joachim Schmitz @ 2012-10-15 11:58 UTC (permalink / raw)
  To: 'Johannes Sixt'; +Cc: git



> -----Original Message-----
> From: Johannes Sixt [mailto:j.sixt@viscovery.net]
> Sent: Monday, October 15, 2012 1:53 PM
> To: Joachim Schmitz
> Cc: git@vger.kernel.org
> Subject: Re: make test
> 
> Am 10/15/2012 13:37, schrieb Joachim Schmitz:
> > ...
> > + eval '
> >         find .git/objects -type f -print >should-be-empty &&
> >         test_line_count = 0 should-be-empty
> > '
> > ++ find .git/objects -type f -print
> > ++ test_line_count = 0 should-be-empty
> > ++ test 3 '!=' 3
> > +++ wc -l
> > ++ test 0 = 0
> > + eval_ret=0
> 
> This is the key line. If it is 'eval_ret=1' (or other non-zero value),
> then the test failed, and the lines above it usually indicate where in the
> test snippet the failure occurred.


...
++ mkdir failing-cleanup
++ cd failing-cleanup
++ cat
++ chmod +x failing-cleanup.sh
++ test_must_fail ./failing-cleanup.sh
+ eval_ret=1
+ test -z t
+ test 1 = 0
+ test -n ''
+ test t = t
+ test -n ''
+ return 1
+ test_failure_ 'tests clean up even on failures' '
...

This part?

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

* Re: make test
  2012-10-15 11:58           ` Joachim Schmitz
@ 2012-10-15 12:09             ` Johannes Sixt
  2012-10-15 12:34               ` Andreas Schwab
  2012-10-15 13:18               ` Joachim Schmitz
  0 siblings, 2 replies; 13+ messages in thread
From: Johannes Sixt @ 2012-10-15 12:09 UTC (permalink / raw)
  To: Joachim Schmitz; +Cc: git

Am 10/15/2012 13:58, schrieb Joachim Schmitz:
> ++ mkdir failing-cleanup
> ++ cd failing-cleanup
> ++ cat
> ++ chmod +x failing-cleanup.sh
> ++ test_must_fail ./failing-cleanup.sh
> + eval_ret=1

I wonder why the log does not show the commands of function
test_must_fail. Is there a 'set +x' hidden somewhere? Run
./failing-cleanup.sh manually. Check its exit code (it should be non-zero,
but not something strange like 127 and above; see test_must_fail()) and
dig further from there. I'll stop here.

-- Hannes

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

* Re: make test
  2012-10-15 12:09             ` Johannes Sixt
@ 2012-10-15 12:34               ` Andreas Schwab
  2012-10-15 13:18                 ` Joachim Schmitz
  2012-10-17  8:30                 ` Joachim Schmitz
  2012-10-15 13:18               ` Joachim Schmitz
  1 sibling, 2 replies; 13+ messages in thread
From: Andreas Schwab @ 2012-10-15 12:34 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: Joachim Schmitz, git

Johannes Sixt <j.sixt@viscovery.net> writes:

> Am 10/15/2012 13:58, schrieb Joachim Schmitz:
>> ++ mkdir failing-cleanup
>> ++ cd failing-cleanup
>> ++ cat
>> ++ chmod +x failing-cleanup.sh
>> ++ test_must_fail ./failing-cleanup.sh
>> + eval_ret=1
>
> I wonder why the log does not show the commands of function
> test_must_fail.

That's because stderr is redirected.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* RE: make test
  2012-10-15 12:09             ` Johannes Sixt
  2012-10-15 12:34               ` Andreas Schwab
@ 2012-10-15 13:18               ` Joachim Schmitz
  1 sibling, 0 replies; 13+ messages in thread
From: Joachim Schmitz @ 2012-10-15 13:18 UTC (permalink / raw)
  To: 'Johannes Sixt'; +Cc: git

> From: Johannes Sixt [mailto:j.sixt@viscovery.net]
> Sent: Monday, October 15, 2012 2:10 PM
> To: Joachim Schmitz
> Cc: git@vger.kernel.org
> Subject: Re: make test
> 
> Am 10/15/2012 13:58, schrieb Joachim Schmitz:
> > ++ mkdir failing-cleanup
> > ++ cd failing-cleanup
> > ++ cat
> > ++ chmod +x failing-cleanup.sh
> > ++ test_must_fail ./failing-cleanup.sh
> > + eval_ret=1
> 
> I wonder why the log does not show the commands of function
> test_must_fail. Is there a 'set +x' hidden somewhere? Run
> ./failing-cleanup.sh manually. Check its exit code (it should be non-zero,
> but not something strange like 127 and above; see test_must_fail()) and
> dig further from there. I'll stop here.


It returns 0.

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

* RE: make test
  2012-10-15 12:34               ` Andreas Schwab
@ 2012-10-15 13:18                 ` Joachim Schmitz
  2012-10-17  8:30                 ` Joachim Schmitz
  1 sibling, 0 replies; 13+ messages in thread
From: Joachim Schmitz @ 2012-10-15 13:18 UTC (permalink / raw)
  To: 'Andreas Schwab', 'Johannes Sixt'; +Cc: git

> From: Andreas Schwab [mailto:schwab@linux-m68k.org]
> Sent: Monday, October 15, 2012 2:35 PM
> To: Johannes Sixt
> Cc: Joachim Schmitz; git@vger.kernel.org
> Subject: Re: make test
> 
> Johannes Sixt <j.sixt@viscovery.net> writes:
> 
> > Am 10/15/2012 13:58, schrieb Joachim Schmitz:
> >> ++ mkdir failing-cleanup
> >> ++ cd failing-cleanup
> >> ++ cat
> >> ++ chmod +x failing-cleanup.sh
> >> ++ test_must_fail ./failing-cleanup.sh
> >> + eval_ret=1
> >
> > I wonder why the log does not show the commands of function
> > test_must_fail.
> 
> That's because stderr is redirected.
> 

cat err
++ ./failing-cleanup.sh
++ exit_code=0
++ test 0 = 0
++ echo 'test_must_fail: command succeeded: ./failing-cleanup.sh'
test_must_fail: command succeeded: ./failing-cleanup.sh
++ return 1

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

* RE: make test
  2012-10-15 12:34               ` Andreas Schwab
  2012-10-15 13:18                 ` Joachim Schmitz
@ 2012-10-17  8:30                 ` Joachim Schmitz
  1 sibling, 0 replies; 13+ messages in thread
From: Joachim Schmitz @ 2012-10-17  8:30 UTC (permalink / raw)
  To: 'Andreas Schwab', 'Johannes Sixt'; +Cc: git

> From: Joachim Schmitz [mailto:jojo@schmitz-digital.de]
> Sent: Monday, October 15, 2012 3:18 PM
> To: 'Andreas Schwab'; 'Johannes Sixt'
> Cc: 'git@vger.kernel.org'
> Subject: RE: make test
> 
> > From: Andreas Schwab [mailto:schwab@linux-m68k.org]
> > Sent: Monday, October 15, 2012 2:35 PM
> > To: Johannes Sixt
> > Cc: Joachim Schmitz; git@vger.kernel.org
> > Subject: Re: make test
> >
> > Johannes Sixt <j.sixt@viscovery.net> writes:
> >
> > > Am 10/15/2012 13:58, schrieb Joachim Schmitz:
> > >> ++ mkdir failing-cleanup
> > >> ++ cd failing-cleanup
> > >> ++ cat
> > >> ++ chmod +x failing-cleanup.sh
> > >> ++ test_must_fail ./failing-cleanup.sh
> > >> + eval_ret=1
> > >
> > > I wonder why the log does not show the commands of function
> > > test_must_fail.
> >
> > That's because stderr is redirected.
> >
> 
> cat err
> ++ ./failing-cleanup.sh
> ++ exit_code=0
> ++ test 0 = 0
> ++ echo 'test_must_fail: command succeeded: ./failing-cleanup.sh'
> test_must_fail: command succeeded: ./failing-cleanup.sh
> ++ return 1

That test (as well as quite a few more) do pass when using bash rather than our sh (which really is a ksh)

Bye, Jojo

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

* Re: make test
@ 2012-10-22 14:19 Joachim Schmitz
  0 siblings, 0 replies; 13+ messages in thread
From: Joachim Schmitz @ 2012-10-22 14:19 UTC (permalink / raw)
  To: git

"Joachim Schmitz" <jojo@schmitz-digital.de> schrieb im Newsbeitrag news:<k5gov5$fe1$1@ger.gmane.org>...
> Hi folks
> 
> I'm trying to understand why certain tests in 'make test' fail. Here's the 
> first one
> 
> $ ../git --version
> git version 1.8.0.rc2.5.g6b89306
> $ GIT_TEST_CMP_USE_COPIED_CONTEXT=true ./t0000-basic.sh # our diff doesn't 
> understand -u
> ok 1 - .git/objects should be empty after git init in an empty repo
> ...
> ok 3 - success is reported like this
> not ok 4 - pretend we have a known breakage # TODO known breakage
> 
>     This is expected, right?
> 
> ok 5 - pretend we have fixed a known breakage (run in sub test-lib)
> ...
> ok 11 - tests clean up after themselves
> 
>     the next is not though? Why might it be failing, where to check?
> 
> not ok - 12 tests clean up even on failures
> #
> #               mkdir failing-cleanup &&
> #               (
> #               cd failing-cleanup &&
> #
> #               cat >failing-cleanup.sh <<-EOF &&
> #               #!/bin/sh
> #
> #               test_description='Failing tests with cleanup commands'
> #
> #               # Point to the t/test-lib.sh, which isn't in ../ as usual
> #               TEST_DIRECTORY="/home/jojo/git/git/t"
> #               . "$TEST_DIRECTORY"/test-lib.sh
> #
> #               test_expect_success 'tests clean up even after a failure' '
> #                       touch clean-after-failure &&
> #                       test_when_finished rm clean-after-failure &&
> #                       (exit 1)
> #               '
> #               test_expect_success 'failure to clean up causes the test to 
> fail' '
> #                       test_when_finished "(exit 2)"
> #               '
> #               test_done
> #
> #               EOF
> #
> #               chmod +x failing-cleanup.sh &&
> #               test_must_fail ./failing-cleanup.sh >out 2>err &&
> #               ! test -s err &&
> #               ! test -f "trash 
> directory.failing-cleanup/clean-after-failure" &&
> #               sed -e 's/Z$//' -e 's/^> //' >expect <<-\EOF &&
> #               > not ok - 1 tests clean up even after a failure
> #               > #     Z
> #               > #     touch clean-after-failure &&
> #               > #     test_when_finished rm clean-after-failure &&
> #               > #     (exit 1)
> #               > #     Z
> #               > not ok - 2 failure to clean up causes the test to fail
> #               > #     Z
> #               > #     test_when_finished "(exit 2)"
> #               > #     Z
> #               > # failed 2 among 2 test(s)
> #               > 1..2
> #               EOF
> #               test_cmp expect out
> #               )
> #
> ok 13 - git update-index without --add should fail adding
> ...
> ok 47 - very long name in the index handled sanely
> # still have 1 known breakage(s)
> # failed 1 among remaining 46 test(s)
> 1..47

As mentioned elsethread this works if using bash rather than the system's sh (which is a ksh)

But there are several other failures. After some investigations and experiments I found the following tests to fail with the system
provided grep (for which I had to set GIT_TEST_CMP_USE_COPIED_CONTEXT), but succeed with GNU grep:
t3308 #14, #15, #17and #19
t3310 #10, #12, #14 and #18
t4047 #38 and #39
t4050 #2 and #3
t4116 #3, #4 and #5
t5509 #2
t7401 #18

The following fail with the system provided tar, but succeed with GNU tar:
t0024 #2
t4116 #4,
t5000 #14, #16, #20, #24, #26 and #51
t5001 #2, #6, #10 and #15

The following tests fail with the system provided sh (which is a ksh really), but succeed with bash:
t0000 #12
t0001 #20
t1450 #17 and #18
(t0204 #3 and #8 succeed in sh but fail in bash. They succeed in bash too when /usr/local/bin is in PATH first though, which would
sort the diff and tar problem too, need to investigate why)
t3006 #2 and #3

t3403 #4, #5, #8 and #9
t3404 #2 - #13, #14 - #18, #20 - #41, #44, #46 - #70
t3409 #2 - #5
t3410 #2 and #3
t3411 #2 and #3
t3412 #8, #10 - #12, #15, #17, #23, #25, -26, #28, #29, #31
t3413 #3, #5 - #10, #14, #15
and many more...

The following needs bash and /usr/local/bin first in PATH ("PATH=/usr/local/bin:$PATH make test")
t0204 #3 and #8 (or just sh, see above)
t3032 #11
t3900 #24, #25
t4201 #8
t5000 #14
t5150 #6

I though "SANE_TOOL_PATH=/usr/local/bin" plus "SHELL_PATH=/usr/local/bin/bash" would to fix the all but it does not and instead
brings up some other failures too:
t5521 #2 and #5
t5526 #2, #5, #8, #10, #12, #13, #16 - #19, #21 - #25
t5702 #3
t5800 #2, #3, #5 - #14
t9001 #66

With additionally having "PATH=/usr/local/bin:$PATH" all but one work, so there must be something wrong with SANE_TOOL_PATH?.
The single failure remaining is
t0301 #12 "helper (cache --timeout=1) times out"
I don't understand this at all, neither the -v options nor running it with bash -x helps me in understanding what the issue is.

Bye, Jojo

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

end of thread, other threads:[~2012-10-22 14:19 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-22 14:19 make test Joachim Schmitz
  -- strict thread matches above, loose matches on Subject: below --
2012-10-15 10:36 Joachim Schmitz
2012-10-15 10:53 ` Johannes Sixt
2012-10-15 11:00   ` Joachim Schmitz
2012-10-15 11:18     ` Johannes Sixt
2012-10-15 11:37       ` Joachim Schmitz
2012-10-15 11:52         ` Johannes Sixt
2012-10-15 11:58           ` Joachim Schmitz
2012-10-15 12:09             ` Johannes Sixt
2012-10-15 12:34               ` Andreas Schwab
2012-10-15 13:18                 ` Joachim Schmitz
2012-10-17  8:30                 ` Joachim Schmitz
2012-10-15 13:18               ` Joachim Schmitz

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).