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

Re: [PATCH v3 07/28] t1007: annotate with SHA1 prerequisite

From
Stefan Beller <sbeller@google.com>
Date
May 16, 2018, 16:56 UTC
Message-ID
<CAGZ79kZ3UVYgu6xO9OCT9ZZfarhmZ+iG+J0nMNzfnZ_jrnu8ag@mail.gmail.com>
In-Reply-To
<20180516015630.661349-8-sandals@crustytoothpaste.net>
Hi brian,

On Tue, May 15, 2018 at 6:56 PM, brian m. carlson <sandals@crustytoothpaste.net> wrote:

Show 29 quoted lines
> Since this is a core test that tests basic functionality, annotate the
> assertions that have dependencies on SHA-1 with the appropriate
> prerequisite.
>
> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
> ---
>  t/t1007-hash-object.sh | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/t/t1007-hash-object.sh b/t/t1007-hash-object.sh
> index 532682f51c..a37753047e 100755
> --- a/t/t1007-hash-object.sh
> +++ b/t/t1007-hash-object.sh
> @@ -9,13 +9,13 @@ echo_without_newline() {
>  }
>
>  test_blob_does_not_exist() {
> -       test_expect_success 'blob does not exist in database' "
> +       test_expect_success SHA1 'blob does not exist in database' "
>                 test_must_fail git cat-file blob $1
>         "
>  }
>
>  test_blob_exists() {
> -       test_expect_success 'blob exists in database' "
> +       test_expect_success SHA1 'blob exists in database' "
>                 git cat-file blob $1
>         "
>  }

For the 2 occurrences above I think the SHA1 requirement is not needed as the check if a blob exists (and the id is given as $1) is independent of the hash function, it is just important that the same hash function is used in the git-cat-file as well as...

Show 7 quoted lines
> @@ -73,19 +73,19 @@ test_expect_success "Can't use --path with --no-filters" '
>
>  push_repo
>
> -test_expect_success 'hash a file' '
> +test_expect_success SHA1 'hash a file' '
>         test $hello_sha1 = $(git hash-object hello)

... here, where we create the blob to test without writing it into the object database. In a way we test that the absence of -w works correctly.

Oh, the $hello_sha1 is hard coded, which is why we think this test is SHA1 dependent.

But that would fit in line with the test_blob[_does_not]_exist being independent of the hashes?

Stefan
Previous: brian m. carlsonNext: brian m. carlson
Message 8 of 64 in “Hash-independent tests”
  1. 00/28 Hash-independent testsbrian m. carlson, May 16, 2018
  2. 01/28 t/test-lib: add an SHA1 prerequisitebrian m. carlson, May 16, 2018
  3. 02/28 t/test-lib: introduce ZERO_OIDbrian m. carlson, May 16, 2018
  4. 04/28 t/test-lib: introduce OID_REGEXbrian m. carlson, May 16, 2018
  5. 03/28 t: switch $_z40 to $ZERO_OIDbrian m. carlson, May 16, 2018
  6. 05/28 t: switch $_x40 to $OID_REGEXbrian m. carlson, May 16, 2018
  7. 07/28 t1007: annotate with SHA1 prerequisitebrian m. carlson, May 16, 2018
  8. Stefan BellerMay 16, 2018
  9. brian m. carlsonMay 16, 2018
  10. 09/28 t4044: skip test if not using SHA-1brian m. carlson, May 16, 2018
  11. 10/28 t: skip pack tests if not using SHA-1brian m. carlson, May 16, 2018
  12. 11/28 t2203: abstract away SHA-1-specific constantsbrian m. carlson, May 16, 2018
  13. 14/28 t3905: abstract away SHA-1-specific constantsbrian m. carlson, May 16, 2018
  14. 17/28 t4014: abstract away SHA-1-specific constantsbrian m. carlson, May 16, 2018
  15. 21/28 t4029: abstract away SHA-1-specific constantsbrian m. carlson, May 16, 2018
  16. 23/28 t/lib-diff-alternative: abstract away SHA-1-specific constantsbrian m. carlson, May 16, 2018
  17. 24/28 t4205: sort log output in a hash-independent waybrian m. carlson, May 16, 2018
  18. 26/28 t4045: abstract away SHA-1-specific constantsbrian m. carlson, May 16, 2018
  19. 27/28 t4208: abstract away SHA-1-specific constantsbrian m. carlson, May 16, 2018
  20. 28/28 t5300: abstract away SHA-1-specific constantsbrian m. carlson, May 16, 2018
  21. 22/28 t4030: abstract away SHA-1-specific constantsbrian m. carlson, May 16, 2018
  22. 25/28 t4042: abstract away SHA-1-specific constantsbrian m. carlson, May 16, 2018
  23. 18/28 t4020: abstract away SHA-1-specific constantsbrian m. carlson, May 16, 2018
  24. 20/28 t4029: fix test indentationbrian m. carlson, May 16, 2018
  25. 15/28 t4007: abstract away SHA-1-specific constantsbrian m. carlson, May 16, 2018
  26. 12/28 t3103: abstract away SHA-1-specific constantsbrian m. carlson, May 16, 2018
  27. 19/28 t4022: abstract away SHA-1-specific constantsbrian m. carlson, May 16, 2018
  28. 13/28 t3702: abstract away SHA-1-specific constantsbrian m. carlson, May 16, 2018
  29. Stefan BellerMay 16, 2018
  30. brian m. carlsonMay 16, 2018
  31. 16/28 t4008: abstract away SHA-1-specific constantsbrian m. carlson, May 16, 2018
  32. 06/28 t0000: annotate with SHA1 prerequisitebrian m. carlson, May 16, 2018
  33. 08/28 t1512: skip test if not using SHA-1brian m. carlson, May 16, 2018
  34. 00/28 Hash-independent testsbrian m. carlson, May 21, 2018
  35. 01/28 t/test-lib: add an SHA1 prerequisitebrian m. carlson, May 21, 2018
  36. 02/28 t/test-lib: introduce ZERO_OIDbrian m. carlson, May 21, 2018
  37. 03/28 t: switch $_z40 to $ZERO_OIDbrian m. carlson, May 21, 2018
  38. 04/28 t/test-lib: introduce OID_REGEXbrian m. carlson, May 21, 2018
  39. 05/28 t: switch $_x40 to $OID_REGEXbrian m. carlson, May 21, 2018
  40. 06/28 t0000: annotate with SHA1 prerequisitebrian m. carlson, May 21, 2018
  41. 07/28 t1007: annotate with SHA1 prerequisitebrian m. carlson, May 21, 2018
  42. 08/28 t1512: skip test if not using SHA-1brian m. carlson, May 21, 2018
  43. 09/28 t4044: skip test if not using SHA-1brian m. carlson, May 21, 2018
  44. 10/28 t: skip pack tests if not using SHA-1brian m. carlson, May 21, 2018
  45. 11/28 t2203: abstract away SHA-1-specific constantsbrian m. carlson, May 21, 2018
  46. 13/28 t3702: abstract away SHA-1-specific constantsbrian m. carlson, May 21, 2018
  47. 14/28 t3905: abstract away SHA-1-specific constantsbrian m. carlson, May 21, 2018
  48. 15/28 t4007: abstract away SHA-1-specific constantsbrian m. carlson, May 21, 2018
  49. 17/28 t4014: abstract away SHA-1-specific constantsbrian m. carlson, May 21, 2018
  50. 18/28 t4020: abstract away SHA-1-specific constantsbrian m. carlson, May 21, 2018
  51. 19/28 t4022: abstract away SHA-1-specific constantsbrian m. carlson, May 21, 2018
  52. 20/28 t4029: fix test indentationbrian m. carlson, May 21, 2018
  53. 21/28 t4029: abstract away SHA-1-specific constantsbrian m. carlson, May 21, 2018
  54. 16/28 t4008: abstract away SHA-1-specific constantsbrian m. carlson, May 21, 2018
  55. 23/28 t/lib-diff-alternative: abstract away SHA-1-specific constantsbrian m. carlson, May 21, 2018
  56. 25/28 t4042: abstract away SHA-1-specific constantsbrian m. carlson, May 21, 2018
  57. 24/28 t4205: sort log output in a hash-independent waybrian m. carlson, May 21, 2018
  58. 27/28 t4208: abstract away SHA-1-specific constantsbrian m. carlson, May 21, 2018
  59. 28/28 t5300: abstract away SHA-1-specific constantsbrian m. carlson, May 21, 2018
  60. 26/28 t4045: abstract away SHA-1-specific constantsbrian m. carlson, May 21, 2018
  61. 22/28 t4030: abstract away SHA-1-specific constantsbrian m. carlson, May 21, 2018
  62. 12/28 t3103: abstract away SHA-1-specific constantsbrian m. carlson, May 21, 2018
  63. Ben PeartMay 21, 2018
  64. brian m. carlsonMay 21, 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.