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

Re: [GSOC][RFC] microproject: use test_path_is_* functions in test scripts

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 13, 2024, 17:49 UTC
Message-ID
<xmqqy1bo5k5h.fsf@gitster.g>
In-Reply-To
<cbb450b3-b333-4391-ac83-66c2daf0ae4d@gmail.com>
Vincenzo MEZZELA <vincenzo.mezzela@gmail.com> writes:
Show 12 quoted lines
> Approach:
>
> As far as I understood, The work consists in replacing the shell
> 'test' command in the test
> script under 't/' directory with the ones present in the
> t/test_lib_functions.sh as follows:
>
> - test -f --> test_path_is_file
>
> - test -d --> test_path_is_dir
>
> - test -e --> test_path_exists

One thing to note is that you'd need to make sure if "test -e" for example originally written really means "we want to see something there and it does not matter if it is a file or a directory" while turning it into test_path_exists. The operations that such a test follows may be expected to create a file and never a directory, in which case the condition the original code is testing may need to be corrected first to expect a more specific type (e.g. "test -f"). The same comment applies for the other two.

Some tests check with "! test -f <path>", which often would want to be turned into "test_path_is_missing", but you'd need to make sure that is what the original test really meant to do.

A microproject is not about "doing the real work to help the project". It is a practice session to come up with a set of small changes and explain them well, to send the result to the list to get reviewed, to respond to reviews and possibly send updates, and to repeat the cycle until completion. So most likely you'd pick a single file or two and do the above conversion, while leaving the others as practice material for other GSoC participants.

Enjoy.
Previous: Eric SunshineNext: vincenzo mezzela
Message 4 of 5 in “[GSOC][RFC] microproject: use test_path_is_* functions in test scripts”
  1. Vincenzo MEZZELAFeb 13, 2024
  2. Christian CouderFeb 13, 2024
  3. Eric SunshineFeb 13, 2024
  4. Junio C HamanoFeb 13, 2024
  5. vincenzo mezzelaFeb 14, 2024

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.