Skip to content

Commit 9e646d3

Browse files
committed
ci: split up mlj tests
1 parent 5b67999 commit 9e646d3

File tree

9 files changed

+51
-42
lines changed

9 files changed

+51
-42
lines changed

.github/workflows/CI.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ jobs:
111111
- ad/mooncake
112112
- aqua
113113
- jet
114-
- ext/mlj
114+
- ext/mlj/core
115+
- ext/mlj/mti
116+
- ext/mlj/templates
115117
- ext/symbolicutils
116118
- ext/json3_recorder
117119
- ext/dynamicquantities_units
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
[deps]
2-
DynamicExpressions = "a40a106e-89c9-4ca8-8020-a735e8728b6b"
32
LoggingExtras = "e6f89c97-d47a-5376-807f-9c37f3926c36"
43
MLJBase = "a7f614a8-145f-11e9-1d2a-a57a1082229d"
5-
MLJModelInterface = "e80e1ace-859a-464e-9ed9-23947d8ae3ea"
6-
MLJTestInterface = "72560011-54dd-4dc2-94f3-c5de45b75ecd"
74
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
85
SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"
96
TensorBoardLogger = "899adc3e-224a-11e9-021f-63837185c80f"
107
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
118
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"
129
TestItems = "1c621080-faea-4a02-84b6-bbd5e436b8fe"
13-
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

test/integration/ext/mlj/test_logging.jl renamed to test/integration/ext/mlj/core/test_logging.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using LoggingExtras: TeeLogger
66
using MLJBase: machine, fit!
77

8-
include(joinpath(@__DIR__, "..", "..", "..", "test_params.jl"))
8+
include(joinpath(@__DIR__, "..", "..", "..", "..", "test_params.jl"))
99

1010
dir = mktempdir()
1111
buf = IOBuffer()

test/integration/ext/mlj/test_mlj.jl renamed to test/integration/ext/mlj/core/test_mlj_core.jl

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,11 @@
1-
@testitem "Generic interface tests" tags = [:part3] begin
2-
using SymbolicRegression
3-
using SymbolicRegression: SRTestRegressor, MultitargetSRTestRegressor
4-
using MLJTestInterface: MLJTestInterface as MTI
5-
include(joinpath(@__DIR__, "..", "..", "..", "test_params.jl"))
6-
7-
failures, summary = MTI.test(
8-
[SRTestRegressor],
9-
MTI.make_regression()...;
10-
mod=@__MODULE__,
11-
verbosity=0,
12-
throw=true,
13-
)
14-
@test isempty(failures)
15-
16-
X = randn(100, 3)
17-
Y = @. cos(X^2) * 3.2 - 0.5
18-
(X, Y) = MTI.table.((X, Y))
19-
w = ones(100)
20-
failures, summary = MTI.test(
21-
[MultitargetSRTestRegressor], X, Y, w; mod=@__MODULE__, verbosity=0, throw=true
22-
)
23-
@test isempty(failures)
24-
end
25-
261
@testitem "Variable names - single outputs" tags = [:part3] begin
272
using SymbolicRegression
283
using SymbolicRegression: Node
294
using MLJBase
305
using SymbolicUtils
316
using Random: MersenneTwister
327

33-
include(joinpath(@__DIR__, "..", "..", "..", "test_params.jl"))
8+
include(joinpath(@__DIR__, "..", "..", "..", "..", "test_params.jl"))
349

3510
stop_kws = (; early_stop_condition=(loss, complexity) -> loss < 1e-5)
3611

@@ -65,7 +40,7 @@ end
6540
using MLJBase
6641
using Random: MersenneTwister
6742

68-
include(joinpath(@__DIR__, "..", "..", "..", "test_params.jl"))
43+
include(joinpath(@__DIR__, "..", "..", "..", "..", "test_params.jl"))
6944

7045
stop_kws = (; early_stop_condition=(loss, complexity) -> loss < 1e-5)
7146

@@ -101,7 +76,7 @@ end
10176
using MLJBase
10277
using Random: MersenneTwister
10378

104-
include(joinpath(@__DIR__, "..", "..", "..", "test_params.jl"))
79+
include(joinpath(@__DIR__, "..", "..", "..", "..", "test_params.jl"))
10580

10681
stop_kws = (; early_stop_condition=(loss, complexity) -> loss < 1e-5)
10782

@@ -125,7 +100,7 @@ end
125100
using MLJBase
126101
using Random: MersenneTwister
127102

128-
include(joinpath(@__DIR__, "..", "..", "..", "test_params.jl"))
103+
include(joinpath(@__DIR__, "..", "..", "..", "..", "test_params.jl"))
129104

130105
stop_kws = (; early_stop_condition=(loss, complexity) -> loss < 1e-5)
131106

@@ -194,7 +169,7 @@ end
194169
using MLJBase
195170
using Random: MersenneTwister
196171

197-
include(joinpath(@__DIR__, "..", "..", "..", "test_params.jl"))
172+
include(joinpath(@__DIR__, "..", "..", "..", "..", "test_params.jl"))
198173

199174
model = MultitargetSRRegressor()
200175
rng = MersenneTwister(0)
@@ -265,7 +240,7 @@ end
265240
using Random: MersenneTwister
266241
using Suppressor
267242

268-
include(joinpath(@__DIR__, "..", "..", "..", "test_params.jl"))
243+
include(joinpath(@__DIR__, "..", "..", "..", "..", "test_params.jl"))
269244

270245
# Test that parameter changes are respected and incompatible changes throw errors
271246
rng = MersenneTwister(0)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[deps]
2+
MLJTestInterface = "72560011-54dd-4dc2-94f3-c5de45b75ecd"
3+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
4+
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"
5+
TestItems = "1c621080-faea-4a02-84b6-bbd5e436b8fe"
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
@testitem "Generic interface tests" tags = [:part3] begin
2+
using SymbolicRegression
3+
using SymbolicRegression: SRTestRegressor, MultitargetSRTestRegressor
4+
using MLJTestInterface: MLJTestInterface as MTI
5+
include(joinpath(@__DIR__, "..", "..", "..", "..", "test_params.jl"))
6+
7+
failures, summary = MTI.test(
8+
[SRTestRegressor],
9+
MTI.make_regression()...;
10+
mod=@__MODULE__,
11+
verbosity=0,
12+
throw=true,
13+
)
14+
@test isempty(failures)
15+
16+
X = randn(100, 3)
17+
Y = @. cos(X^2) * 3.2 - 0.5
18+
(X, Y) = MTI.table.((X, Y))
19+
w = ones(100)
20+
failures, summary = MTI.test(
21+
[MultitargetSRTestRegressor], X, Y, w; mod=@__MODULE__, verbosity=0, throw=true
22+
)
23+
@test isempty(failures)
24+
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[deps]
2+
MLJBase = "a7f614a8-145f-11e9-1d2a-a57a1082229d"
3+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
4+
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"
5+
TestItems = "1c621080-faea-4a02-84b6-bbd5e436b8fe"

test/integration/ext/mlj/test_parametric_template_expressions.jl renamed to test/integration/ext/mlj/templates/test_parametric_template_expressions.jl

File renamed without changes.

test/runtests.jl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ include("front_matter.jl")
2626
# for each integration environment before we run its tests.
2727
Pkg.instantiate()
2828

29-
# Special case: MLJ integration runs examples
30-
if integration_name == "ext/mlj"
29+
# Special case: MLJ integrations run additional setup
30+
if startswith(integration_name, "ext/mlj")
3131
ENV["SYMBOLIC_REGRESSION_IS_TESTING"] = "true"
32-
include(joinpath(@__DIR__, "..", "example.jl"))
33-
include(joinpath(@__DIR__, "..", "examples", "parameterized_function.jl"))
34-
include(joinpath(@__DIR__, "..", "examples", "custom_types.jl"))
32+
if integration_name == "ext/mlj/templates"
33+
include(joinpath(@__DIR__, "..", "example.jl"))
34+
include(joinpath(@__DIR__, "..", "examples", "parameterized_function.jl"))
35+
include(joinpath(@__DIR__, "..", "examples", "custom_types.jl"))
36+
end
3537
end
3638

3739
# Run all test items in the integration directory

0 commit comments

Comments
 (0)