Skip to content

Commit 90e4e7c

Browse files
vchuravygithub-actions[bot]JoshuaLampertranocha
authored
Remove coverage_override and use primary test run for code coverage (#2254)
* Remove coverage_override and use primary test run for code coverage * fixup! Remove coverage_override and use primary test run for code coverage * remove other mentions of coverage * Update test/test_trixi.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix rebase * ensure RealT=Float32 for elixir_mhd_ec_float32 * adjust tolerances test_unstructured_2d * two more small fixes * Update test/test_tree_2d_euler.jl Co-authored-by: Joshua Lampert <[email protected]> * update tolerances in parabolic * update * Apply suggestions from code review Co-authored-by: Hendrik Ranocha <[email protected]> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Joshua Lampert <[email protected]> Co-authored-by: Hendrik Ranocha <[email protected]>
1 parent 81d8e47 commit 90e4e7c

32 files changed

+227
-514
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,7 @@ jobs:
112112
- uses: julia-actions/julia-buildpkg@v1
113113
env:
114114
PYTHON: ''
115-
- name: Run tests without coverage
116-
uses: julia-actions/julia-runtest@v1
117-
with:
118-
coverage: false
119-
env:
120-
PYTHON: ''
121-
TRIXI_TEST: ${{ matrix.trixi_test }}
122-
- name: Run tests with coverage
115+
- name: Run tests
123116
uses: julia-actions/julia-runtest@v1
124117
with:
125118
coverage: true

test/runtests.jl

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,9 @@ const TRIXI_NTHREADS = clamp(Sys.CPU_THREADS, 2, 3)
1818
# cf. https://github.com/JuliaParallel/MPI.jl/pull/391
1919
@test true
2020

21-
# There are spurious test failures of Trixi.jl with MPI on Windows, see
22-
# https://github.com/trixi-framework/Trixi.jl/issues/901
23-
# To reduce their impact, we do not test MPI with coverage on Windows.
24-
# This reduces the chance to hit a spurious test failure by one half.
25-
# In addition, it looks like the Linux GitHub runners run out of memory during the 3D tests
26-
# with coverage, so we currently do not test MPI with coverage on Linux. For more details,
27-
# see the discussion at https://github.com/trixi-framework/Trixi.jl/pull/1062#issuecomment-1035901020
28-
cmd = string(Base.julia_cmd())
29-
coverage = occursin("--code-coverage", cmd) &&
30-
!occursin("--code-coverage=none", cmd)
31-
if !(coverage && Sys.iswindows()) && !(coverage && Sys.isapple())
32-
# We provide a `--heap-size-hint` to avoid/reduce out-of-memory errors during CI testing
33-
mpiexec() do cmd
34-
run(`$cmd -n $TRIXI_MPI_NPROCS $(Base.julia_cmd()) --threads=1 --check-bounds=yes --heap-size-hint=0.5G $(abspath("test_mpi.jl"))`)
35-
end
21+
# We provide a `--heap-size-hint` to avoid/reduce out-of-memory errors during CI testing
22+
mpiexec() do cmd
23+
run(`$cmd -n $TRIXI_MPI_NPROCS $(Base.julia_cmd()) --threads=1 --check-bounds=yes --heap-size-hint=0.5G $(abspath("test_mpi.jl"))`)
3624
end
3725
end
3826

test/test_mpi_p4est_2d.jl

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ const EXAMPLES_DIR = pkgdir(Trixi, "examples", "p4est_2d_dgsem")
8181
"elixir_advection_amr_solution_independent.jl"),
8282
# Expected errors are exactly the same as with TreeMesh!
8383
l2=[4.949660644033807e-5],
84-
linf=[0.0004867846262313763],
85-
coverage_override=(maxiters = 6,))
84+
linf=[0.0004867846262313763],)
8685

8786
# Ensure that we do not have excessive memory allocations
8887
# (e.g., from type instabilities)
@@ -98,8 +97,7 @@ const EXAMPLES_DIR = pkgdir(Trixi, "examples", "p4est_2d_dgsem")
9897
@test_trixi_include(joinpath(EXAMPLES_DIR,
9998
"elixir_advection_amr_unstructured_flag.jl"),
10099
l2=[0.0012808538770535593],
101-
linf=[0.01752690016659812],
102-
coverage_override=(maxiters = 6,))
100+
linf=[0.01752690016659812],)
103101

104102
# Ensure that we do not have excessive memory allocations
105103
# (e.g., from type instabilities)
@@ -114,10 +112,7 @@ const EXAMPLES_DIR = pkgdir(Trixi, "examples", "p4est_2d_dgsem")
114112
@trixi_testset "elixir_advection_restart.jl" begin
115113
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_restart.jl"),
116114
l2=[4.507575525876275e-6],
117-
linf=[6.21489667023134e-5],
118-
# With the default `maxiters = 1` in coverage tests,
119-
# there would be no time steps after the restart.
120-
coverage_override=(maxiters = 100_000,))
115+
linf=[6.21489667023134e-5],)
121116

122117
# Ensure that we do not have excessive memory allocations
123118
# (e.g., from type instabilities)

test/test_mpi_p4est_3d.jl

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,7 @@ const EXAMPLES_DIR = pkgdir(Trixi, "examples", "p4est_3d_dgsem")
4848
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_amr.jl"),
4949
# Expected errors are exactly the same as with TreeMesh!
5050
l2=[9.773852895157622e-6],
51-
linf=[0.0005853874124926162],
52-
# override values are different from the serial tests to ensure each process holds at least
53-
# one element, otherwise OrdinaryDiffEq fails during initialization
54-
coverage_override=(maxiters = 6,
55-
initial_refinement_level = 2,
56-
base_level = 2, med_level = 3,
57-
max_level = 4))
51+
linf=[0.0005853874124926162],)
5852

5953
# Ensure that we do not have excessive memory allocations
6054
# (e.g., from type instabilities)
@@ -71,11 +65,7 @@ const EXAMPLES_DIR = pkgdir(Trixi, "examples", "p4est_3d_dgsem")
7165
"elixir_advection_amr_unstructured_curved.jl"),
7266
l2=[1.6163120948209677e-5],
7367
linf=[0.0010572201890564834],
74-
tspan=(0.0, 1.0),
75-
coverage_override=(maxiters = 6,
76-
initial_refinement_level = 0,
77-
base_level = 0, med_level = 1,
78-
max_level = 2))
68+
tspan=(0.0, 1.0),)
7969

8070
# Ensure that we do not have excessive memory allocations
8171
# (e.g., from type instabilities)
@@ -90,10 +80,7 @@ const EXAMPLES_DIR = pkgdir(Trixi, "examples", "p4est_3d_dgsem")
9080
@trixi_testset "elixir_advection_restart.jl" begin
9181
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_restart.jl"),
9282
l2=[0.002590388934758452],
93-
linf=[0.01840757696885409],
94-
# With the default `maxiters = 1` in coverage tests,
95-
# there would be no time steps after the restart.
96-
coverage_override=(maxiters = 100_000,))
83+
linf=[0.01840757696885409],)
9784

9885
# Ensure that we do not have excessive memory allocations
9986
# (e.g., from type instabilities)
@@ -195,8 +182,7 @@ const EXAMPLES_DIR = pkgdir(Trixi, "examples", "p4est_3d_dgsem")
195182
0.45574161423218573,
196183
0.8099577682187109
197184
],
198-
tspan=(0.0, 0.2),
199-
coverage_override=(polydeg = 3,)) # Prevent long compile time in CI
185+
tspan=(0.0, 0.2),)
200186

201187
# Ensure that we do not have excessive memory allocations
202188
# (e.g., from type instabilities)
@@ -261,8 +247,7 @@ const EXAMPLES_DIR = pkgdir(Trixi, "examples", "p4est_3d_dgsem")
261247
0.005104176909383168,
262248
9.738081186490818e-6
263249
],
264-
tspan=(0.0, 0.25),
265-
coverage_override=(trees_per_dimension = (1, 1, 1),))
250+
tspan=(0.0, 0.25),)
266251
# Ensure that we do not have excessive memory allocations
267252
# (e.g., from type instabilities)
268253
let
@@ -299,8 +284,7 @@ const EXAMPLES_DIR = pkgdir(Trixi, "examples", "p4est_3d_dgsem")
299284
0.05701669133068068,
300285
0.00024182906501186622
301286
],
302-
tspan=(0.0, 0.25), trees_per_dimension=(1, 1, 1),
303-
coverage_override=(trees_per_dimension = (1, 1, 1),))
287+
tspan=(0.0, 0.25), trees_per_dimension=(1, 1, 1),)
304288
# Ensure that we do not have excessive memory allocations
305289
# (e.g., from type instabilities)
306290
let

test/test_mpi_t8code_2d.jl

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ const EXAMPLES_DIR = pkgdir(Trixi, "examples", "t8code_2d_dgsem")
8181
"elixir_advection_amr_solution_independent.jl"),
8282
# Expected errors are exactly the same as with TreeMesh!
8383
l2=[4.949660644033807e-5],
84-
linf=[0.0004867846262313763],
85-
coverage_override=(maxiters = 6,), atol=1e-9)
84+
linf=[0.0004867846262313763],)
8685

8786
# Ensure that we do not have excessive memory allocations
8887
# (e.g., from type instabilities)
@@ -99,8 +98,7 @@ const EXAMPLES_DIR = pkgdir(Trixi, "examples", "t8code_2d_dgsem")
9998
"elixir_advection_amr_unstructured_flag.jl"),
10099
l2=[0.002019623611753929],
101100
linf=[0.03542375961299987],
102-
dynamic_load_balancing=false,
103-
coverage_override=(maxiters = 6,))
101+
dynamic_load_balancing=false,)
104102

105103
# Ensure that we do not have excessive memory allocations
106104
# (e.g., from type instabilities)
@@ -115,10 +113,7 @@ const EXAMPLES_DIR = pkgdir(Trixi, "examples", "t8code_2d_dgsem")
115113
@trixi_testset "elixir_advection_restart.jl" begin
116114
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_restart.jl"),
117115
l2=[4.507575525876275e-6],
118-
linf=[6.21489667023134e-5],
119-
# With the default `maxiters = 1` in coverage tests,
120-
# there would be no time steps after the restart.
121-
coverage_override=(maxiters = 100_000,))
116+
linf=[6.21489667023134e-5],)
122117

123118
# Ensure that we do not have excessive memory allocations
124119
# (e.g., from type instabilities)

test/test_mpi_t8code_3d.jl

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,7 @@ const EXAMPLES_DIR = pkgdir(Trixi, "examples", "t8code_3d_dgsem")
4848
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_amr.jl"),
4949
# Expected errors are exactly the same as with TreeMesh!
5050
l2=[1.1302812803902801e-5],
51-
linf=[0.0007889950196294793],
52-
# override values are different from the serial tests to ensure each process holds at least
53-
# one element, otherwise OrdinaryDiffEq fails during initialization
54-
coverage_override=(maxiters = 6,
55-
initial_refinement_level = 2,
56-
base_level = 2, med_level = 3,
57-
max_level = 4))
51+
linf=[0.0007889950196294793],)
5852

5953
# Ensure that we do not have excessive memory allocations
6054
# (e.g., from type instabilities)
@@ -71,11 +65,7 @@ const EXAMPLES_DIR = pkgdir(Trixi, "examples", "t8code_3d_dgsem")
7165
"elixir_advection_amr_unstructured_curved.jl"),
7266
l2=[2.0535121347526814e-5],
7367
linf=[0.0010586603797777504],
74-
tspan=(0.0, 1.0),
75-
coverage_override=(maxiters = 6,
76-
initial_refinement_level = 0,
77-
base_level = 0, med_level = 1,
78-
max_level = 2))
68+
tspan=(0.0, 1.0),)
7969

8070
# Ensure that we do not have excessive memory allocations
8171
# (e.g., from type instabilities)
@@ -90,10 +80,7 @@ const EXAMPLES_DIR = pkgdir(Trixi, "examples", "t8code_3d_dgsem")
9080
@trixi_testset "elixir_advection_restart.jl" begin
9181
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_restart.jl"),
9282
l2=[0.002590388934758452],
93-
linf=[0.01840757696885409],
94-
# With the default `maxiters = 1` in coverage tests,
95-
# there would be no time steps after the restart.
96-
coverage_override=(maxiters = 100_000,))
83+
linf=[0.01840757696885409],)
9784

9885
# Ensure that we do not have excessive memory allocations
9986
# (e.g., from type instabilities)
@@ -180,8 +167,7 @@ const EXAMPLES_DIR = pkgdir(Trixi, "examples", "t8code_3d_dgsem")
180167
0.45574161423218573,
181168
0.8099577682187109
182169
],
183-
tspan=(0.0, 0.2),
184-
coverage_override=(polydeg = 3,)) # Prevent long compile time in CI
170+
tspan=(0.0, 0.2),)
185171

186172
# Ensure that we do not have excessive memory allocations
187173
# (e.g., from type instabilities)

test/test_mpi_tree.jl

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,15 @@ CI_ON_WINDOWS = (get(ENV, "GITHUB_ACTIONS", false) == "true") && Sys.iswindows()
5757
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_amr.jl"),
5858
# Expected errors are exactly the same as in the serial test!
5959
l2=[4.913300828257469e-5],
60-
linf=[0.00045263895394385967],
61-
coverage_override=(maxiters = 6,))
60+
linf=[0.00045263895394385967],)
6261
end
6362

6463
@trixi_testset "elixir_advection_amr_nonperiodic.jl" begin
6564
@test_trixi_include(joinpath(EXAMPLES_DIR,
6665
"elixir_advection_amr_nonperiodic.jl"),
6766
# Expected errors are exactly the same as in the serial test!
6867
l2=[3.2207388565869075e-5],
69-
linf=[0.0007508059772436404],
70-
coverage_override=(maxiters = 6,))
68+
linf=[0.0007508059772436404],)
7169
end
7270

7371
@trixi_testset "elixir_advection_restart_amr.jl" begin
@@ -88,8 +86,7 @@ CI_ON_WINDOWS = (get(ENV, "GITHUB_ACTIONS", false) == "true") && Sys.iswindows()
8886
@test_trixi_include(joinpath(EXAMPLES_DIR,
8987
"elixir_advection_amr_refine_twice.jl"),
9088
l2=[0.00020547512522578292],
91-
linf=[0.007831753383083506],
92-
coverage_override=(maxiters = 6,))
89+
linf=[0.007831753383083506],)
9390
meshfiles = filter(file -> endswith(file, ".h5") && startswith(file, "mesh"),
9491
readdir(outdir))
9592
@test length(meshfiles) > 1
@@ -99,8 +96,7 @@ CI_ON_WINDOWS = (get(ENV, "GITHUB_ACTIONS", false) == "true") && Sys.iswindows()
9996
@test_trixi_include(joinpath(EXAMPLES_DIR,
10097
"elixir_advection_amr_coarsen_twice.jl"),
10198
l2=[0.0014321062757891826],
102-
linf=[0.0253454486893413],
103-
coverage_override=(maxiters = 6,))
99+
linf=[0.0253454486893413],)
104100
end
105101

106102
# Hyperbolic diffusion
@@ -205,10 +201,7 @@ CI_ON_WINDOWS = (get(ENV, "GITHUB_ACTIONS", false) == "true") && Sys.iswindows()
205201
0.0002973166773747593,
206202
0.0002973166773760916,
207203
0.001154106793870291
208-
],
209-
# Let this test run until the end to cover the time-dependent lines
210-
# of the indicator and the MPI-specific AMR code.
211-
coverage_override=(maxiters = 10^5,))
204+
],)
212205
end
213206
end
214207

@@ -323,8 +316,7 @@ CI_ON_WINDOWS = (get(ENV, "GITHUB_ACTIONS", false) == "true") && Sys.iswindows()
323316
0.03857193149447702,
324317
0.031090457959835893,
325318
0.12125130332971423
326-
],
327-
coverage_override=(maxiters = 6,))
319+
],)
328320
end
329321

330322
if !CI_ON_WINDOWS # see comment on `CI_ON_WINDOWS` in `test/test_mpi.jl`

0 commit comments

Comments
 (0)