Skip to content

Commit 0668893

Browse files
committed
Merge branch 'azure-pipelines-fixups'
Technically, this topic branch would need a little bit more polishing. However, it consists largely of fixup! commits which will be squashed into the original `azure-pipelines` branch, anyway. And v2.20.1 is out already, so the rebase is imminent. So... There are two things to do, still, before submitting a new iteration of that patch series: - We need a better way to encode the text we paste into the XML. Probably we should extend the test-tool. - We will also want to replace the perl invocation to retrieve the file size by a test-tool command. Signed-off-by: Johannes Schindelin <[email protected]>
2 parents 33e4ee3 + a1e5cf7 commit 0668893

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+221
-107
lines changed

azure-pipelines.yml

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -162,19 +162,21 @@ phases:
162162

163163
- phase: windows
164164
displayName: Windows
165-
condition: succeeded()
166165
queue:
167166
name: Hosted
168167
timeoutInMinutes: 240
169168
steps:
170169
- powershell: |
171-
# Helper to check the error level of the latest command (exit with error when appropriate)
172-
function c() { if (!$?) { exit(1) } }
173-
174170
if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
175-
net use s: \\gitfileshare.file.core.windows.net\test-cache "$GITFILESHAREPWD" /user:AZURE\gitfileshare /persistent:no; c
176-
cmd /c mklink /d "$(Build.SourcesDirectory)\test-cache" S:\; c
171+
net use s: \\gitfileshare.file.core.windows.net\test-cache "$GITFILESHAREPWD" /user:AZURE\gitfileshare /persistent:no
172+
cmd /c mklink /d "$(Build.SourcesDirectory)\test-cache" S:\
177173
}
174+
displayName: 'Mount test-cache'
175+
env:
176+
GITFILESHAREPWD: $(gitfileshare.pwd)
177+
- powershell: |
178+
# Helper to check the error level of the latest command (exit with error when appropriate)
179+
function c() { if (!$?) { exit(1) } }
178180
179181
# Add build agent's MinGit to PATH
180182
$env:PATH = $env:AGENT_HOMEDIRECTORY +"\externals\\git\cmd;" +$env:PATH
@@ -207,26 +209,41 @@ phases:
207209
init "$sdk_path" "https://dev.azure.com/git-for-windows/git-sdk-64/_git/git-sdk-64" 0
208210
init usr\src\build-extra https://github.com/git-for-windows/build-extra 1
209211
212+
# Let Git ignore the SDK and the test-cache
213+
"/git-sdk-64/`n/test-cache/`n" | Out-File -NoNewLine -Encoding ascii -Append "$(Build.SourcesDirectory)\.git\info\exclude"
214+
215+
# Help MSYS2 runtime startup by initializing /etc/passwd
216+
& "$sdk_path\git-cmd" --command=usr\\bin\\bash.exe -lc "mkpasswd -c >>/etc/passwd"; c
217+
displayName: 'Initialize the Git for Windows SDK'
218+
- powershell: |
219+
# Helper to check the error level of the latest command (exit with error when appropriate)
220+
function c() { if (!$?) { exit(1) } }
221+
210222
cd "$(Build.SourcesDirectory)"; c
211223
212-
$env:HOME = "$(Build.SourcesDirectory)"
213-
$env:MSYSTEM = "MINGW64"
214224
git-sdk-64\git-cmd --command=usr\\bin\\bash.exe -lc @"
215-
. ci/lib.sh
225+
export MAKEFLAGS=-j10
226+
export DEVELOPER=1
227+
export NO_PERL=1
228+
export NO_SVN_TESTS=1
229+
export GIT_TEST_SKIP_REBASE_P=1
216230
217-
make -j10 DEVELOPER=1 NO_PERL=1 || exit 1
218-
NO_PERL=1 NO_SVN_TESTS=1 GIT_TEST_SKIP_REBASE_P=1 GIT_TEST_OPTS=\"--no-chain-lint --no-bin-wrappers --quiet --write-junit-xml\" time make -j15 -k DEVELOPER=1 test || {
219-
NO_PERL=1 NO_SVN_TESTS=1 GIT_TEST_SKIP_REBASE_P=1 GIT_TEST_OPTS=\"-i -v -x\" make -k -C t failed; exit 1
231+
ci/run-build-and-tests.sh || {
232+
ci/print-test-failures.sh
233+
exit 1
220234
}
221-
222-
save_good_tree
223235
"@
224236
c
225-
237+
displayName: 'Build & Test'
238+
env:
239+
HOME: $(Build.SourcesDirectory)
240+
MSYSTEM: MINGW64
241+
- powershell: |
226242
if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
227243
cmd /c rmdir "$(Build.SourcesDirectory)\test-cache"
228244
}
229-
displayName: 'build & test'
245+
displayName: 'Unmount test-cache'
246+
condition: true
230247
env:
231248
GITFILESHAREPWD: $(gitfileshare.pwd)
232249
- task: PublishTestResults@2

ci/lib.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ then
4141

4242
BREW_INSTALL_PACKAGES=
4343
export GIT_PROVE_OPTS="--timer --jobs 10 --state=failed,slow,save"
44-
export GIT_TEST_OPTS="--quiet --write-junit-xml"
44+
export GIT_TEST_OPTS="--verbose-log -x --write-junit-xml"
45+
test windows_nt != "$CI_OS_NAME" ||
46+
GIT_TEST_OPTS="--no-chain-lint --no-bin-wrappers $GIT_TEST_OPTS"
4547
fi
4648

4749
skip_branch_tip_with_tag () {

ci/run-build-and-tests.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55

66
. ${0%/*}/lib.sh
77

8-
ln -s "$cache_dir/.prove" t/.prove
8+
case "$CI_OS_NAME" in
9+
windows*) cmd //c mklink //j t\\.prove "$(cygpath -aw "$cache_dir/.prove")";;
10+
*) ln -s "$cache_dir/.prove" t/.prove;;
11+
esac
912

10-
make --jobs=2
13+
make
1114
make --quiet test
1215
if test "$jobname" = "linux-gcc"
1316
then

t/interop/i5500-git-daemon.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,5 @@ test_expect_success "fetch with $VERSION_B" '
3737
test_cmp expect actual
3838
'
3939

40+
stop_git_daemon
4041
test_done

t/lib-git-daemon.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#
1414
# test_expect_success ...
1515
#
16+
# stop_git_daemon
1617
# test_done
1718

1819
test_tristate GIT_TEST_GIT_DAEMON
@@ -42,7 +43,7 @@ start_git_daemon() {
4243

4344
mkdir -p "$GIT_DAEMON_DOCUMENT_ROOT_PATH"
4445

45-
test_atexit 'stop_git_daemon'
46+
trap 'code=$?; stop_git_daemon; (exit $code); die' EXIT
4647

4748
say >&3 "Starting git daemon ..."
4849
mkfifo git_daemon_output

t/lib-git-p4.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ cli="$TRASH_DIRECTORY/cli"
7474
git="$TRASH_DIRECTORY/git"
7575
pidfile="$TRASH_DIRECTORY/p4d.pid"
7676

77+
# Sometimes "prove" seems to hang on exit because p4d is still running
78+
cleanup () {
79+
if test -f "$pidfile"
80+
then
81+
kill -9 $(cat "$pidfile") 2>/dev/null && exit 255
82+
fi
83+
}
84+
trap cleanup EXIT
85+
7786
# git p4 submit generates a temp file, which will
7887
# not get cleaned up if the submission fails. Don't
7988
# clutter up /tmp on the test machine.
@@ -132,7 +141,6 @@ start_p4d () {
132141
# p4d failed to start
133142
return 1
134143
fi
135-
test_atexit kill_p4d
136144

137145
# build a p4 user so [email protected] has an entry
138146
p4_add_user author

t/t0000-basic.sh

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ check_sub_test_lib_test_err () {
138138
)
139139
}
140140

141-
cat >/dev/null <<\DDD
142141
test_expect_success 'pretend we have a fully passing test suite' "
143142
run_sub_test_lib_test full-pass '3 passing tests' <<-\\EOF &&
144143
for i in 1 2 3
@@ -825,25 +824,6 @@ test_expect_success 'tests clean up even on failures' "
825824
> 1..2
826825
EOF
827826
"
828-
DDD
829-
830-
test_expect_success 'test_atexit is run' "
831-
test_must_fail run_sub_test_lib_test \
832-
atexit-cleanup 'Run atexit commands' -i <<-\\EOF &&
833-
test_expect_success 'tests clean up even after a failure' '
834-
> ../../clean-atexit &&
835-
test_atexit rm ../../clean-atexit &&
836-
> ../../also-clean-atexit &&
837-
test_atexit rm ../../also-clean-atexit &&
838-
> ../../dont-clean-atexit &&
839-
(exit 1)
840-
'
841-
test_done
842-
EOF
843-
test_path_exists dont-clean-atexit &&
844-
test_path_is_missing clean-atexit &&
845-
test_path_is_missing also-clean-atexit
846-
"
847827

848828
test_expect_success 'test_oid setup' '
849829
test_oid_init

t/t5570-git-daemon.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,4 +211,5 @@ test_expect_success FAKENC 'hostname interpolation works after LF-stripping' '
211211
test_cmp expect actual
212212
'
213213

214+
stop_git_daemon
214215
test_done

t/t9800-git-p4-basic.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,4 +326,8 @@ test_expect_success 'submit from worktree' '
326326
)
327327
'
328328

329+
test_expect_success 'kill p4d' '
330+
kill_p4d
331+
'
332+
329333
test_done

t/t9801-git-p4-branch.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,4 +610,8 @@ test_expect_success 'Update a file in git side and submit to P4 using client vie
610610
)
611611
'
612612

613+
test_expect_success 'kill p4d' '
614+
kill_p4d
615+
'
616+
613617
test_done

t/t9802-git-p4-filetype.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,4 +333,8 @@ test_expect_success SYMLINKS 'empty symlink target' '
333333
)
334334
'
335335

336+
test_expect_success 'kill p4d' '
337+
kill_p4d
338+
'
339+
336340
test_done

t/t9803-git-p4-shell-metachars.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,8 @@ test_expect_success 'branch with shell char' '
105105
)
106106
'
107107

108+
test_expect_success 'kill p4d' '
109+
kill_p4d
110+
'
111+
108112
test_done

t/t9804-git-p4-label.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,8 @@ test_expect_failure 'two labels on the same changelist' '
108108
)
109109
'
110110

111+
test_expect_success 'kill p4d' '
112+
kill_p4d
113+
'
114+
111115
test_done

t/t9805-git-p4-skip-submit-edit.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,8 @@ test_expect_success 'no config, edited' '
9898
)
9999
'
100100

101+
test_expect_success 'kill p4d' '
102+
kill_p4d
103+
'
104+
101105
test_done

t/t9806-git-p4-options.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,4 +300,9 @@ test_expect_success 'use --git-dir option and GIT_DIR' '
300300
test_path_is_file "$git"/cli_file2.t
301301
'
302302

303+
304+
test_expect_success 'kill p4d' '
305+
kill_p4d
306+
'
307+
303308
test_done

t/t9807-git-p4-submit.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,4 +542,8 @@ test_expect_success 'submit --update-shelve' '
542542
)
543543
'
544544

545+
test_expect_success 'kill p4d' '
546+
kill_p4d
547+
'
548+
545549
test_done

t/t9808-git-p4-chdir.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,8 @@ test_expect_success SYMLINKS 'p4 client root symlink should stay symbolic' '
8383
)
8484
'
8585

86+
test_expect_success 'kill p4d' '
87+
kill_p4d
88+
'
89+
8690
test_done

t/t9809-git-p4-client-view.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,4 +836,8 @@ test_expect_success 'quotes on both sides' '
836836
git_verify "cdir 1/file11" "cdir 1/file12"
837837
'
838838

839+
test_expect_success 'kill p4d' '
840+
kill_p4d
841+
'
842+
839843
test_done

t/t9810-git-p4-rcs.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,4 +360,8 @@ test_expect_failure 'Add keywords in git which do not match the default p4 value
360360
)
361361
'
362362

363+
test_expect_success 'kill p4d' '
364+
kill_p4d
365+
'
366+
363367
test_done

t/t9811-git-p4-label-import.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,4 +259,9 @@ test_expect_success 'importing labels with missing revisions' '
259259
)
260260
'
261261

262+
263+
test_expect_success 'kill p4d' '
264+
kill_p4d
265+
'
266+
262267
test_done

t/t9812-git-p4-wildcards.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,4 +211,8 @@ test_expect_success 'wildcard files requiring keyword scrub' '
211211
)
212212
'
213213

214+
test_expect_success 'kill p4d' '
215+
kill_p4d
216+
'
217+
214218
test_done

t/t9813-git-p4-preserve-users.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,8 @@ test_expect_success 'not preserving user with mixed authorship' '
138138
)
139139
'
140140

141+
test_expect_success 'kill p4d' '
142+
kill_p4d
143+
'
144+
141145
test_done

t/t9814-git-p4-rename.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,4 +242,8 @@ test_expect_success P4D_HAVE_CONFIGURABLE_RUN_MOVE_ALLOW \
242242
)
243243
'
244244

245+
test_expect_success 'kill p4d' '
246+
kill_p4d
247+
'
248+
245249
test_done

t/t9815-git-p4-submit-fail.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,4 +422,8 @@ test_expect_success 'cleanup chmod after submit cancel' '
422422
)
423423
'
424424

425+
test_expect_success 'kill p4d' '
426+
kill_p4d
427+
'
428+
425429
test_done

t/t9816-git-p4-locked.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,8 @@ test_expect_failure 'move with lock taken' '
138138
)
139139
'
140140

141+
test_expect_success 'kill p4d' '
142+
kill_p4d
143+
'
144+
141145
test_done

t/t9817-git-p4-exclude.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,8 @@ test_expect_success 'clone, then sync with exclude' '
6464
)
6565
'
6666

67+
test_expect_success 'kill p4d' '
68+
kill_p4d
69+
'
70+
6771
test_done

t/t9818-git-p4-block.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,8 @@ test_expect_success 'Clone repo with self-sizing block size' '
146146
test_line_count \> 10 log
147147
'
148148

149+
test_expect_success 'kill p4d' '
150+
kill_p4d
151+
'
152+
149153
test_done

t/t9819-git-p4-case-folding.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,8 @@ test_expect_failure 'Clone UC repo with lc name' '
5353
test_must_fail git p4 clone //depot/uc/...
5454
'
5555

56+
test_expect_success 'kill p4d' '
57+
kill_p4d
58+
'
59+
5660
test_done

t/t9820-git-p4-editor-handling.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,8 @@ test_expect_success 'EDITOR with options' '
3131
)
3232
'
3333

34+
test_expect_success 'kill p4d' '
35+
kill_p4d
36+
'
37+
3438
test_done

t/t9821-git-p4-path-variations.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,4 +193,8 @@ test_expect_success 'Add a new file and clone path with new file (ignorecase)' '
193193
)
194194
'
195195

196+
test_expect_success 'kill p4d' '
197+
kill_p4d
198+
'
199+
196200
test_done

0 commit comments

Comments
 (0)