Skip to content

Commit 1562d9a

Browse files
committed
Merge branch 'ps/gitlab-ci-windows-improvements' into ps/ci-rust
* ps/gitlab-ci-windows-improvements: t8020: fix test failure due to indeterministic tag sorting gitlab-ci: upload Meson test logs as JUnit reports gitlab-ci: drop workaround for Python certificate store on Windows gitlab-ci: ignore failures to disable realtime monitoring gitlab-ci: dedup instructions to disable realtime monitoring
2 parents 5f91b2c + 3c4925c commit 1562d9a

File tree

2 files changed

+36
-27
lines changed

2 files changed

+36
-27
lines changed

.gitlab-ci.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ test:linux:
7070
artifacts:
7171
paths:
7272
- t/failed-test-artifacts
73+
reports:
74+
junit: build/meson-logs/testlog.junit.xml
7375
when: on_failure
7476

7577
test:osx:
@@ -110,16 +112,24 @@ test:osx:
110112
artifacts:
111113
paths:
112114
- t/failed-test-artifacts
115+
reports:
116+
junit: build/meson-logs/testlog.junit.xml
113117
when: on_failure
114118

119+
.windows_before_script: &windows_before_script
120+
# Disabling realtime monitoring fails on some of the runners, but it
121+
# significantly speeds up test execution in the case where it works. We thus
122+
# try our luck, but ignore any failures.
123+
- Set-MpPreference -DisableRealtimeMonitoring $true; $true
124+
115125
build:mingw64:
116126
stage: build
117127
tags:
118128
- saas-windows-medium-amd64
119129
variables:
120130
NO_PERL: 1
121131
before_script:
122-
- Set-MpPreference -DisableRealtimeMonitoring $true
132+
- *windows_before_script
123133
- ./ci/install-sdk.ps1 -directory "git-sdk"
124134
script:
125135
- git-sdk/usr/bin/bash.exe -l -c 'ci/make-test-artifacts.sh artifacts'
@@ -136,7 +146,7 @@ test:mingw64:
136146
- job: "build:mingw64"
137147
artifacts: true
138148
before_script:
139-
- Set-MpPreference -DisableRealtimeMonitoring $true
149+
- *windows_before_script
140150
- git-sdk/usr/bin/bash.exe -l -c 'tar xf artifacts/artifacts.tar.gz'
141151
- New-Item -Path .git/info -ItemType Directory
142152
- New-Item .git/info/exclude -ItemType File -Value "/git-sdk"
@@ -150,18 +160,10 @@ test:mingw64:
150160
tags:
151161
- saas-windows-medium-amd64
152162
before_script:
153-
- Set-MpPreference -DisableRealtimeMonitoring $true
154-
- choco install -y git meson ninja openssl
163+
- *windows_before_script
164+
- choco install -y git meson ninja
155165
- Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
156166
- refreshenv
157-
# The certificate store for Python on Windows is broken and fails to fetch
158-
# certificates, see https://bugs.python.org/issue36011. This seems to
159-
# mostly be an issue with how the GitLab image is set up as it is a
160-
# non-issue on GitHub Actions. Work around the issue by importing
161-
# cetrificates manually.
162-
- Invoke-WebRequest https://curl.haxx.se/ca/cacert.pem -OutFile cacert.pem
163-
- openssl pkcs12 -export -nokeys -in cacert.pem -out certs.pfx -passout "pass:"
164-
- Import-PfxCertificate -CertStoreLocation Cert:\LocalMachine\Root -FilePath certs.pfx
165167

166168
build:msvc-meson:
167169
extends: .msvc-meson
@@ -183,6 +185,9 @@ test:msvc-meson:
183185
script:
184186
- meson test -C build --no-rebuild --print-errorlogs --slice $Env:CI_NODE_INDEX/$Env:CI_NODE_TOTAL
185187
parallel: 10
188+
artifacts:
189+
reports:
190+
junit: build/meson-logs/testlog.junit.xml
186191

187192
test:fuzz-smoke-tests:
188193
image: ubuntu:latest

t/t8020-last-modified.sh

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ check_last_modified() {
3333
done &&
3434

3535
cat >expect &&
36-
test_when_finished "rm -f tmp.*" &&
3736
git ${indir:+-C "$indir"} last-modified "$@" >tmp.1 &&
3837
git name-rev --annotate-stdin --name-only --tags \
3938
<tmp.1 >tmp.2 &&
@@ -128,20 +127,25 @@ test_expect_success 'only last-modified files in the current tree' '
128127
EOF
129128
'
130129

131-
test_expect_success 'last-modified with subdir and criss-cross merge' '
132-
git checkout -b branch-k1 1 &&
133-
mkdir -p a k &&
134-
test_commit k1 a/file2 &&
135-
git checkout -b branch-k2 &&
136-
test_commit k2 k/file2 &&
137-
git checkout branch-k1 &&
138-
test_merge km2 branch-k2 &&
139-
test_merge km3 3 &&
140-
check_last_modified <<-\EOF
141-
km3 a
142-
k2 k
143-
1 file
144-
EOF
130+
test_expect_success 'subdirectory modified via merge' '
131+
test_when_finished rm -rf repo &&
132+
git init repo &&
133+
(
134+
cd repo &&
135+
test_commit base &&
136+
git switch --create left &&
137+
mkdir subdir &&
138+
test_commit left subdir/left &&
139+
git switch --create right base &&
140+
mkdir subdir &&
141+
test_commit right subdir/right &&
142+
git switch - &&
143+
test_merge merge right &&
144+
check_last_modified <<-\EOF
145+
merge subdir
146+
base base.t
147+
EOF
148+
)
145149
'
146150

147151
test_expect_success 'cross merge boundaries in blaming' '

0 commit comments

Comments
 (0)