Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 09a7691

Browse files
committed
Clean up the testing
1 parent 34e7d8c commit 09a7691

12 files changed

+46
-104
lines changed

.buildkite/pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ env:
2222
JULIA_PKG_SERVER: ""
2323
RETESTITEMS_NWORKERS: 4
2424
RETESTITEMS_NWORKER_THREADS: 2
25-
SECRET_CODECOV_TOKEN: "HsC3X/h3CrsRhMR199BUbw9xmASfTTEtdT2JMJlbkW6nsMtZXDIWxKzBNOpn0123zn3K+VE30i7+aLpcqZjlux0BQDMVLx5O5KudjrJmBE2G8KMMv1pra+UHEOFdFP3TzjHXGcHzpUrjpG8if8cHbsWdyQCV0Hdx2qAPnhX5haGPyMuIlRfoaWQfdxJPl5fDLXs1xe0LnMcYMx8uUsvvJZ/hhFtMYWJU0WFtqnAkCR8h/pQd6yZOaGP2SXJkOR8+1xbx+M8m6agH9idp2BjDPpXMOo27V3O2Gkoy3R4b5ouLdqOMaZSIOemoYCv6oh+EkbKaFvZydvm0xCW5YBFPPw==;U2FsdGVkX19FT0yFV6EMY/NVSQslXE6byckN0qa/HVU5dd3d4swmOCWBkBPtemRPGvCMP669iXSPfDTlw7ZSvw=="
25+
SECRET_CODECOV_TOKEN: "HsC3X/h3CrsRhMR199BUbw9xmASfTTEtdT2JMJlbkW6nsMtZXDIWxKzBNOpn0123zn3K+VE30i7+aLpcqZjlux0BQDMVLx5O5KudjrJmBE2G8KMMv1pra+UHEOFdFP3TzjHXGcHzpUrjpG8if8cHbsWdyQCV0Hdx2qAPnhX5haGPyMuIlRfoaWQfdxJPl5fDLXs1xe0LnMcYMx8uUsvvJZ/hhFtMYWJU0WFtqnAkCR8h/pQd6yZOaGP2SXJkOR8+1xbx+M8m6agH9idp2BjDPpXMOo27V3O2Gkoy3R4b5ouLdqOMaZSIOemoYCv6oh+EkbKaFvZydvm0xCW5YBFPPw==;U2FsdGVkX19FT0yFV6EMY/NVSQslXE6byckN0qa/HVU5dd3d4swmOCWBkBPtemRPGvCMP669iXSPfDTlw7ZSvw=="

.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-
- 'main'
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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ SimpleNonlinearSolveTrackerExt = "Tracker"
3636
SimpleNonlinearSolveZygoteExt = "Zygote"
3737

3838
[compat]
39-
ADTypes = "1"
39+
ADTypes = "1.2"
4040
AllocCheck = "0.1.1"
4141
Aqua = "0.8"
42-
ArrayInterface = "7.8"
42+
ArrayInterface = "7.9"
4343
CUDA = "5.2"
4444
ChainRulesCore = "1.22"
4545
ConcreteStructs = "0.2.3"
@@ -49,7 +49,7 @@ FastClosures = "0.3.2"
4949
FiniteDiff = "2.22"
5050
ForwardDiff = "0.10.36"
5151
LinearAlgebra = "1.10"
52-
LinearSolve = "2.25"
52+
LinearSolve = "2.30"
5353
MaybeInplace = "0.1.1"
5454
NonlinearProblemLibrary = "0.1.2"
5555
Pkg = "1.10"
@@ -59,8 +59,8 @@ Random = "1.10"
5959
ReTestItems = "1.23"
6060
Reexport = "1.2"
6161
ReverseDiff = "1.15"
62-
SciMLBase = "2.28.0"
63-
SciMLSensitivity = "7.56"
62+
SciMLBase = "2.37.0"
63+
SciMLSensitivity = "7.58"
6464
StaticArrays = "1.9"
6565
StaticArraysCore = "1.4.2"
6666
Test = "1.10"

test/core/23_test_problems_tests.jl

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ end
4141
export problems, dicts, test_on_library
4242
end
4343

44-
@testitem "SimpleNewtonRaphson" setup=[RobustnessTesting] begin
44+
@testitem "SimpleNewtonRaphson" setup=[RobustnessTesting] tags=[:core] begin
4545
alg_ops = (SimpleNewtonRaphson(),)
4646

4747
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 "SimpleTrustRegion" setup=[RobustnessTesting] begin
53+
@testitem "SimpleTrustRegion" setup=[RobustnessTesting] tags=[:core] begin
5454
alg_ops = (SimpleTrustRegion(),
5555
SimpleTrustRegion(; nlsolve_update_rule = Val(true)))
5656

@@ -61,16 +61,20 @@ end
6161
test_on_library(problems, dicts, alg_ops, broken_tests)
6262
end
6363

64-
@testitem "SimpleDFSane" setup=[RobustnessTesting] begin
64+
@testitem "SimpleDFSane" setup=[RobustnessTesting] tags=[:core] begin
6565
alg_ops = (SimpleDFSane(),)
6666

6767
broken_tests = Dict(alg => Int[] for alg in alg_ops)
68-
broken_tests[alg_ops[1]] = [1, 2, 3, 4, 5, 6, 11, 21]
68+
if Sys.isapple()
69+
broken_tests[alg_ops[1]] = [1, 2, 3, 5, 6, 21]
70+
else
71+
broken_tests[alg_ops[1]] = [1, 2, 3, 4, 5, 6, 11, 21]
72+
end
6973

7074
test_on_library(problems, dicts, alg_ops, broken_tests)
7175
end
7276

73-
@testitem "SimpleBroyden" retries=5 setup=[RobustnessTesting] begin
77+
@testitem "SimpleBroyden" retries=5 setup=[RobustnessTesting] tags=[:core] begin
7478
alg_ops = (SimpleBroyden(),)
7579

7680
broken_tests = Dict(alg => Int[] for alg in alg_ops)
@@ -79,7 +83,7 @@ end
7983
test_on_library(problems, dicts, alg_ops, broken_tests)
8084
end
8185

82-
@testitem "SimpleKlement" setup=[RobustnessTesting] begin
86+
@testitem "SimpleKlement" setup=[RobustnessTesting] tags=[:core] begin
8387
alg_ops = (SimpleKlement(),)
8488

8589
broken_tests = Dict(alg => Int[] for alg in alg_ops)

test/core/adjoint_tests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@testitem "Simple Adjoint Test" begin
1+
@testitem "Simple Adjoint Test" tags=[:core] begin
22
using ForwardDiff, ReverseDiff, SciMLSensitivity, Tracker, Zygote
33

44
ff(u, p) = u .^ 2 .- p

test/core/aqua_tests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@testitem "Aqua" begin
1+
@testitem "Aqua" tags=[:core] begin
22
using Aqua
33

44
Aqua.test_all(SimpleNonlinearSolve; piracies = false, ambiguities = false)

test/core/forward_ad_tests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ __compatible(::SimpleHalley, ::Val{:iip}) = false
4040
export test_f, test_f!, jacobian_f, solve_with, __compatible
4141
end
4242

43-
@testitem "ForwardDiff.jl Integration: Rootfinding" setup=[ForwardADRootfindingTesting] begin
43+
@testitem "ForwardDiff.jl Integration: Rootfinding" setup=[ForwardADRootfindingTesting] tags=[:core] begin
4444
@testset "$(nameof(typeof(alg)))" for alg in (SimpleNewtonRaphson(),
4545
SimpleTrustRegion(), SimpleTrustRegion(; nlsolve_update_rule = Val(true)),
4646
SimpleHalley(), SimpleBroyden(), SimpleKlement(), SimpleDFSane())
@@ -133,7 +133,7 @@ export loss_function, loss_function!, loss_function_jac, loss_function_vjp,
133133
loss_function_jac!, loss_function_vjp!, θ_init, x, y_target
134134
end
135135

136-
@testitem "ForwardDiff.jl Integration: NLLS" setup=[ForwardADNLLSTesting] begin
136+
@testitem "ForwardDiff.jl Integration: NLLS" setup=[ForwardADNLLSTesting] tags=[:core] begin
137137
@testset "$(nameof(typeof(alg)))" for alg in (
138138
SimpleNewtonRaphson(), SimpleGaussNewton(),
139139
SimpleNewtonRaphson(AutoFiniteDiff()), SimpleGaussNewton(AutoFiniteDiff()))

test/core/least_squares_tests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@testitem "Nonlinear Least Squares" begin
1+
@testitem "Nonlinear Least Squares" tags=[:core] begin
22
using LinearAlgebra
33

44
true_function(x, θ) = @. θ[1] * exp(θ[2] * x) * cos(θ[3] * x + θ[4])

test/core/matrix_resizing_tests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@testitem "Matrix Resizing" begin
1+
@testitem "Matrix Resizing" tags=[:core] begin
22
ff(u, p) = u .* u .- p
33
u0 = ones(2, 3)
44
p = 2.0

test/core/rootfind_tests.jl

Lines changed: 10 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export quadratic_f, quadratic_f!, quadratic_f2, newton_fails, TERMINATION_CONDIT
3939

4040
end
4141

42-
@testitem "First Order Methods" setup=[RootfindingTesting] begin
42+
@testitem "First Order Methods" setup=[RootfindingTesting] tags=[:core] begin
4343
@testset "$(alg)" for alg in (SimpleNewtonRaphson, SimpleTrustRegion,
4444
(args...; kwargs...) -> SimpleTrustRegion(args...; nlsolve_update_rule = Val(true),
4545
kwargs...))
@@ -70,7 +70,7 @@ end
7070
end
7171
end
7272

73-
@testitem "SimpleHalley" setup=[RootfindingTesting] begin
73+
@testitem "SimpleHalley" setup=[RootfindingTesting] tags=[:core] begin
7474
@testset "AutoDiff: $(nameof(typeof(autodiff)))" for autodiff in (AutoFiniteDiff(),
7575
AutoForwardDiff())
7676
@testset "[OOP] u0: $(nameof(typeof(u0)))" for u0 in ([1.0, 1.0],
@@ -89,7 +89,7 @@ end
8989
end
9090
end
9191

92-
@testitem "Derivative Free Metods" setup=[RootfindingTesting] begin
92+
@testitem "Derivative Free Metods" setup=[RootfindingTesting] tags=[:core] begin
9393
@testset "$(nameof(typeof(alg)))" for alg in [SimpleBroyden(), SimpleKlement(),
9494
SimpleDFSane(), SimpleLimitedMemoryBroyden(),
9595
SimpleBroyden(; linesearch = Val(true)),
@@ -115,7 +115,7 @@ end
115115
end
116116
end
117117

118-
@testitem "Newton Fails" setup=[RootfindingTesting] begin
118+
@testitem "Newton Fails" setup=[RootfindingTesting] tags=[:core] begin
119119
u0 = [-10.0, -1.0, 1.0, 2.0, 3.0, 4.0, 10.0]
120120
p = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
121121

@@ -127,13 +127,13 @@ end
127127
end
128128
end
129129

130-
@testitem "Kwargs Propagation" setup=[RootfindingTesting] begin
130+
@testitem "Kwargs Propagation" setup=[RootfindingTesting] tags=[:core] begin
131131
prob = NonlinearProblem(quadratic_f, ones(4), 2.0; maxiters = 2)
132132
sol = solve(prob, SimpleNewtonRaphson())
133133
@test sol.retcode === ReturnCode.MaxIters
134134
end
135135

136-
@testitem "Allocation Checks" setup=[RootfindingTesting] begin
136+
@testitem "Allocation Checks" setup=[RootfindingTesting] tags=[:core] begin
137137
if Sys.islinux() # Very slow on other OS
138138
@testset "$(nameof(typeof(alg)))" for alg in (SimpleNewtonRaphson(),
139139
SimpleHalley(), SimpleBroyden(), SimpleKlement(), SimpleLimitedMemoryBroyden(),
@@ -165,7 +165,7 @@ end
165165
end
166166
end
167167

168-
@testitem "Interval Nonlinear Problems" setup=[RootfindingTesting] begin
168+
@testitem "Interval Nonlinear Problems" setup=[RootfindingTesting] tags=[:core] begin
169169
@testset "$(nameof(typeof(alg)))" for alg in (Bisection(), Falsi(), Ridder(), Brent(),
170170
ITP(), Alefeld())
171171
tspan = (1.0, 20.0)
@@ -209,7 +209,7 @@ end
209209
end
210210
end
211211

212-
@testitem "Tolerance Tests Interval Methods" setup=[RootfindingTesting] begin
212+
@testitem "Tolerance Tests Interval Methods" setup=[RootfindingTesting] tags=[:core] begin
213213
@testset "$(nameof(typeof(alg)))" for alg in (Bisection(), Falsi(), ITP())
214214
tspan = (1.0, 20.0)
215215
probB = IntervalNonlinearProblem(quadratic_f, tspan, 2.0)
@@ -224,7 +224,7 @@ end
224224
end
225225
end
226226

227-
@testitem "Tolerance Tests Interval Methods 2" setup=[RootfindingTesting] begin
227+
@testitem "Tolerance Tests Interval Methods 2" setup=[RootfindingTesting] tags=[:core] begin
228228
@testset "$(nameof(typeof(alg)))" for alg in (Ridder(), Brent())
229229
tspan = (1.0, 20.0)
230230
probB = IntervalNonlinearProblem(quadratic_f, tspan, 2.0)
@@ -239,7 +239,7 @@ end
239239
end
240240
end
241241

242-
@testitem "Flipped Signs and Reversed Tspan" setup=[RootfindingTesting] begin
242+
@testitem "Flipped Signs and Reversed Tspan" setup=[RootfindingTesting] tags=[:core] begin
243243
@testset "$(nameof(typeof(alg)))" for alg in (Alefeld(), Bisection(), Falsi(), Brent(),
244244
ITP(), Ridder())
245245
f1(u, p) = u * u - p
@@ -257,31 +257,3 @@ end
257257
end
258258
end
259259
end
260-
261-
# The following tests were included in the previos versions but these kwargs never did
262-
# anything!
263-
# # Garuntee Tests for Bisection
264-
# f = function (u, p)
265-
# if u < 2.0
266-
# return u - 2.0
267-
# elseif u > 3.0
268-
# return u - 3.0
269-
# else
270-
# return 0.0
271-
# end
272-
# end
273-
# probB = IntervalNonlinearProblem(f, (0.0, 4.0))
274-
275-
# sol = solve(probB, Bisection(; exact_left = true))
276-
# @test f(sol.left, nothing) < 0.0
277-
# @test f(nextfloat(sol.left), nothing) >= 0.0
278-
279-
# sol = solve(probB, Bisection(; exact_right = true))
280-
# @test f(sol.right, nothing) >= 0.0
281-
# @test f(prevfloat(sol.right), nothing) <= 0.0
282-
283-
# sol = solve(probB, Bisection(; exact_left = true, exact_right = true); immutable = false)
284-
# @test f(sol.left, nothing) < 0.0
285-
# @test f(nextfloat(sol.left), nothing) >= 0.0
286-
# @test f(sol.right, nothing) >= 0.0
287-
# @test f(prevfloat(sol.right), nothing) <= 0.0

test/gpu/cuda_tests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@testitem "Solving on GPUs" begin
1+
@testitem "Solving on GPUs" tags=[:cuda] begin
22
using StaticArrays, CUDA
33

44
CUDA.allowscalar(false)
@@ -36,7 +36,7 @@
3636
end
3737
end
3838

39-
@testitem "CUDA Kernel Launch Test" begin
39+
@testitem "CUDA Kernel Launch Test" tags=[:cuda] begin
4040
using StaticArrays, CUDA
4141

4242
CUDA.allowscalar(false)

test/runtests.jl

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
using ReTestItems
1+
using ReTestItems, CUDA
22

3-
const GROUP = get(ENV, "GROUP", "All")
3+
const GROUP = get(ENV, "GROUP", CUDA.functional() ? "All" : "Core")
44

5-
if GROUP == "All" || GROUP == "Core"
6-
ReTestItems.runtests(joinpath(@__DIR__, "core/"))
7-
end
8-
9-
if GROUP == "GPU"
10-
ReTestItems.runtests(joinpath(@__DIR__, "gpu/"))
5+
if GROUP == "All"
6+
ReTestItems.runtests(@__DIR__; tags = [:all])
7+
else
8+
tags = [Symbol(lowercase(GROUP))]
9+
ReTestItems.runtests(@__DIR__; tags)
1110
end

0 commit comments

Comments
 (0)