Skip to content

Commit fb2340a

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

File tree

2 files changed

+55
-5
lines changed

2 files changed

+55
-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: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@ using OrderedCollections: OrderedSet
3535

3636
using DynamicPPL: getargs_dottilde, getargs_tilde, Selector
3737

38+
const GROUP = get(ENV, "GROUP", "All")
3839
Random.seed!(100)
3940

4041
include("test_util.jl")
4142

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

64110
@testset "compat" begin

0 commit comments

Comments
 (0)