Thread (77 messages) 77 messages, 5 authors, 2021-01-21

Re: [PATCH v2 1/2] t5411: use different out file to prevent overwriting

From: Jiang Xin <hidden>
Date: 2021-01-21 05:46:00

SZEDER Gábor [off-list ref] 于2021年1月20日周三 下午8:49写道:
Would it be possible/desirable to die gracefully when the receiving
end doesn't support push options?
If want to die gracefully, we need to end the pack protocol by sending
a flush packet, close the connection. However, since we can easily fix
this test case, I think changes for git protocol is unnecessary.
quoted
diff --git a/t/t5411/test-0000-standard-git-push.sh b/t/t5411/test-0000-standard-git-push.sh
index 47b058af7e..b074417d4b 100644
--- a/t/t5411/test-0000-standard-git-push.sh
+++ b/t/t5411/test-0000-standard-git-push.sh
@@ -35,11 +35,11 @@ test_expect_success "git-push --atomic ($PROTOCOL)" '
      test_must_fail git -C workbench push --atomic origin \
              main \
              $B:refs/heads/next \
-             >out 2>&1 &&
+             >out-0000-1 2>&1 &&
      filter_out_user_friendly_and_stable_output \
              -e "/^To / { p; }" \
              -e "/^ ! / { p; }" \
-             <out >actual &&
+             <out-0000-1 >actual &&
      cat >expect <<-EOF &&
      To <URL/of/upstream.git>
       ! [rejected] main -> main (non-fast-forward)
@@ -65,8 +65,8 @@ test_expect_success "non-fast-forward git-push ($PROTOCOL)" '
              push origin \
              main \
              $B:refs/heads/next \
-             >out 2>&1 &&
-     make_user_friendly_and_stable_output <out >actual &&
+             >out-0000-2 2>&1 &&
+     make_user_friendly_and_stable_output <out-0000-2 >actual &&
There will be a lot of sequential numbers this way, which might lead
to additional churn in the future, if we ever were to add more tests
somewhere in the middle.  However, our test framework does already
have a counter for test cases, so we could perhaps use that, i.e.
'out-$test_count', to make sure that each test case has its own output
file.
Using $test_count is better, and will do.

Thanks.
--
Jiang Xin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help