Skip to content

Commit 87e1e77

Browse files
authored
Test suite: When skipping tests, skip them ONLY in GitHub Actions CI; do NOT skip them in other CI (such as PkgEval) (#984)
1 parent cdde346 commit 87e1e77

File tree

1 file changed

+32
-14
lines changed

1 file changed

+32
-14
lines changed

test/runtests.jl

+32-14
Original file line numberDiff line numberDiff line change
@@ -13,38 +13,44 @@ mkpath(joinpath(new_depot, "registries"))
1313
ENV["JULIA_DEPOT_PATH"] = new_depot
1414
Base.init_depot_path()
1515

16+
# A generic CI variable, not specific to any single CI provider.
17+
# Lots of different CI providers set the `CI` environment variable,
18+
# such as GitHub Actions, Buildkite, and Travis CI.
19+
# If I recall correctly, Julia's PkgEval.jl also sets it.
1620
const is_ci = tryparse(Bool, get(ENV, "CI", "")) === true
17-
const is_apple_silicon_macos = Sys.ARCH == :aarch64 && Sys.isapple()
21+
22+
# GHA = GitHub Actions
23+
const is_gha_ci = tryparse(Bool, get(ENV, "GITHUB_ACTIONS", "")) === true
1824

1925
# In order to be "slow CI", we must meet all of the following:
2026
# 1. We are running on CI.
2127
# 2. We are running on aarch64 (arm64).
2228
# 3. We are NOT running on Apple Silicon macOS.
2329
# (Because for GitHub Actions, the GitHub-hosted Apple Silicon
2430
# macOS runners seem to be quite fast.)
25-
const is_slow_ci = is_ci && Sys.ARCH == :aarch64 && !is_apple_silicon_macos
31+
const is_slow_ci = is_ci && Sys.ARCH == :aarch64 && !Sys.isapple()
2632

2733
const is_julia_1_6 = VERSION.major == 1 && VERSION.minor == 6
2834
const is_julia_1_9 = VERSION.major == 1 && VERSION.minor == 9
2935
const is_julia_1_11 = VERSION.major == 1 && VERSION.minor == 11
3036
const is_julia_1_12 = VERSION.major == 1 && VERSION.minor == 12
3137

32-
if is_ci
33-
@show Sys.ARCH
38+
if is_ci || is_gha_ci
39+
@info "This is a CI job" Sys.ARCH VERSION is_ci is_gha_ci
3440
end
3541

3642
if is_slow_ci
37-
@warn "This is \"slow CI\" (`is_ci && Sys.ARCH == :aarch64`). Some tests will be skipped or modified." Sys.ARCH
43+
@warn "This is \"slow CI\" (defined as any non-macOS CI running on aarch64). Some tests will be skipped or modified." Sys.ARCH
3844
end
3945

40-
const some_tests_skipped = [
46+
const jlver_some_tests_skipped = [
4147
is_julia_1_6,
4248
is_julia_1_9,
4349
is_julia_1_11,
4450
is_julia_1_12,
4551
]
4652

47-
if any(some_tests_skipped)
53+
if any(jlver_some_tests_skipped)
4854
@warn "This is Julia $(VERSION.major).$(VERSION.minor). Some tests will be skipped or modified." VERSION
4955
end
5056

@@ -101,16 +107,21 @@ end
101107
end
102108
@testset for incremental in incrementals_list
103109
if incremental == false
104-
if is_julia_1_11 || is_julia_1_12
110+
if is_gha_ci && (is_julia_1_11 || is_julia_1_12)
105111
# On Julia 1.11 and 1.12, `incremental=false` is currently broken.
106112
# 1.11: https://github.com/JuliaLang/PackageCompiler.jl/issues/976
107113
# 1.12: No GitHub issue yet.
108114
# So, for now, we skip the `incremental=false` tests on Julia 1.11 and 1.12
109-
@warn "This is Julia $(VERSION.major).$(VERSION.minor); skipping incremental=false test due to known bug: #976 (for 1.11), issue TODO (for 1.12)"
115+
# But ONLY on GHA (GitHub Actions).
116+
# On PkgEval, we do run these tests. This is intentional - we want PkgEval to
117+
# detect regressions, as well as fixes for those regressions.
118+
@warn "[GHA CI] This is Julia $(VERSION.major).$(VERSION.minor); skipping incremental=false test due to known bug: #976 (for 1.11), issue TODO (for 1.12)"
110119
@test_skip false
111120
continue
112121
end
113122
if is_slow_ci
123+
@warn "Skipping the (incremental=false, filter_stdlibs=false) test because this is \"slow CI\""
124+
@test_skip false
114125
filter_stdlibs = (true,)
115126
else
116127
filter_stdlibs = (true, false)
@@ -122,9 +133,10 @@ end
122133
@info "starting: create_app testset" incremental filter
123134
tmp_app_source_dir = joinpath(tmp, "MyApp")
124135
cp(app_source_dir, tmp_app_source_dir)
125-
if is_julia_1_6 || is_julia_1_9
136+
if is_gha_ci && (is_julia_1_6 || is_julia_1_9)
126137
# Julia 1.6: Issue #706 "Cannot locate artifact 'LLVMExtra'" on 1.6 so remove.
127138
# Julia 1.9: There's no GitHub Issue, but it seems we hit a similar problem.
139+
@test_skip false
128140
remove_llvmextras(joinpath(tmp_app_source_dir, "Project.toml"))
129141
end
130142
try
@@ -214,11 +226,14 @@ end
214226
end # testset
215227

216228
if !is_slow_ci
217-
if is_julia_1_12
229+
if is_gha_ci && is_julia_1_12
218230
# On Julia 1.12, `incremental=false` is currently broken when doing `create_library()`.
219231
# 1.12: No GitHub issue yet.
220232
# So, for now, we skip the `incremental=false` tests on Julia 1.12 when doing `create_library()`.
221-
@warn "This is Julia $(VERSION.major).$(VERSION.minor); skipping incremental=false test when doing `create_library()` due to known bug: issue TODO (for 1.12)"
233+
# But ONLY on GHA (GitHub Actions).
234+
# On PkgEval, we do run these tests. This is intentional - we want PkgEval to
235+
# detect regressions, as well as fixes for those regressions.
236+
@warn "[GHA CI] This is Julia $(VERSION.major).$(VERSION.minor); skipping incremental=false test when doing `create_library()` due to known bug: issue TODO (for 1.12)"
222237
@test_skip false
223238
else
224239
# Test library creation
@@ -243,11 +258,14 @@ end
243258

244259
# Test creating an empty sysimage
245260
if !is_slow_ci
246-
if is_julia_1_12
261+
if is_gha_ci && is_julia_1_12
247262
# On Julia 1.12, `incremental=false` is currently broken when doing `create_library()`.
248263
# 1.12: No GitHub issue yet.
249264
# So, for now, we skip the `incremental=false` tests on Julia 1.12 when doing `create_library()`.
250-
@warn "This is Julia $(VERSION.major).$(VERSION.minor); skipping incremental=false test when doing `create_library()` due to known bug: issue TODO (for 1.12)"
265+
# But ONLY on GHA (GitHub Actions).
266+
# On PkgEval, we do run these tests. This is intentional - we want PkgEval to
267+
# detect regressions, as well as fixes for those regressions.
268+
@warn "[GHA CI] This is Julia $(VERSION.major).$(VERSION.minor); skipping incremental=false test when doing `create_library()` due to known bug: issue TODO (for 1.12)"
251269
@test_skip false
252270
else
253271
tmp = mktempdir()

0 commit comments

Comments
 (0)