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

0 commit comments

Comments
 (0)