Skip to content

Commit 336619f

Browse files
committed
coverage leads to test failure, separate cov from test
1 parent 9130c53 commit 336619f

File tree

5 files changed

+33
-7
lines changed

5 files changed

+33
-7
lines changed

.github/workflows/tests.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
concurrency:
99
# Skip intermediate builds: always.
1010
group: ${{ github.workflow }}-${{ github.ref }}
11-
cancel-in-progress: true # allways cancle old runs on new push
11+
cancel-in-progress: true # always cancle old runs on new push
1212
jobs:
1313
test:
1414
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
@@ -38,6 +38,28 @@ jobs:
3838
- uses: julia-actions/cache@v2
3939
- uses: julia-actions/julia-buildpkg@v1
4040
- uses: julia-actions/julia-runtest@v1
41+
with:
42+
coverage: false
43+
44+
test-coverage:
45+
name: Test Coverage
46+
runs-on: ubuntu-latest
47+
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
48+
actions: write
49+
contents: read
50+
steps:
51+
- uses: actions/checkout@v4
52+
- uses: julia-actions/setup-julia@v2
53+
with:
54+
version: 1
55+
arch: x64
56+
- uses: julia-actions/cache@v2
57+
- uses: julia-actions/julia-buildpkg@v1
58+
- uses: julia-actions/julia-runtest@v1
59+
env:
60+
JULIA_COVERAGE: true
61+
with:
62+
coverage: true
4163
- uses: julia-actions/julia-processcoverage@v1
4264
- uses: codecov/codecov-action@v4
4365
with:

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ KernelAbstractions = "0.9.18"
5959
LinearAlgebra = "1"
6060
MacroTools = "0.5.15"
6161
Mixers = "0.1.2"
62-
ModelingToolkit = "9.61"
62+
ModelingToolkit = "9.67"
6363
NNlib = "0.9.13"
6464
NonlinearSolve = "4"
6565
Polyester = "0.7.12"

docs/examples/cascading_failure.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ prob = ODEProblem(nw, uflat(u0), (0,6), pflat(u0); callback=cbset)
245245
Main.test_execution_styles(prob) # testing all ex styles #src
246246
sol2 = solve(prob, Tsit5());
247247
## we want to test the reconstruction of the observables # hide
248-
@test all(!iszero, sol2(sol2.t; idxs=eidxs(sol2,:,:P))[begin]) # hide
249-
@test all(iszero, sol2(sol2.t; idxs=eidxs(sol2,:,:P))[end][[1:5...,7]]) # hide
248+
@test all(!iszero, sol2(sol2.t; idxs=eidxs(sol2,:,:P)).u[begin]) # hide
249+
@test all(iszero, sol2(sol2.t; idxs=eidxs(sol2,:,:P)).u[end][[1:5...,7]]) # hide
250250
nothing #hide
251251

252252
# Then again we plot the solution:

src/symbolicindexing.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -782,9 +782,9 @@ function NWState(sol::SciMLBase.AbstractODESolution, t::Number)
782782

783783
tidx = findfirst(_t -> _t > t, para_ts.t)
784784
p = if isnothing(tidx)
785-
para_ts[end]
785+
para_ts.u[end]
786786
else
787-
para_ts[tidx-1]
787+
para_ts.u[tidx-1]
788788
end
789789

790790
NWState(sol, u, p, t)

test/construction_test.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,11 @@ end
402402
u2 = vcat(u, out)
403403
# compfg(v2)((out2,), du2, u2, (in,), p, NaN)
404404
b = @b $(compfg(v2))($(out2,), $du2, $u2, $(in,), $p, NaN)
405-
@test b.allocs == 0
405+
if haskey(ENV, "JULIA_COVERAGE")
406+
@test b.allocs 6 # decreased performacen due to coverage sideeffects
407+
else
408+
@test b.allocs == 0
409+
end
406410
@test out out2
407411
@test du2 vcat(du, zeros(length(out)))
408412
end

0 commit comments

Comments
 (0)