<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/t0000-basic.sh, branch v2.24.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.24.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.24.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2019-10-15T04:48:02Z</updated>
<entry>
<title>Merge branch 'dl/t0000-skip-test-test'</title>
<updated>2019-10-15T04:48:02Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-10-15T04:48:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4e8371ec26f0baeca9ff47233805dc1010d8e8d9'/>
<id>urn:sha1:4e8371ec26f0baeca9ff47233805dc1010d8e8d9</id>
<content type='text'>
test update.

* dl/t0000-skip-test-test:
  t0000: cover GIT_SKIP_TESTS blindspots
</content>
</entry>
<entry>
<title>t0000: cover GIT_SKIP_TESTS blindspots</title>
<updated>2019-10-09T01:47:08Z</updated>
<author>
<name>Denton Liu</name>
<email>liu.denton@gmail.com</email>
</author>
<published>2019-10-08T09:22:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b05b40930ebfbd12ba89f73f15a46dfb107b16f6'/>
<id>urn:sha1:b05b40930ebfbd12ba89f73f15a46dfb107b16f6</id>
<content type='text'>
Currently, the tests for GIT_SKIP_TESTS do not cover the situation where
we skip an entire test suite. The tests also do not cover the situation
where we have GIT_SKIP_TESTS defined but the test suite does not match.

Add two test cases so we cover this blindspot.

Signed-off-by: Denton Liu &lt;liu.denton@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sg/show-failed-test-names'</title>
<updated>2019-08-22T19:34:11Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-08-22T19:34:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8ae7a46c4d74d14defe31cb5421787bc22b6b462'/>
<id>urn:sha1:8ae7a46c4d74d14defe31cb5421787bc22b6b462</id>
<content type='text'>
The first line of verbose output from each test piece now carries
the test name and number to help scanning with eyeballs.

* sg/show-failed-test-names:
  tests: show the test name and number at the start of verbose output
  t0000-basic: use realistic test script names in the verbose tests
</content>
</entry>
<entry>
<title>Merge branch 'bc/hash-independent-tests-part-4'</title>
<updated>2019-08-09T17:13:14Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-08-09T17:13:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fcdd9cc86d9efeb6b4bbcb9cff98d5a329afffcb'/>
<id>urn:sha1:fcdd9cc86d9efeb6b4bbcb9cff98d5a329afffcb</id>
<content type='text'>
Test fix.

* bc/hash-independent-tests-part-4:
  t0000: reword comments for "local" test
  t: decrease nesting in test_oid_to_path
</content>
</entry>
<entry>
<title>t0000: reword comments for "local" test</title>
<updated>2019-08-08T17:22:55Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2019-08-08T09:37:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7f0b5908759c59b77b39c62184166325e30f8878'/>
<id>urn:sha1:7f0b5908759c59b77b39c62184166325e30f8878</id>
<content type='text'>
Commit 01d3a526ad (t0000: check whether the shell supports the "local"
keyword, 2017-10-26) added a test to gather data on whether people run
the test suite with shells that don't support "local".

After almost two years, nobody has complained, and several other uses
have cropped up in test-lib-functions.sh. Let's declare it acceptable to
use.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>tests: show the test name and number at the start of verbose output</title>
<updated>2019-08-05T22:21:33Z</updated>
<author>
<name>SZEDER Gábor</name>
<email>szeder.dev@gmail.com</email>
</author>
<published>2019-08-05T21:04:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ffe1afe67c0fab1786ad2aa9668efabe773f73c3'/>
<id>urn:sha1:ffe1afe67c0fab1786ad2aa9668efabe773f73c3</id>
<content type='text'>
The verbose output of every test looks something like this:

  expecting success:
          echo content &gt;file &amp;&amp;
          git add file &amp;&amp;
          git commit -m "add file"

  [master (root-commit) d1fbfbd] add file
   Author: A U Thor &lt;author@example.com&gt;
   1 file changed, 1 insertion(+)
   create mode 100644 file
  ok 1 - commit works

i.e. first an "expecting success" (or "checking known breakage") line
followed by the commands to be executed, then the output of those
comamnds, and finally an "ok"/"not ok" line containing the test name.
Note that the test's name is only shown at the very end.

With '-x' tracing enabled and/or in longer tests the verbose output
might be several screenfulls long, making it harder than necessary to
find where the output of the test with a given name starts (especially
when the outputs to different file descriptors are racing, and the
"expecting success"/command block arrives earlier than the "ok" line
of the previous test).

Print the test name at the start of the test's verbose output, i.e. at
the end of the "expecting success" and "checking known breakage"
lines, to make the start of a particular test a bit easier to
recognize.  Also print the test script and test case numbers, to help
those poor souls who regularly have to scan through the combined
verbose output of several test scripts.

So the dummy test above would start like this:

  expecting success of 9999.1 'commit works':
          echo content &gt;file &amp;&amp;
  [...]

Signed-off-by: SZEDER Gábor &lt;szeder.dev@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t0000-basic: use realistic test script names in the verbose tests</title>
<updated>2019-08-05T22:21:31Z</updated>
<author>
<name>SZEDER Gábor</name>
<email>szeder.dev@gmail.com</email>
</author>
<published>2019-08-05T21:04:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=96f3ccc2abf81520740de857471ab6b200f0ea3b'/>
<id>urn:sha1:96f3ccc2abf81520740de857471ab6b200f0ea3b</id>
<content type='text'>
Our test scripts are named something like 't1234-command.sh', but the
script names used in 't0000-basic.sh' don't follow this naming
convention.  Normally this doesn't matter, because the test scripts
themselves don't care how they are called.  However, the next patch
will start to include the test number in the test's verbose output, so
the test script's name will matter in the two tests checking the
verbose output.

Update the tests 'test --verbose' and 'test --verbose-only' to follow
out test script naming convention.

Leave the other tests in 't0000' unchanged: changing the names of
their test scripts would be only pointless code churn.

Signed-off-by: SZEDER Gábor &lt;szeder.dev@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>tests: make GIT_TEST_FAIL_PREREQS a boolean</title>
<updated>2019-06-21T16:42:49Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2019-06-21T10:18:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c740039921528198efa21f9cf6ccb849e74164c4'/>
<id>urn:sha1:c740039921528198efa21f9cf6ccb849e74164c4</id>
<content type='text'>
Change the GIT_TEST_FAIL_PREREQS variable from being "non-empty?" to
being a more standard boolean variable. I recently added the variable
in dfe1a17df9 ("tests: add a special setup where prerequisites fail",
2019-05-13), having to add another "non-empty?" special-case is what
prompted me to write the "git env--helper" utility being used here.

Converting this one is a bit tricky since we use it so early and
frequently in the guts of the test code itself, so let's set a
GIT_TEST_FAIL_PREREQS_INTERNAL which can be tested with the old "test
-n" for the purposes of the shell code, and change the user-exposed
and documented GIT_TEST_FAIL_PREREQS variable to a boolean.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>tests: add a special setup where prerequisites fail</title>
<updated>2019-05-14T07:48:17Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2019-05-13T18:32:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dfe1a17df9b1bd9ab95095e248b8f376637ac395'/>
<id>urn:sha1:dfe1a17df9b1bd9ab95095e248b8f376637ac395</id>
<content type='text'>
As discussed in [1] there's a regression in the "pu" branch now
because a new test implicitly assumed that a previous test guarded by
a prerequisite had been run. Add a "GIT_TEST_FAIL_PREREQS" special
test setup where we'll skip (nearly) all tests guarded by
prerequisites, allowing us to easily emulate those platform where we
don't run these tests.

As noted in the documentation I'm adding I'm whitelisting the SYMLINKS
prerequisite for now. A lot of tests started failing if we lied about
not supporting symlinks. It's also unlikely that we'll have a failing
test due to a hard dependency on symlinks without that being the
obvious cause, so for now it's not worth the effort to make it work.

1. https://public-inbox.org/git/nycvar.QRO.7.76.6.1905131531000.44@tvgsbejvaqbjf.bet/

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>test-lib: introduce 'test_atexit'</title>
<updated>2019-03-14T03:34:39Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2019-03-13T12:24:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=900721e15c43742955878dbbdb24c5a2ce262630'/>
<id>urn:sha1:900721e15c43742955878dbbdb24c5a2ce262630</id>
<content type='text'>
When running Apache, 'git daemon', or p4d, we want to kill them at the
end of the test script, otherwise a leftover daemon process will keep
its port open indefinitely, and thus will interfere with subsequent
executions of the same test script.

So far, we stop these daemon processes "manually", i.e.:

  - by registering functions or commands in the trap on EXIT to stop
    the daemon while preserving the last seen exit code before the
    trap (to deal with a failure when run with '--immediate' or with
    interrupts by ctrl-C),

  - and by invoking these functions/commands last thing before
    'test_done' (and sometimes restoring the test framework's default
    trap on EXIT, to prevent the daemons from being killed twice).

On one hand, we do this inconsistently, e.g. 'git p4' tests invoke
different functions in the trap on EXIT and in the last test before
'test_done', and they neither restore the test framework's default trap
on EXIT nor preserve the last seen exit code.  On the other hand, this
is error prone, because, as shown in a previous patch in this series,
any output from the cleanup commands in the trap on EXIT can prevent a
proper cleanup when a test script run with '--verbose-log' and certain
shells, notably 'dash', is interrupted.

Let's introduce 'test_atexit', which is loosely modeled after
'test_when_finished', but has a broader scope: rather than running the
commands after the current test case, run them when the test script
finishes, and also run them when the test is interrupted, or exits
early in case of a failure while the '--immediate' option is in
effect.

When running the cleanup commands at the end of a successful test,
then they will be run in 'test_done' before it removes the trash
directory, i.e. the cleanup commands will still be able to access any
pidfiles or socket files in there.  When running the cleanup commands
after an interrupt or failure with '--immediate', then they will be
run in the trap on EXIT.  In both cases they will be run in
'test_eval_', i.e. both standard error and output of all cleanup
commands will go where they should according to the '-v' or
'--verbose-log' options, and thus won't cause any troubles when
interrupting a test script run with '--verbose-log'.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: SZEDER Gábor &lt;szeder.dev@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
