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

[PATCH 6/7] t7508/12: set GIT_ADVICE=1 across all tests

From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
Date
Aug 21, 2024, 11:02 UTC
Message-ID
<960d1ec11ece90a29da8a909243aeeca0fdc04fb.1724238153.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1776.git.1724238152.gitgitgadget@gmail.com>
From: Derrick Stolee <derrickstolee@github.com>

The output of 'git status' changes depending on the availability of advice, even though the messages are to stdout. Since this test script is all about testing the output of 'git status' including the existence (or lack of) these messages, set the GIT_ADVICE environment globally across the script.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
---
 t/t7508-status.sh      | 4 ++++
 t/t7512-status-help.sh | 4 ++++
 2 files changed, 8 insertions(+)
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index 773383fefb5..7158ee57f37 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -9,6 +9,10 @@ TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-terminal.sh
 
+# 'git status' output changes depending on the availability of advice,
+# so force its output to enable advice, even though it goes to stdout.
+GIT_ADVICE=1 && export GIT_ADVICE
+
 test_expect_success 'status -h in broken repository' '
 	git config --global advice.statusuoption false &&
 	mkdir broken &&
diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
index de277257d50..1d9676bb3e2 100755
--- a/t/t7512-status-help.sh
+++ b/t/t7512-status-help.sh
@@ -17,6 +17,10 @@ TEST_PASSES_SANITIZE_LEAK=true
 
 set_fake_editor
 
+# 'git status' output changes depending on the availability of advice,
+# so force its output to enable advice, even though it goes to stdout.
+GIT_ADVICE=1 && export GIT_ADVICE
+
 test_expect_success 'prepare for conflicts' '
 	git config --global advice.statusuoption false &&
 	test_commit init main.txt init &&
-- 
gitgitgadget
Previous: Derrick Stolee via GitGitGadgetNext: Derrick Stolee via GitGitGadget
Message 7 of 15 in “[RFC] advice: refuse to output if stderr not TTY”
  1. 0/7 [RFC] advice: refuse to output if stderr not TTYDerrick Stolee via GitGitGadget, Aug 21, 2024
  2. 1/7 t1000-2000: add GIT_ADVICE=1 for advice testsDerrick Stolee via GitGitGadget, Aug 21, 2024
  3. 2/7 t3000-4000: add GIT_ADVICE=1 to advice testsDerrick Stolee via GitGitGadget, Aug 21, 2024
  4. 3/7 t5000: add GIT_ADVICE=1 to advice testsDerrick Stolee via GitGitGadget, Aug 21, 2024
  5. 4/7 t6000: add GIT_ADVICE=1 to advice testsDerrick Stolee via GitGitGadget, Aug 21, 2024
  6. 5/7 t7000: add GIT_ADVICE=1 to advice testsDerrick Stolee via GitGitGadget, Aug 21, 2024
  7. 6/7 t7508/12: set GIT_ADVICE=1 across all testsDerrick Stolee via GitGitGadget, Aug 21, 2024
  8. 7/7 advice: refuse to output if stderr not TTYDerrick Stolee via GitGitGadget, Aug 21, 2024
  9. Jeff KingAug 21, 2024
  10. Junio C HamanoAug 21, 2024
  11. Junio C HamanoAug 21, 2024
  12. Patrick SteinhardtAug 22, 2024
  13. Gabor GombasAug 22, 2024
  14. Derrick StoleeAug 22, 2024
  15. Junio C HamanoAug 22, 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.