Skip to content

Commit 69c1d60

Browse files
committed
Merge branch 'ab/misc-hook-submodule-run-command'
Various test updates. * ab/misc-hook-submodule-run-command: run-command tests: test stdout of run_command_parallel() submodule tests: reset "trace.out" between "grep" invocations hook tests: fix redirection logic error in 96e7225
2 parents eea7033 + fe004a4 commit 69c1d60

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

t/t0061-run-command.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ World
130130
EOF
131131

132132
test_expect_success 'run_command runs in parallel with more jobs available than tasks' '
133-
test-tool run-command run-command-parallel 5 sh -c "printf \"%s\n%s\n\" Hello World" 2>actual &&
133+
test-tool run-command run-command-parallel 5 sh -c "printf \"%s\n%s\n\" Hello World" >out 2>actual &&
134+
test_must_be_empty out &&
134135
test_cmp expect actual
135136
'
136137

@@ -141,7 +142,8 @@ test_expect_success 'run_command runs ungrouped in parallel with more jobs avail
141142
'
142143

143144
test_expect_success 'run_command runs in parallel with as many jobs as tasks' '
144-
test-tool run-command run-command-parallel 4 sh -c "printf \"%s\n%s\n\" Hello World" 2>actual &&
145+
test-tool run-command run-command-parallel 4 sh -c "printf \"%s\n%s\n\" Hello World" >out 2>actual &&
146+
test_must_be_empty out &&
145147
test_cmp expect actual
146148
'
147149

@@ -152,7 +154,8 @@ test_expect_success 'run_command runs ungrouped in parallel with as many jobs as
152154
'
153155

154156
test_expect_success 'run_command runs in parallel with more tasks than jobs available' '
155-
test-tool run-command run-command-parallel 3 sh -c "printf \"%s\n%s\n\" Hello World" 2>actual &&
157+
test-tool run-command run-command-parallel 3 sh -c "printf \"%s\n%s\n\" Hello World" >out 2>actual &&
158+
test_must_be_empty out &&
156159
test_cmp expect actual
157160
'
158161

@@ -172,7 +175,8 @@ asking for a quick stop
172175
EOF
173176

174177
test_expect_success 'run_command is asked to abort gracefully' '
175-
test-tool run-command run-command-abort 3 false 2>actual &&
178+
test-tool run-command run-command-abort 3 false >out 2>actual &&
179+
test_must_be_empty out &&
176180
test_cmp expect actual
177181
'
178182

@@ -187,7 +191,8 @@ no further jobs available
187191
EOF
188192

189193
test_expect_success 'run_command outputs ' '
190-
test-tool run-command run-command-no-jobs 3 sh -c "printf \"%s\n%s\n\" Hello World" 2>actual &&
194+
test-tool run-command run-command-no-jobs 3 sh -c "printf \"%s\n%s\n\" Hello World" >out 2>actual &&
195+
test_must_be_empty out &&
191196
test_cmp expect actual
192197
'
193198

t/t1800-hook.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ test_expect_success 'git hook run -- out-of-repo runs excluded' '
9595
test_expect_success 'git -c core.hooksPath=<PATH> hook run' '
9696
mkdir my-hooks &&
9797
write_script my-hooks/test-hook <<-\EOF &&
98-
echo Hook ran $1 >>actual
98+
echo Hook ran $1
9999
EOF
100100
101101
cat >expect <<-\EOF &&

t/t5526-fetch-submodules.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ test_expect_success "submodule.recurse option triggers recursive fetch" '
178178
'
179179

180180
test_expect_success "fetch --recurse-submodules -j2 has the same output behaviour" '
181+
test_when_finished "rm -f trace.out" &&
181182
add_submodule_commits &&
182183
(
183184
cd downstream &&
@@ -705,15 +706,22 @@ test_expect_success "'fetch.recurseSubmodules=on-demand' works also without .git
705706

706707
test_expect_success 'fetching submodules respects parallel settings' '
707708
git config fetch.recurseSubmodules true &&
709+
test_when_finished "rm -f downstream/trace.out" &&
708710
(
709711
cd downstream &&
710712
GIT_TRACE=$(pwd)/trace.out git fetch &&
711713
grep "1 tasks" trace.out &&
714+
>trace.out &&
715+
712716
GIT_TRACE=$(pwd)/trace.out git fetch --jobs 7 &&
713717
grep "7 tasks" trace.out &&
718+
>trace.out &&
719+
714720
git config submodule.fetchJobs 8 &&
715721
GIT_TRACE=$(pwd)/trace.out git fetch &&
716722
grep "8 tasks" trace.out &&
723+
>trace.out &&
724+
717725
GIT_TRACE=$(pwd)/trace.out git fetch --jobs 9 &&
718726
grep "9 tasks" trace.out &&
719727
>trace.out &&

0 commit comments

Comments
 (0)