Skip to content

Commit 78f226c

Browse files
committed
Separate tests into two groups
1 parent 9b179f1 commit 78f226c

File tree

2 files changed

+54
-5
lines changed

2 files changed

+54
-5
lines changed

.github/workflows/CI.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ jobs:
6060
os: macos-latest
6161
arch: aarch64
6262
num_threads: 2
63+
test_group:
64+
- Group1
65+
- Group2
6366

6467
steps:
6568
- uses: actions/checkout@v4
@@ -75,6 +78,7 @@ jobs:
7578

7679
- uses: julia-actions/julia-runtest@v1
7780
env:
81+
GROUP: ${{ matrix.test_group }}
7882
JULIA_NUM_THREADS: ${{ matrix.runner.num_threads }}
7983

8084
- uses: julia-actions/julia-processcoverage@v1

test/runtests.jl

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ Random.seed!(100)
3939

4040
include("test_util.jl")
4141

42-
@testset "DynamicPPL.jl" begin
43-
@testset "interface" begin
42+
@testset verbose = true "DynamicPPL.jl" begin
43+
if GROUP == "All" || GROUP == "Group1"
4444
include("utils.jl")
4545
include("compiler.jl")
4646
include("varnamedvector.jl")
@@ -50,15 +50,60 @@ include("test_util.jl")
5050
include("sampler.jl")
5151
include("independence.jl")
5252
include("distribution_wrappers.jl")
53-
include("contexts.jl")
54-
include("context_implementations.jl")
5553
include("logdensityfunction.jl")
5654
include("linking.jl")
57-
include("threadsafe.jl")
5855
include("serialization.jl")
5956
include("pointwise_logdensities.jl")
6057
include("lkj.jl")
58+
end
59+
60+
if GROUP == "All" || GROUP == "Group2"
61+
include("contexts.jl")
62+
include("context_implementations.jl")
63+
include("threadsafe.jl")
6164
include("debug_utils.jl")
65+
@testset "compat" begin
66+
include(joinpath("compat", "ad.jl"))
67+
end
68+
@testset "extensions" begin
69+
include("ext/DynamicPPLMCMCChainsExt.jl")
70+
include("ext/DynamicPPLJETExt.jl")
71+
end
72+
@testset "ad" begin
73+
include("ext/DynamicPPLForwardDiffExt.jl")
74+
include("ext/DynamicPPLMooncakeExt.jl")
75+
include("ad.jl")
76+
end
77+
@testset "prob and logprob macro" begin
78+
@test_throws ErrorException prob"..."
79+
@test_throws ErrorException logprob"..."
80+
end
81+
@testset "doctests" begin
82+
DocMeta.setdocmeta!(
83+
DynamicPPL,
84+
:DocTestSetup,
85+
:(using DynamicPPL, Distributions);
86+
recursive=true,
87+
)
88+
doctestfilters = [
89+
# Older versions will show "0 element Array" instead of "Type[]".
90+
r"(Any\[\]|0-element Array{.+,[0-9]+})",
91+
# Older versions will show "Array{...,1}" instead of "Vector{...}".
92+
r"(Array{.+,\s?1}|Vector{.+})",
93+
# Older versions will show "Array{...,2}" instead of "Matrix{...}".
94+
r"(Array{.+,\s?2}|Matrix{.+})",
95+
# Errors from macros sometimes result in `LoadError: LoadError:`
96+
# rather than `LoadError:`, depending on Julia version.
97+
r"ERROR: (LoadError:\s)+",
98+
# Older versions do not have `;;]` but instead just `]` at end of the line
99+
# => need to treat `;;]` and `]` as the same, i.e. ignore them if at the end of a line
100+
r"(;;){0,1}\]$"m,
101+
# Ignore the source of a warning in the doctest output, since this is dependent on host.
102+
# This is a line that starts with "└ @ " and ends with the line number.
103+
r"└ @ .+:[0-9]+",
104+
]
105+
doctest(DynamicPPL; manual=false, doctestfilters=doctestfilters)
106+
end
62107
end
63108

64109
@testset "compat" begin

0 commit comments

Comments
 (0)