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

Re: [PATCH 06/28] t0000: annotate with SHA1 prerequisite

From
MÅMartin Ågren <martin.agren@gmail.com>
Date
May 8, 2018, 18:28 UTC
Message-ID
<CAN0heSq8EYxVx9Qpb==KgeBVT3AXtgK6f+CQyK_kNUXZHMMnLA@mail.gmail.com>
In-Reply-To
<20180507234058.GJ953644@genre.crustytoothpaste.net>
On 8 May 2018 at 01:40, brian m. carlson <sandals@crustytoothpaste.net> wrote:
Show 22 quoted lines
> On Mon, May 07, 2018 at 12:24:13PM +0200, Martin Ågren wrote:
>> This could be more centralized at the top of the file, more likely to be
>> noticed during a `make test` and easier to adapt in the future. Maybe
>> something like this at the top of the file:
>>
>> if hash for storage is SHA-1 then
>>         knowntree=7bb943559a305bdd6bdee2cef6e5df2413c3d30a
>>         path0=f87290f8eb2cbbea7857214459a0739927eab154
>>         ....
>> else
>>         skip_all='unknown hash, but you really need to expand this test'
>>         # or even error out!
>> fi
>
> As I mentioned in an earlier email, I plan to set an environment
> variable for the algorithms in use and then do something like:
>
>   test "$tree" = "$(test-tool hash-helper --output known-tree)"
>
> where "known-tree" is some key we can use to look up the SHA-1 or
> NewHash value, and we've specified we want the output format (as opposed
> to input format or on-disk format).

My first thought was, can't we introduce such a helper already now? It would not check with the environment, but would always output SHA-1 values. Thinking about it some more, maybe the exact usage/interface would be a bit volatile in the beginning, making it just as good an idea to gain some more experience and feeling first.

Show 15 quoted lines
>> When we add NewHash, we get to add an "else if". Otherwise, we'd be
>> plugging in NewHash without testing some very basic stuff.
>>
>> Ok, so `skip_all` is quite hard, but skipping certain basic tests also
>> feels really shaky. Adding a new hash algo without adapting this test
>> should be a no-go, IMHO.
>
> I agree that this test needs to be updated for NewHash, but since we
> haven't decided what that's going to be, it makes sense during
> development to still test the rest of the code if possible so that we
> know what does and doesn't work.
>
> This is a first step in making it obvious what doesn't work, and when we
> know what the data is supposed to be, we can adjust it by fixing the
> tests so that it works in all cases.

A lingering feeling is, how do we find all these tests that we "hide" (for lack of a better word)? Maybe introduce some standardized comment keyword. Or use a more grep-friendly prereq-name. Or, if all occurances of "SHA1" (outside of t????-*sha*) are expected to go away real soon now, maybe this is not an issue.

Anyway, thanks for putting up with me, and thanks a big lot for driving this major undertaking forward.

Martin
Previous: brian m. carlsonNext: brian m. carlson
Message 16 of 46 in “Hash-independent tests (part 2)”
  1. 00/28 Hash-independent tests (part 2)brian m. carlson, May 6, 2018
  2. 01/28 t/test-lib: add an SHA1 prerequisitebrian m. carlson, May 6, 2018
  3. Martin ÅgrenMay 7, 2018
  4. brian m. carlsonMay 7, 2018
  5. Martin ÅgrenMay 8, 2018
  6. brian m. carlsonMay 8, 2018
  7. 02/28 t/test-lib: introduce ZERO_OIDbrian m. carlson, May 6, 2018
  8. 03/28 t: switch $_z40 to $ZERO_OIDbrian m. carlson, May 6, 2018
  9. 04/28 t/test-lib: introduce FULL_HEXbrian m. carlson, May 6, 2018
  10. Eric SunshineMay 6, 2018
  11. brian m. carlsonMay 7, 2018
  12. 05/28 t: switch $_x40 to $FULL_HEXbrian m. carlson, May 6, 2018
  13. 06/28 t0000: annotate with SHA1 prerequisitebrian m. carlson, May 6, 2018
  14. Martin ÅgrenMay 7, 2018
  15. brian m. carlsonMay 7, 2018
  16. Martin ÅgrenMay 8, 2018
  17. brian m. carlsonMay 9, 2018
  18. 07/28 t1007: annotate with SHA1 prerequisitebrian m. carlson, May 6, 2018
  19. 09/28 t4044: skip test if not using SHA-1brian m. carlson, May 6, 2018
  20. 10/28 t: skip pack tests if not using SHA-1brian m. carlson, May 6, 2018
  21. Martin ÅgrenMay 7, 2018
  22. 12/28 t3103: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  23. 11/28 t2203: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  24. 14/28 t3905: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  25. Eric SunshineMay 7, 2018
  26. brian m. carlsonMay 7, 2018
  27. 16/28 t4008: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  28. Eric SunshineMay 7, 2018
  29. brian m. carlsonMay 7, 2018
  30. 17/28 t4014: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  31. 20/28 t4029: fix test indentationbrian m. carlson, May 6, 2018
  32. 21/28 t4029: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  33. 22/28 t4030: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  34. 24/28 t4205: sort log output in a hash-independent waybrian m. carlson, May 6, 2018
  35. 25/28 t4042: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  36. 23/28 t/lib-diff-alternative: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  37. 27/28 t4208: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  38. 28/28 t5300: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  39. 26/28 t4045: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  40. 18/28 t4020: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  41. 19/28 t4022: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  42. 08/28 t1512: skip test if not using SHA-1brian m. carlson, May 6, 2018
  43. 15/28 t4007: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  44. 13/28 t3702: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  45. Eric SunshineMay 7, 2018
  46. brian m. carlsonMay 7, 2018

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.