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

[PATCH v2 0/3] t7004: cleanup and modernize brittle tests

From
Siddharth Shrimali <r.siddharth.shrimali@gmail.com>
Date
Apr 21, 2026, 05:33 UTC
Message-ID
<20260421053334.5414-1-r.siddharth.shrimali@gmail.com>
In-Reply-To
<20260414141828.27576-1-r.siddharth.shrimali@gmail.com>
This patch series addresses brittle testing patterns in t7004-tag.sh. 

In this second version, the first patch has been updated to follow Junio's "belt-and-suspenders" suggestion. Instead of simply removing the tag count check, it now uses 'test_cmp' to verify that the repository state remains unchanged after failed tag creation attempts. This maintains verification while removing the reliance on a hardcoded global tag count.

Subsequent patches continue to modernize the script by removing hardcoded global state and replacing subshell patterns that could otherwise suppress Git exit codes, ensuring that crashes (like segmentation faults) are properly detected.

Thanks to Patrick and Junio for the feedback on v1 regarding state verification.

---
Changes since v1:
- Updated patch 1 to use 'test_cmp' for state verification 
  instead of just dropping the count check.
Siddharth Shrimali (3):
  t7004: drop hardcoded tag count for state verification
  t7004: dynamically grab expected state in tests
  t7004: avoid subshells to capture git exit codes
 t/t7004-tag.sh | 44 +++++++++++++++++++++++---------------------
 1 file changed, 23 insertions(+), 21 deletions(-)
-- 
2.51.2
Previous: Siddharth ShrimaliNext: Siddharth Shrimali
Message 8 of 12 in “t7004: cleanup and modernize brittle tests”
  1. 0/3 t7004: cleanup and modernize brittle testsSiddharth Shrimali, Apr 14, 2026
  2. 1/3 t7004: drop hardcoded tag count in invalid name testSiddharth Shrimali, Apr 14, 2026
  3. Junio C HamanoApr 14, 2026
  4. Patrick SteinhardtApr 20, 2026
  5. 2/3 t7004: dynamically grab expected state in testsSiddharth Shrimali, Apr 14, 2026
  6. Junio C HamanoApr 14, 2026
  7. 3/3 t7004: avoid subshells to capture git exit codesSiddharth Shrimali, Apr 14, 2026
  8. 0/3 t7004: cleanup and modernize brittle testsSiddharth Shrimali, Apr 21, 2026
  9. 1/3 t7004: drop hardcoded tag count for state verificationSiddharth Shrimali, Apr 21, 2026
  10. 2/3 t7004: dynamically grab expected state in testsSiddharth Shrimali, Apr 21, 2026
  11. 3/3 t7004: avoid subshells to capture git exit codesSiddharth Shrimali, Apr 21, 2026
  12. Patrick SteinhardtApr 21, 2026

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.