Skip to content

Commit 601c254

Browse files
Fix coverage job - Part 1 (#471)
1 parent 364d63a commit 601c254

8 files changed

+132
-25
lines changed
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

pipelines/scheduled/coverage/coverage.yml

Lines changed: 123 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
steps:
22
- group: "Coverage"
33
steps:
4-
- label: ":linux: coverage"
5-
key: "coverage"
6-
# Comment out the following `if:` statement for testing.
7-
# Please remember to uncomment it before merging the PR.
8-
if: pipeline.slug == "julia-master-scheduled"
4+
- label: ":linux: coverage (x86_64)"
5+
key: "coverage-linux"
6+
if: (pipeline.slug == "julia-buildkite-scheduled") || (pipeline.slug == "julia-master-scheduled")
97
plugins:
108
- JuliaCI/external-buildkite#v1:
119
version: "./.buildkite-external-version"
@@ -61,3 +59,123 @@ steps:
6159
env:
6260
# Receive cryptic token from parent job
6361
BUILDKITE_PLUGIN_CRYPTIC_BASE64_SIGNED_JOB_ID_SECRET: ${BUILDKITE_PLUGIN_CRYPTIC_BASE64_SIGNED_JOB_ID_SECRET?}
62+
63+
- label: ":macos: coverage (aarch64)"
64+
key: "coverage-macos-aarch64"
65+
if: (pipeline.slug == "julia-buildkite-scheduled") || (pipeline.slug == "julia-master-scheduled")
66+
plugins:
67+
- JuliaCI/external-buildkite#v1:
68+
version: "./.buildkite-external-version"
69+
repo_url: "https://github.com/JuliaCI/julia-buildkite"
70+
- JuliaCI/julia#v1:
71+
# Drop default "registries" directory, so it is not persisted from execution to execution
72+
persist_depot_dirs: packages,artifacts,compiled
73+
version: '1'
74+
- JuliaCI/cryptic#v2:
75+
variables:
76+
- CODECOV_TOKEN="U2FsdGVkX19l0fhdBabbuiEdysyEabkJLRHfxm7CNRkuGbnwPV365sxxC7Czs/CVcws0N1oB4pVwALRRMe36oA=="
77+
- COVERALLS_TOKEN="U2FsdGVkX19zopI0hMNzzi2UUOvNVFD8Y0iisFnO/ryVxU7Tit8ZEaeN+gxodRx4CosUUh192F1+q3dTMWRIvw=="
78+
timeout_in_minutes: 720
79+
commands: |
80+
echo "--- Build Julia from source"
81+
make -j$${JULIA_NUM_THREADS}
82+
83+
echo "--- Print Julia version info"
84+
./julia -e 'using InteractiveUtils; InteractiveUtils.versioninfo()'
85+
./julia -e '@info "" Sys.CPU_THREADS'
86+
# this is necessary to make sure that the LibGit2 tests passes
87+
git config --global init.defaultBranch master
88+
89+
echo "--- Run Julia tests in parallel with code coverage enabled"
90+
export JULIA_NUM_THREADS=1
91+
export JULIA_WORKER_TIMEOUT=1200 # 1200 seconds = 20 minutes
92+
./julia -e 'import Distributed; @info "" Distributed.worker_timeout()'
93+
./julia .buildkite/pipelines/scheduled/coverage/run_tests_parallel.jl
94+
95+
echo "--- Move the lcov files into the `./lcov_files` directory"
96+
ls *.info
97+
mkdir -p lcov_files
98+
mv *.info lcov_files
99+
ls lcov_files
100+
101+
echo "--- Upload lcov files"
102+
tar -zcf lcov_files.tar.gz lcov_files/
103+
buildkite-agent artifact upload lcov_files.tar.gz
104+
105+
echo "--- Process and upload coverage information"
106+
./julia .buildkite/pipelines/scheduled/coverage/upload_coverage.jl
107+
agents:
108+
queue: "julia"
109+
os: "macos"
110+
arch: "aarch64"
111+
env:
112+
JULIA_SHELL: "/bin/bash"
113+
# Receive cryptic token from parent job
114+
BUILDKITE_PLUGIN_CRYPTIC_BASE64_SIGNED_JOB_ID_SECRET: ${BUILDKITE_PLUGIN_CRYPTIC_BASE64_SIGNED_JOB_ID_SECRET?}
115+
116+
- label: ":windows: coverage (x86_64)"
117+
key: "coverage-windows-x86_64"
118+
if: (pipeline.slug == "julia-buildkite-scheduled") || (pipeline.slug == "julia-master-scheduled")
119+
plugins:
120+
- JuliaCI/external-buildkite#v1:
121+
version: "./.buildkite-external-version"
122+
repo_url: "https://github.com/JuliaCI/julia-buildkite"
123+
- JuliaCI/julia#v1:
124+
# Drop default "registries" directory, so it is not persisted from execution to execution
125+
persist_depot_dirs: packages,artifacts,compiled
126+
version: '1'
127+
- JuliaCI/cryptic#v2:
128+
variables:
129+
- CODECOV_TOKEN="U2FsdGVkX19l0fhdBabbuiEdysyEabkJLRHfxm7CNRkuGbnwPV365sxxC7Czs/CVcws0N1oB4pVwALRRMe36oA=="
130+
- COVERALLS_TOKEN="U2FsdGVkX19zopI0hMNzzi2UUOvNVFD8Y0iisFnO/ryVxU7Tit8ZEaeN+gxodRx4CosUUh192F1+q3dTMWRIvw=="
131+
- docker#v3.13.0:
132+
image: "juliapackaging/package-windows-x86_64:v7.10"
133+
always-pull: true
134+
command: ["bash", "-c", "
135+
echo '--- Build Julia from source' &&
136+
make -j$${JULIA_NUM_THREADS} VERBOSE=1 &&
137+
echo '--- Print Julia version info' &&
138+
./usr/bin/julia.exe -e 'using InteractiveUtils; InteractiveUtils.versioninfo()' &&
139+
./usr/bin/julia.exe -e '@info \"\" Sys.CPU_THREADS' &&
140+
git config --global init.defaultBranch master &&
141+
echo '--- Run Julia tests in parallel with code coverage enabled' &&
142+
export JULIA_NUM_THREADS=1 &&
143+
export JULIA_WORKER_TIMEOUT=1200 &&
144+
./usr/bin/julia.exe -e 'import Distributed; @info \"\" Distributed.worker_timeout()' &&
145+
./usr/bin/julia.exe .buildkite/pipelines/scheduled/coverage/run_tests_parallel.jl &&
146+
echo '--- Move the lcov files into the ./lcov_files directory' &&
147+
ls *.info &&
148+
mkdir -p lcov_files &&
149+
mv *.info lcov_files &&
150+
ls lcov_files &&
151+
echo '--- Upload lcov files' &&
152+
tar -zcf lcov_files.tar.gz lcov_files/ &&
153+
buildkite-agent artifact upload lcov_files.tar.gz &&
154+
echo '--- Process and upload coverage information' &&
155+
./usr/bin/julia.exe .buildkite/pipelines/scheduled/coverage/upload_coverage.jl
156+
"]
157+
propagate-environment: true
158+
volumes:
159+
# Mount buildkite-agent as well
160+
- "C:\\buildkite-agent\\bin:C:\\buildkite-agent\\bin"
161+
environment:
162+
- "JULIA_CPU_THREADS"
163+
- "BUILDKITE_AGENT_ACCESS_TOKEN"
164+
- "BUILDKITE_BRANCH"
165+
- "BUILDKITE_REPO"
166+
- "BUILDKITE_MESSAGE"
167+
- "BUILDKITE_BUILD_AUTHOR"
168+
- "BUILDKITE_BUILD_CREATOR"
169+
- "BUILDKITE_BUILD_AUTHOR_EMAIL"
170+
- "BUILDKITE_BUILD_CREATOR_EMAIL"
171+
- "CODECOV_TOKEN"
172+
- "COVERALLS_TOKEN"
173+
timeout_in_minutes: 720
174+
agents:
175+
queue: "julia"
176+
os: "windows"
177+
arch: "x86_64"
178+
env:
179+
JULIA_SHELL: "/bin/bash"
180+
# Receive cryptic token from parent job
181+
BUILDKITE_PLUGIN_CRYPTIC_BASE64_SIGNED_JOB_ID_SECRET: ${BUILDKITE_PLUGIN_CRYPTIC_BASE64_SIGNED_JOB_ID_SECRET?}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Salted__*ߞ�Ѿw 8�:x2���yF\�_q�=��yX���a��GI@��.�N����E�����$6�GI�i��g���qMu���q�P�
1+
Salted__��|5y�5�O|��-�mO�o�E��m�S ������y�8�[��x�`�8�^G���77q,j�q��m�N�`?��Hh��Ć

pipelines/scheduled/coverage/run_tests_parallel.jl

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,12 @@ const ncores = Sys.CPU_THREADS
99
@info "" Sys.CPU_THREADS
1010
@info "" ncores
1111

12-
script_native_yes = """
13-
Base.runtests(["cmdlineargs"]; ncores = $(ncores))
12+
script = """
13+
Base.runtests(["all", "--skip", "Pkg"]; ncores = $(ncores))
1414
"""
15-
script_native_no = """
16-
Base.runtests(["all", "--skip", "cmdlineargs", "Pkg"]; ncores = $(ncores))
17-
"""
18-
19-
base_cmd = `$(Base.julia_cmd()) --code-coverage=lcov-%p.info`
20-
cmd_native_yes = `$(base_cmd) --sysimage-native-code=yes -e $(script_native_yes)`
21-
cmd_native_no = `$(base_cmd) --sysimage-native-code=no -e $(script_native_no)`
2215

23-
@info "Running command" cmd_native_yes
24-
p1 = run(pipeline(cmd_native_yes; stdin, stdout, stderr); wait = false)
25-
wait(p1)
16+
cmd = `$(Base.julia_cmd()) --code-coverage=lcov-%p.info -e $(script)`
2617

27-
@info "Running command" cmd_native_no
28-
p2 = run(pipeline(cmd_native_no; stdin, stdout, stderr); wait = false)
29-
wait(p2)
18+
@info "Running command" cmd
19+
p = run(pipeline(cmd; stdin, stdout, stderr); wait = false)
20+
wait(p)

pipelines/scheduled/coverage/upload_coverage.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
empty!(Base.DEPOT_PATH)
2-
push!(Base.DEPOT_PATH, mktempdir(; cleanup = true))
1+
Base.DEPOT_PATH[1] = mktempdir(; cleanup = true)
32

43
import Pkg
54
import Logging
65
import TOML
76

87
Pkg.add(; name = "Coverage", uuid = "a2441757-f6aa-5fb2-8edb-039e3f45d037", version = "1")
9-
Pkg.precompile()
108

119
import Coverage
1210

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Salted__��A֚N:�oD��NI6��s錼�'�cWG-���J��yJ��&�{bo���R^�)�}חԘ�Gx������ ,%����;
1+
Salted__|�|����%�* �Ī� JV��e��.�� -K��ɇ�FYm���ס�*Z�&#g ws�T8�*�ϋ�)� ��7�����*�;
Binary file not shown.

0 commit comments

Comments
 (0)