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

Re: [RFC/PoC 3/5] test-lib: add GIT_BUNDLE_DIR setup

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Nov 3, 2022, 09:14 UTC
Message-ID
<221103.86v8nw1jpi.gmgdl@evledraar.gmail.com>
In-Reply-To
<20221102224843.2104-4-philipoakley@iee.email>
On Wed, Nov 02 2022, Philip Oakley wrote:
Show 31 quoted lines
> The test system may output a number of documentation bundles containing
> test repositories of interest to users, including those explicitly
> documented.
>
> Provide a default location for holding those bundles.
> As build artefact's this location, along with `.bndl` files, was
> ignored in an earlier commit.
>
> This may need further refinement.
>
> Signed-off-by: Philip Oakley <philipoakley@iee.email>
> ---
>  t/test-lib.sh | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/t/test-lib.sh b/t/test-lib.sh
> index 4e45bc7c4f..b18cd8a34e 100644
> --- a/t/test-lib.sh
> +++ b/t/test-lib.sh
> @@ -56,6 +56,20 @@ then
>  	echo "PANIC: Running in a $TEST_DIRECTORY that doesn't end in '/t'?" >&2
>  	exit 1
>  fi
> +if test -z "$GIT_BUNDLE_DIR"
> +then
> +	# Similarly, override this to store the documentation bundles subdir
> +	# elsewhere
> +	GIT_BUNDLE_DIR=$TEST_DIRECTORY/GIT_BUNDLE_DIR
> +	if test ! -d "$GIT_BUNDLE_DIR"
> +	then
> +		mkdir -p "$GIT_BUNDLE_DIR"

Okey, so "mkdir -p", not "mkdir" once one thinks about it for a second: Because we might be testing in parallel, so this will be racy.

Show 6 quoted lines
> +	fi
> +elif test ! -d "$GIT_BUNDLE_DIR"
> +then
> +	echo "PANIC: Your "$GIT_BUNDLE_DIR" doesn't exist!" >&2
> +	exit 1
> +fi
I think it's better just to put these in the "test-results" dir.

For leak testing I have local patches to e.g. create test-results/<test number>.leak, and then after a run I slurp that up and process it.

So, same idea, you could just add stuff there, and afterwards grab it there. No need for specifying the dir etc., you just need a test-lib.sh flag to say "yes, write these out".

Previous: Philip OakleyNext: Philip Oakley
Message 10 of 15 in “[RFC/PoC 0/5] Provide example docbundles”
  1. Philip OakleyNov 2, 2022
  2. 2/5 Documentation Bundles: ignore artifact files from creating doc bundlesPhilip Oakley, Nov 2, 2022
  3. Ævar Arnfjörð BjarmasonNov 3, 2022
  4. Philip OakleyNov 3, 2022
  5. 1/5 doc: provide DocBundles design documentPhilip Oakley, Nov 2, 2022
  6. Ævar Arnfjörð BjarmasonNov 3, 2022
  7. Philip OakleyNov 3, 2022
  8. Ævar Arnfjörð BjarmasonNov 3, 2022
  9. 3/5 test-lib: add GIT_BUNDLE_DIR setupPhilip Oakley, Nov 2, 2022
  10. Ævar Arnfjörð BjarmasonNov 3, 2022
  11. Philip OakleyNov 3, 2022
  12. 4/5 Doc Bundles: add t6102 rev-list simple and pulls examplesPhilip Oakley, Nov 2, 2022
  13. 5/5 docbundle: provide the git-log History Simplification examplePhilip Oakley, Nov 2, 2022
  14. Ævar Arnfjörð BjarmasonNov 3, 2022
  15. Philip OakleyNov 3, 2022

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.