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

[PATCH v4 1/2] t0003: move setup for `--all` into new block

From
Karthik Nayak <karthik.188@gmail.com>
Date
Dec 21, 2022, 13:47 UTC
Message-ID
<622475417916cf48b8fb48e3587f6c87750d43ed.1671630304.git.karthik.188@gmail.com>
In-Reply-To
<cover.1671630304.git.karthik.188@gmail.com>

There is some setup code which is used by multiple tests being setup in `attribute test: --all option`. This means when we run "sh ./t0003-attributes.sh --run=setup,<num>" there is a chance of failing since we missed this setup block.

So to ensure that setups are independent of test logic, move this to a new setup block.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Co-authored-by: toon@iotcl.com
---
 t/t0003-attributes.sh | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh
index f7ee2f2ff0..b3aabb8aa3 100755
--- a/t/t0003-attributes.sh
+++ b/t/t0003-attributes.sh
@@ -203,9 +203,12 @@ test_expect_success 'attribute test: read paths from stdin' '
 	test_cmp expect actual
 '
 
-test_expect_success 'attribute test: --all option' '
+test_expect_success 'setup --all option' '
 	grep -v unspecified <expect-all | sort >specified-all &&
-	sed -e "s/:.*//" <expect-all | uniq >stdin-all &&
+	sed -e "s/:.*//" <expect-all | uniq >stdin-all
+'
+
+test_expect_success 'attribute test: --all option' '
 	git check-attr --stdin --all <stdin-all >tmp &&
 	sort tmp >actual &&
 	test_cmp specified-all actual
-- 
2.39.0
Previous: Karthik NayakNext: Karthik Nayak
Message 2 of 8 in “check-attr: add support to work with revisions”
  1. 0/2 check-attr: add support to work with revisionsKarthik Nayak, Dec 21, 2022
  2. 1/2 t0003: move setup for `--all` into new blockKarthik Nayak, Dec 21, 2022
  3. 2/2 attr: add flag `--revision` to work with revisionsKarthik Nayak, Dec 21, 2022
  4. Phillip WoodDec 21, 2022
  5. Eric SunshineDec 21, 2022
  6. Phillip WoodDec 22, 2022
  7. Karthik NayakDec 23, 2022
  8. Karthik NayakDec 23, 2022

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.