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

Re: [PATCHv2 2/6] t7408: merge short tests, factor out testing method

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 6, 2016, 17:02 UTC
Message-ID
<xmqqshuhj0ea.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20160806012318.17968-3-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
> +test_alternate_usage() {
According to Documentation/CodingGuidelines, this should be:
    test_alternate_usage () {

Somehow the helper name sounds as if it is testing if an alternate is used correctly (i.e. the machinery may attempt to use alternate but not in a correct way), not testing if an alternate is correctly used (i.e. the machinery incorrectly forgets to use an alternate at all), but maybe it is just me.

> +test_expect_success 'updating superproject keeps alternates' '
> +	test_when_finished "rm -rf super-clone" &&

This one is new; we do not remove A, B or super. According to the previous round of review, this is a deliberate design, that needs to be spelled out by having a comment block before this test so that other people who add more tests can understand why they need to clean when they follow suit. Perhaps something like:

    ###############################################################
    # The tests up to this point, and repositories created by them
    # (A, B, super and super/sub), are about setting up the stage
    # forsubsequent tests and meant to be kept throughout the
    # remainder of the test.
    # Tests from here on, if they create their own test repository,
    # are expected to clean after themselves.
    test_expect_success 'updating superproject keeps alternates' '
            test_when_finished "rm -rf super-clone" &&
Previous: Stefan BellerNext: Stefan Beller
Message 5 of 12 in “[PATCHv2 0/6] git clone: Marry --recursive and --reference”
  1. Stefan BellerAug 6, 2016
  2. Junio C HamanoAug 6, 2016
  3. Stefan BellerAug 8, 2016
  4. 2/6 t7408: merge short tests, factor out testing methodStefan Beller, Aug 6, 2016
  5. Junio C HamanoAug 6, 2016
  6. 3/6 submodule--helper module-clone: allow multiple referencesStefan Beller, Aug 6, 2016
  7. 4/6 submodule--helper update-clone: allow multiple referencesStefan Beller, Aug 6, 2016
  8. Junio C HamanoAug 6, 2016
  9. 1/6 t7408: modernize styleStefan Beller, Aug 6, 2016
  10. 6/6 clone: reference flag is used for submodules as wellStefan Beller, Aug 6, 2016
  11. 5/6 submodule update: add super-reference flagStefan Beller, Aug 6, 2016
  12. Junio C HamanoAug 6, 2016

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.