Skip to content

Commit 53ca614

Browse files
authored
Merge pull request #430 from SciML/ap/testing
Clean up testing
2 parents 441c5ea + ed60ded commit 53ca614

25 files changed

+145
-197
lines changed

.buildkite/pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ steps:
1818
if: build.message !~ /\[skip tests\]/
1919

2020
env:
21-
GROUP: GPU
21+
GROUP: CUDA
2222
JULIA_PKG_SERVER: "" # it often struggles with our large artifacts
2323
RETESTITEMS_NWORKERS: 4
2424
RETESTITEMS_NWORKER_THREADS: 2

.github/workflows/CI.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
group:
2121
- Core
2222
- Downstream
23+
- Misc
24+
- Wrappers
2325
version:
2426
- "1"
2527
os:

.github/workflows/FormatCheck.yml

Lines changed: 5 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,9 @@
1-
name: format-check
1+
name: Format suggestions
22

3-
on:
4-
push:
5-
branches:
6-
- 'master'
7-
- 'release-'
8-
tags: '*'
9-
pull_request:
3+
on: [pull_request]
104

115
jobs:
12-
build:
13-
runs-on: ${{ matrix.os }}
14-
strategy:
15-
matrix:
16-
julia-version: [1]
17-
julia-arch: [x86]
18-
os: [ubuntu-latest]
6+
code-style:
7+
runs-on: ubuntu-latest
198
steps:
20-
- uses: julia-actions/setup-julia@latest
21-
with:
22-
version: ${{ matrix.julia-version }}
23-
24-
- uses: actions/checkout@v4
25-
- name: Install JuliaFormatter and format
26-
# This will use the latest version by default but you can set the version like so:
27-
#
28-
# julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.0"))'
29-
run: |
30-
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
31-
julia -e 'using JuliaFormatter; format(".", verbose=true)'
32-
- name: Format check
33-
run: |
34-
julia -e '
35-
out = Cmd(`git diff --name-only`) |> read |> String
36-
if out == ""
37-
exit(0)
38-
else
39-
@error "Some files have not been formatted !!!"
40-
write(stdout, out)
41-
exit(1)
42-
end'
9+
- uses: julia-actions/julia-format@v2

Project.toml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ BenchmarkTools = "1.4"
6565
CUDA = "5.2"
6666
ConcreteStructs = "0.2.3"
6767
DiffEqBase = "6.149.0"
68-
Enzyme = "0.11.15, 0.12"
68+
Enzyme = "0.12"
6969
FastBroadcast = "0.2.8"
7070
FastClosures = "0.3.2"
7171
FastLevenbergMarquardt = "0.1"
@@ -76,9 +76,10 @@ LazyArrays = "1.8.2"
7676
LeastSquaresOptim = "0.8.5"
7777
LineSearches = "7.2"
7878
LinearAlgebra = "1.10"
79-
LinearSolve = "2.29"
79+
LinearSolve = "2.30"
8080
MINPACK = "1.2"
8181
MaybeInplace = "0.1.1"
82+
ModelingToolkit = "9.13.0"
8283
NLSolvers = "0.5"
8384
NLsolve = "4.5"
8485
NaNMath = "1"
@@ -89,11 +90,10 @@ PrecompileTools = "1.2"
8990
Preferences = "1.4"
9091
Printf = "1.10"
9192
Random = "1.91"
92-
ReTestItems = "1"
93+
ReTestItems = "1.24"
9394
RecursiveArrayTools = "3.8"
9495
Reexport = "1.2"
9596
SIAMFANLEquations = "1.0.1"
96-
SafeTestsets = "0.1"
9797
SciMLBase = "2.34.0"
9898
SimpleNonlinearSolve = "1.8"
9999
SparseArrays = "1.10"
@@ -103,8 +103,8 @@ StableRNGs = "1"
103103
StaticArrays = "1.9"
104104
StaticArraysCore = "1.4"
105105
Sundials = "4.23.1"
106-
Symbolics = "5.13"
107106
SymbolicIndexingInterface = "0.3.15"
107+
Symbolics = "5.26"
108108
Test = "1.10"
109109
TimerOutputs = "0.5.23"
110110
Zygote = "0.6.69"
@@ -115,15 +115,12 @@ Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
115115
BandedMatrices = "aae01518-5342-5314-be14-df237901396f"
116116
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
117117
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
118-
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
119118
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
120119
FastLevenbergMarquardt = "7a0df574-e128-4d35-8cbd-3d84502bf7ce"
121120
FixedPointAcceleration = "817d07cb-a79a-5c30-9a31-890123675176"
122-
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
123121
LeastSquaresOptim = "0fc2ff8b-aaa3-5acd-a817-1944a5e08891"
124-
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
125-
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
126122
MINPACK = "4854310b-de5a-5eb6-a2a5-c1dee2bd17f9"
123+
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
127124
NLSolvers = "337daf1e-9722-11e9-073e-8b9effe078ba"
128125
NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56"
129126
NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
@@ -132,10 +129,7 @@ OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
132129
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
133130
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
134131
ReTestItems = "817f1d60-ba6b-4fd5-9520-3cf149f6a823"
135-
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
136132
SIAMFANLEquations = "084e46ad-d928-497d-ad5e-07fa361a48c4"
137-
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
138-
SparseDiffTools = "47a9eef4-7e08-11e9-0b38-333d64bd3804"
139133
SpeedMapping = "f1835b91-879b-4a3f-a438-e4baacf14412"
140134
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
141135
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
@@ -145,4 +139,4 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
145139
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
146140

147141
[targets]
148-
test = ["Aqua", "Enzyme", "BenchmarkTools", "SafeTestsets", "Pkg", "Test", "ForwardDiff", "StaticArrays", "Symbolics", "LinearSolve", "Random", "LinearAlgebra", "Zygote", "SparseDiffTools", "NonlinearProblemLibrary", "LeastSquaresOptim", "FastLevenbergMarquardt", "NaNMath", "BandedMatrices", "DiffEqBase", "StableRNGs", "MINPACK", "NLsolve", "OrdinaryDiffEq", "SpeedMapping", "FixedPointAcceleration", "SIAMFANLEquations", "Sundials", "ReTestItems", "Reexport", "CUDA", "NLSolvers"]
142+
test = ["Aqua", "BandedMatrices", "BenchmarkTools", "CUDA", "Enzyme", "FastLevenbergMarquardt", "FixedPointAcceleration", "LeastSquaresOptim", "MINPACK", "ModelingToolkit", "NLSolvers", "NLsolve", "NaNMath", "NonlinearProblemLibrary", "OrdinaryDiffEq", "Pkg", "Random", "ReTestItems", "SIAMFANLEquations", "SpeedMapping", "StableRNGs", "StaticArrays", "Sundials", "Symbolics", "Test", "Zygote"]

test/core/23_test_problems_tests.jl

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ end
4040
export test_on_library, problems, dicts
4141
end
4242

43-
@testitem "PolyAlgorithms" setup=[RobustnessTesting] begin
43+
@testitem "PolyAlgorithms" setup=[RobustnessTesting] tags=[:core] begin
4444
alg_ops = (RobustMultiNewton(), FastShortcutNonlinearPolyalg())
4545

4646
broken_tests = Dict(alg => Int[] for alg in alg_ops)
@@ -50,7 +50,7 @@ end
5050
test_on_library(problems, dicts, alg_ops, broken_tests)
5151
end
5252

53-
@testitem "NewtonRaphson" setup=[RobustnessTesting] begin
53+
@testitem "NewtonRaphson" setup=[RobustnessTesting] tags=[:core] begin
5454
alg_ops = (NewtonRaphson(),)
5555

5656
broken_tests = Dict(alg => Int[] for alg in alg_ops)
@@ -59,7 +59,7 @@ end
5959
test_on_library(problems, dicts, alg_ops, broken_tests)
6060
end
6161

62-
@testitem "TrustRegion" setup=[RobustnessTesting] begin
62+
@testitem "TrustRegion" setup=[RobustnessTesting] tags=[:core] begin
6363
alg_ops = (TrustRegion(; radius_update_scheme = RadiusUpdateSchemes.Simple),
6464
TrustRegion(; radius_update_scheme = RadiusUpdateSchemes.Fan),
6565
TrustRegion(; radius_update_scheme = RadiusUpdateSchemes.Hei),
@@ -78,7 +78,7 @@ end
7878
test_on_library(problems, dicts, alg_ops, broken_tests)
7979
end
8080

81-
@testitem "LevenbergMarquardt" setup=[RobustnessTesting] begin
81+
@testitem "LevenbergMarquardt" setup=[RobustnessTesting] tags=[:core] begin
8282
using LinearSolve
8383

8484
alg_ops = (LevenbergMarquardt(), LevenbergMarquardt(; α_geodesic = 0.1),
@@ -92,7 +92,7 @@ end
9292
test_on_library(problems, dicts, alg_ops, broken_tests)
9393
end
9494

95-
@testitem "DFSane" setup=[RobustnessTesting] begin
95+
@testitem "DFSane" setup=[RobustnessTesting] tags=[:core] begin
9696
alg_ops = (DFSane(),)
9797

9898
broken_tests = Dict(alg => Int[] for alg in alg_ops)
@@ -101,21 +101,28 @@ end
101101
test_on_library(problems, dicts, alg_ops, broken_tests)
102102
end
103103

104-
@testitem "Broyden" setup=[RobustnessTesting] begin
104+
@testitem "Broyden" setup=[RobustnessTesting] tags=[:core] begin
105105
alg_ops = (Broyden(), Broyden(; init_jacobian = Val(:true_jacobian)),
106106
Broyden(; update_rule = Val(:bad_broyden)),
107107
Broyden(; init_jacobian = Val(:true_jacobian), update_rule = Val(:bad_broyden)))
108108

109109
broken_tests = Dict(alg => Int[] for alg in alg_ops)
110-
broken_tests[alg_ops[1]] = [1, 5, 11, 15]
111-
broken_tests[alg_ops[2]] = [1, 5, 8, 11, 18]
112-
broken_tests[alg_ops[3]] = [1, 5, 9, 11]
113-
broken_tests[alg_ops[4]] = [5, 6, 8, 11]
110+
if Sys.isapple()
111+
broken_tests[alg_ops[1]] = [1, 5, 11]
112+
broken_tests[alg_ops[2]] = [1, 5, 8, 11, 18]
113+
broken_tests[alg_ops[3]] = [1, 5, 6, 9, 11]
114+
broken_tests[alg_ops[4]] = [5, 6, 8, 11]
115+
else
116+
broken_tests[alg_ops[1]] = [1, 5, 11, 15]
117+
broken_tests[alg_ops[2]] = [1, 5, 8, 11, 18]
118+
broken_tests[alg_ops[3]] = [1, 5, 9, 11]
119+
broken_tests[alg_ops[4]] = [5, 6, 8, 11]
120+
end
114121

115-
test_on_library(problems, dicts, alg_ops, broken_tests)
122+
test_on_library(problems, dicts, alg_ops, broken_tests, Sys.isapple() ? 1e-3 : 1e-4)
116123
end
117124

118-
@testitem "Klement" retries=5 setup=[RobustnessTesting] begin
125+
@testitem "Klement" retries=5 setup=[RobustnessTesting] tags=[:core] begin
119126
alg_ops = (Klement(), Klement(; init_jacobian = Val(:true_jacobian_diagonal)))
120127

121128
broken_tests = Dict(alg => Int[] for alg in alg_ops)
@@ -125,7 +132,7 @@ end
125132
test_on_library(problems, dicts, alg_ops, broken_tests)
126133
end
127134

128-
@testitem "PseudoTransient" setup=[RobustnessTesting] begin
135+
@testitem "PseudoTransient" setup=[RobustnessTesting] tags=[:core] begin
129136
# PT relies on the root being a stable equilibrium for convergence, so it won't work on
130137
# most problems
131138
alg_ops = (PseudoTransient(),)

test/core/forward_ad_tests.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,14 @@ __compatible(::KINSOL, ::Val{:oop_cache}) = false
6262
export test_f!, test_f, jacobian_f, solve_with, __compatible
6363
end
6464

65-
@testitem "ForwardDiff.jl Integration" setup=[ForwardADTesting] begin
65+
@testitem "ForwardDiff.jl Integration" setup=[ForwardADTesting] tags=[:core] begin
6666
for alg in (NewtonRaphson(), TrustRegion(), LevenbergMarquardt(),
6767
PseudoTransient(; alpha_initial = 10.0), Broyden(), Klement(), DFSane(),
6868
nothing, NLsolveJL(), CMINPACK(), KINSOL(; globalization_strategy = :LineSearch))
6969
us = (2.0, @SVector[1.0, 1.0], [1.0, 1.0], ones(2, 2), @SArray ones(2, 2))
7070

71+
alg isa CMINPACK && Sys.isapple() && continue
72+
7173
@testset "Scalar AD" begin
7274
for p in 1.0:0.1:100.0, u0 in us, mode in (:iip, :oop, :iip_cache, :oop_cache)
7375
__compatible(u0, alg) || continue

test/core/nlls_tests.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ end
4848
export solvers, θ_init, x, y_target, true_function, θ_true, loss_function
4949
end
5050

51-
@testitem "General NLLS Solvers" setup=[CoreNLLSTesting] begin
51+
@testitem "General NLLS Solvers" setup=[CoreNLLSTesting] tags=[:core] begin
5252
prob_oop = NonlinearLeastSquaresProblem{false}(loss_function, θ_init, x)
5353
prob_iip = NonlinearLeastSquaresProblem(
5454
NonlinearFunction(loss_function; resid_prototype = zero(y_target)), θ_init, x)
@@ -62,7 +62,7 @@ end
6262
end
6363
end
6464

65-
@testitem "Custom VJP" setup=[CoreNLLSTesting] begin
65+
@testitem "Custom VJP" setup=[CoreNLLSTesting] tags=[:core] begin
6666
# This is just for testing that we can use vjp provided by the user
6767
function vjp(v, θ, p)
6868
resid = zeros(length(p))
@@ -96,7 +96,7 @@ end
9696
end
9797
end
9898

99-
@testitem "NLLS Analytic Jacobian" begin
99+
@testitem "NLLS Analytic Jacobian" tags=[:core] begin
100100
dataIn = 1:10
101101
f(x, p) = x[1] * dataIn .^ 2 .+ x[2] * dataIn .+ x[3]
102102
dataOut = f([1, 2, 3], nothing) + 0.1 * randn(10, 1)

0 commit comments

Comments
 (0)