git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] tests: Use skip_all=<reason> to skip tests

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 9, 2010, 22:47 UTC
Message-ID
<7vlj9kl1bv.fsf@alter.siamese.dyndns.org>
In-Reply-To
<AANLkTilPkKI9KdEc84Zhh3Vn7_B7CYT3UDSkSv7JwGJG@mail.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 18 quoted lines
> On Fri, Jul 9, 2010 at 17:49, Junio C Hamano <gitster@pobox.com> wrote:
> ...
>> Among 63 assignments to $skip_all that are all over in t/*.sh scripts, the
>> only ones that are not immediately followed by test_done are in
>> lib-git-svn.sh (chooses one among 3 messages), lib-httpd.sh (sets a trap
>> before calling test_done), and t3600-rm (makes a mental note to report
>> that one test was skipped long before all the tests run).
> ...
>     $ perl -MTest::More -E 'plan tests => 6; pass "gettext stuff ok"
> for 1..2; SKIP: { skip "Can not test without locale files", 2 } pass
> "moo" for 1..2'
>     1..6
>     ok 1 - gettext stuff ok
>     ok 2 - gettext stuff ok
>     ok 3 # skip Can not test without locale files
>     ok 4 # skip Can not test without locale files
>     ok 5 - moo
>     ok 6 - moo
Now you are talking.

What t3600-rm does becomes a lot more natural to express with something like this. Any test with "prerequisite" missing will automatically get "this test was skipped because you lack this prerequisite" for free. We can lose skip_all= assignment there but move the logic to test-lib.sh, which is a good thing.

But that is orthogonal to what you call an API, i.e. your assignment to the global variable $skip_all that is immediately followed by test_done, no? The conversion you did for that does not help counting the remainder of the tests that are skipped anyway, so you will need to redo that conversion altogether if you ever want to be able to show "these tests through the end of the scripts were skipped".

Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 6 of 7 in “tests: Use skip_all=* to skip tests”
  1. tests: Use skip_all=* to skip testsÆvar Arnfjörð Bjarmason, Jul 8, 2010
  2. Michael J GruberJul 9, 2010
  3. tests: Use skip_all=<reason> to skip testsÆvar Arnfjörð Bjarmason, Jul 9, 2010
  4. Junio C HamanoJul 9, 2010
  5. Ævar Arnfjörð BjarmasonJul 9, 2010
  6. Junio C HamanoJul 9, 2010
  7. Ævar Arnfjörð BjarmasonJul 9, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.