Skip to content

Commit 92c5d5d

Browse files
ChrisRackauckas-ClaudeChrisRackauckasclaude
authored
Canonical CI: grouped-tests.yml + root test/test_groups.toml (#64)
* Canonical CI: grouped-tests.yml + root test/test_groups.toml Convert the root Tests.yml workflow from a hand-maintained version x os matrix calling tests.yml@v1 into a thin caller of the reusable grouped-tests.yml@v1, with the matrix declared in test/test_groups.toml. Category B refactor: Aqua previously ran inline in runtests.jl alongside the functional tests. It is now isolated in a QA group: - test/test_groups.toml: Core on [lts, 1, pre] across [ubuntu, macos, windows] (preserving the old OS coverage, num_threads=11 to match the old JULIA_NUM_THREADS), QA on [lts, 1]. - test/qa/Project.toml + test/qa/qa.jl: isolated QA env (Aqua + Test + the package via [sources] path="../.."), julia compat 1.10. - test/runtests.jl: dispatches on GROUP. Core/All run the functional safetestsets plus alloc_tests.jl; QA activates test/qa, develops the package, instantiates, and includes qa.jl. - test/Project.toml: drop Aqua (moved to the QA env). on:/concurrency: preserved verbatim. Other workflows untouched. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Add Pkg to test deps for grouped-tests Core group The Core test group runs with project='.', and test/runtests.jl does `using Pkg` to activate the QA sub-environment. Pkg was not a declared test dependency in the root test env, so the Core job failed with `ArgumentError: Package Pkg not found in current path`. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: ChrisRackauckas-Claude <accounts@chrisrackauckas.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 1802c01 commit 92c5d5d

6 files changed

Lines changed: 136 additions & 129 deletions

File tree

.github/workflows/Tests.yml

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,7 @@ concurrency:
1717
group: ${{ github.workflow }}-${{ github.ref }}
1818
cancel-in-progress: ${{ github.ref_name != github.event.repository.default_branch || github.ref != 'refs/tags/v*' }}
1919

20-
env:
21-
JULIA_NUM_THREADS: 11
22-
RETESTITEMS_NWORKERS: 4
23-
RETESTITEMS_NWORKER_THREADS: 2
24-
2520
jobs:
2621
tests:
27-
name: "Tests"
28-
strategy:
29-
fail-fast: false
30-
matrix:
31-
version:
32-
- "1"
33-
- "lts"
34-
- "pre"
35-
os:
36-
- "ubuntu-latest"
37-
- "macos-latest"
38-
- "windows-latest"
39-
uses: "SciML/.github/.github/workflows/tests.yml@v1"
40-
with:
41-
julia-version: "${{ matrix.version }}"
42-
os: "${{ matrix.os }}"
22+
uses: "SciML/.github/.github/workflows/grouped-tests.yml@v1"
4323
secrets: "inherit"

test/Project.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
[deps]
22
AllocCheck = "9b6a8646-10ed-4001-bbdc-1d2f46dfbb1a"
3-
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
43
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
54
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
65
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
76
MatrixFactorizations = "a3b82374-2e81-5b9e-98ce-41277c0e4c87"
7+
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
88
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
99
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
1010
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1111
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1212

1313
[compat]
1414
AllocCheck = "0.2.3"
15-
Aqua = "0.8.14"
1615
ArrayLayouts = "1.12.2"
1716
BenchmarkTools = "1.6.3"
1817
MatrixFactorizations = "3.1.3"

test/qa/Project.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[deps]
2+
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
3+
FastAlmostBandedMatrices = "9d29842c-ecb8-4973-b1e9-a27b1157504e"
4+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
5+
6+
[sources]
7+
FastAlmostBandedMatrices = {path = "../.."}
8+
9+
[compat]
10+
Aqua = "0.8.14"
11+
Test = "1"
12+
julia = "1.10"

test/qa/qa.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
using Aqua, FastAlmostBandedMatrices, Test
2+
3+
@testset "Aqua Q/A" begin
4+
Aqua.test_all(FastAlmostBandedMatrices; ambiguities = false)
5+
end

test/runtests.jl

Lines changed: 110 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,118 @@
1+
using Pkg
12
using SafeTestsets, Test
23

3-
@testset "FastAlmostBandedMatrices" begin
4-
@safetestset "Constructors" begin
5-
using FastAlmostBandedMatrices
6-
7-
A = AlmostBandedMatrix{Float64}(undef, (10, 11), (2, 1), 2)
8-
A[1, 1] = 2
9-
@test A[1, 1] == 2.0
10-
A[4, 1] = 0
11-
@test A[4, 1] == 0.0
12-
@test_throws BandError A[4, 1] = 2
13-
A[1, 3] = 5
14-
@test A[1, 3] == 5.0
15-
16-
@test almostbandwidths(A) == (2, 1)
17-
@test almostbandedrank(A) == 2
18-
end
19-
20-
@safetestset "similar" begin
21-
using FastAlmostBandedMatrices
22-
23-
A = AlmostBandedMatrix(brand(Float64, 10, 10, 2, 1), rand(Float64, 2, 10))
24-
25-
@test similar(A) isa AlmostBandedMatrix
26-
@test similar(A, Float32) isa AlmostBandedMatrix{Float32}
27-
28-
fallback = similar(A, Float32, 10, 10)
29-
@test fallback isa Matrix{Float32}
30-
@test size(fallback) == size(A)
31-
end
32-
33-
@safetestset "Copy" begin
34-
using FastAlmostBandedMatrices
35-
36-
n = 5
37-
m = 2
38-
39-
A1 = AlmostBandedMatrix(brand(Float64, n, n, m + 1, m), rand(Float64, m, n))
40-
A2 = copy(A1)
41-
42-
@test !(A2 isa Matrix)
43-
@test A1 == A2
44-
45-
A2 = deepcopy(A1)
4+
const GROUP = get(ENV, "GROUP", "All")
465

47-
@test !(A2 isa Matrix)
48-
@test A1 == A2
49-
end
50-
51-
@safetestset "QR" begin
52-
using LinearAlgebra, FastAlmostBandedMatrices
53-
import MatrixFactorizations: QRPackedQ
54-
55-
n = 80
56-
A = AlmostBandedMatrix(BandedMatrix(fill(2.0, n, n), (1, 1)), fill(3.0, 2, n))
57-
A[band(0)] .+= 1:n
58-
= deepcopy(A)
59-
B, L = bandpart(A), fillpart(A)
60-
61-
F = qr(A)
62-
@test F.Q isa LinearAlgebra.QRPackedQ{Float64, <:BandedMatrix}
63-
@test F.R isa UpperTriangular{Float64, <:SubArray{Float64, 2, <:AlmostBandedMatrix}}
64-
@test F.Q' * A F.R
65-
@test A ==
66-
67-
@inferred qr(A)
68-
69-
b = randn(n)
70-
@test A \ b Matrix(A) \ b
71-
@test all(A \ b .=== F \ b)
72-
@test all(A \ b .=== F.R \ (F.Q' * b))
73-
= QRPackedQ(F.factors, F.τ)
74-
@test Matrix(Q̃) Matrix(F.Q)
75-
@test lmul!(Q̃, copy(b)) lmul!(F.Q, copy(b)) Matrix(F.Q) * b
76-
@test lmul!(Q̃', copy(b)) lmul!(F.Q', copy(b)) Matrix(F.Q)' * b
77-
end
78-
79-
@safetestset "Triangular" begin
80-
using LinearAlgebra, ArrayLayouts, FastAlmostBandedMatrices
81-
import FastAlmostBandedMatrices: AlmostBandedLayout
82-
83-
n = 80
84-
A = AlmostBandedMatrix(BandedMatrix(fill(2.0, n, n), (1, 1)), fill(3.0, 1, n))
85-
b = randn(n)
86-
@test MemoryLayout(UpperTriangular(A)) ==
87-
TriangularLayout{'U', 'N', AlmostBandedLayout}()
88-
@test_broken UpperTriangular(Matrix(A)) \ b UpperTriangular(A) \ b
89-
@test_broken UnitUpperTriangular(Matrix(A)) \ b UnitUpperTriangular(A) \ b
90-
@test LowerTriangular(Matrix(A)) \ b LowerTriangular(A) \ b
91-
@test UnitLowerTriangular(Matrix(A)) \ b UnitLowerTriangular(A) \ b
92-
end
93-
94-
@safetestset "Aqua Q/A" begin
95-
using Aqua, FastAlmostBandedMatrices
96-
97-
Aqua.test_all(FastAlmostBandedMatrices; ambiguities = false)
98-
end
99-
100-
# https://github.com/SciML/FastAlmostBandedMatrices.jl/issues/19
101-
@safetestset "fill! on sparse array with BigFloat" begin
102-
using FastAlmostBandedMatrices, SparseArrays
6+
if GROUP == "QA"
7+
Pkg.activate(joinpath(@__DIR__, "qa"))
8+
Pkg.develop(PackageSpec(path = joinpath(@__DIR__, "..")))
9+
Pkg.instantiate()
10+
include(joinpath(@__DIR__, "qa", "qa.jl"))
11+
end
10312

104-
A = sparse([1, 2], [1, 5], big.([1.0, 1.0]))
105-
A1 = AlmostBandedMatrix(brand(BigFloat, 5, 5, 1, 1), A)
106-
fill!(A1, BigFloat(0.0))
107-
@test length(A1.fill.nzval) == 2
13+
if GROUP == "Core" || GROUP == "All"
14+
@testset "FastAlmostBandedMatrices" begin
15+
@safetestset "Constructors" begin
16+
using FastAlmostBandedMatrices
17+
18+
A = AlmostBandedMatrix{Float64}(undef, (10, 11), (2, 1), 2)
19+
A[1, 1] = 2
20+
@test A[1, 1] == 2.0
21+
A[4, 1] = 0
22+
@test A[4, 1] == 0.0
23+
@test_throws BandError A[4, 1] = 2
24+
A[1, 3] = 5
25+
@test A[1, 3] == 5.0
26+
27+
@test almostbandwidths(A) == (2, 1)
28+
@test almostbandedrank(A) == 2
29+
end
30+
31+
@safetestset "similar" begin
32+
using FastAlmostBandedMatrices
33+
34+
A = AlmostBandedMatrix(brand(Float64, 10, 10, 2, 1), rand(Float64, 2, 10))
35+
36+
@test similar(A) isa AlmostBandedMatrix
37+
@test similar(A, Float32) isa AlmostBandedMatrix{Float32}
38+
39+
fallback = similar(A, Float32, 10, 10)
40+
@test fallback isa Matrix{Float32}
41+
@test size(fallback) == size(A)
42+
end
43+
44+
@safetestset "Copy" begin
45+
using FastAlmostBandedMatrices
46+
47+
n = 5
48+
m = 2
49+
50+
A1 = AlmostBandedMatrix(brand(Float64, n, n, m + 1, m), rand(Float64, m, n))
51+
A2 = copy(A1)
52+
53+
@test !(A2 isa Matrix)
54+
@test A1 == A2
55+
56+
A2 = deepcopy(A1)
57+
58+
@test !(A2 isa Matrix)
59+
@test A1 == A2
60+
end
61+
62+
@safetestset "QR" begin
63+
using LinearAlgebra, FastAlmostBandedMatrices
64+
import MatrixFactorizations: QRPackedQ
65+
66+
n = 80
67+
A = AlmostBandedMatrix(BandedMatrix(fill(2.0, n, n), (1, 1)), fill(3.0, 2, n))
68+
A[band(0)] .+= 1:n
69+
à = deepcopy(A)
70+
B, L = bandpart(A), fillpart(A)
71+
72+
F = qr(A)
73+
@test F.Q isa LinearAlgebra.QRPackedQ{Float64, <:BandedMatrix}
74+
@test F.R isa UpperTriangular{Float64, <:SubArray{Float64, 2, <:AlmostBandedMatrix}}
75+
@test F.Q' * A F.R
76+
@test A == Ã
77+
78+
@inferred qr(A)
79+
80+
b = randn(n)
81+
@test A \ b Matrix(A) \ b
82+
@test all(A \ b .=== F \ b)
83+
@test all(A \ b .=== F.R \ (F.Q' * b))
84+
= QRPackedQ(F.factors, F.τ)
85+
@test Matrix(Q̃) Matrix(F.Q)
86+
@test lmul!(Q̃, copy(b)) lmul!(F.Q, copy(b)) Matrix(F.Q) * b
87+
@test lmul!(Q̃', copy(b)) lmul!(F.Q', copy(b)) Matrix(F.Q)' * b
88+
end
89+
90+
@safetestset "Triangular" begin
91+
using LinearAlgebra, ArrayLayouts, FastAlmostBandedMatrices
92+
import FastAlmostBandedMatrices: AlmostBandedLayout
93+
94+
n = 80
95+
A = AlmostBandedMatrix(BandedMatrix(fill(2.0, n, n), (1, 1)), fill(3.0, 1, n))
96+
b = randn(n)
97+
@test MemoryLayout(UpperTriangular(A)) ==
98+
TriangularLayout{'U', 'N', AlmostBandedLayout}()
99+
@test_broken UpperTriangular(Matrix(A)) \ b UpperTriangular(A) \ b
100+
@test_broken UnitUpperTriangular(Matrix(A)) \ b UnitUpperTriangular(A) \ b
101+
@test LowerTriangular(Matrix(A)) \ b LowerTriangular(A) \ b
102+
@test UnitLowerTriangular(Matrix(A)) \ b UnitLowerTriangular(A) \ b
103+
end
104+
105+
# https://github.com/SciML/FastAlmostBandedMatrices.jl/issues/19
106+
@safetestset "fill! on sparse array with BigFloat" begin
107+
using FastAlmostBandedMatrices, SparseArrays
108+
109+
A = sparse([1, 2], [1, 5], big.([1.0, 1.0]))
110+
A1 = AlmostBandedMatrix(brand(BigFloat, 5, 5, 1, 1), A)
111+
fill!(A1, BigFloat(0.0))
112+
@test length(A1.fill.nzval) == 2
113+
end
108114
end
109-
end
110115

111-
# Allocation tests run separately to avoid precompilation interference
112-
if get(ENV, "GROUP", "all") == "all" || get(ENV, "GROUP", "all") == "nopre"
116+
# Allocation tests run separately to avoid precompilation interference
113117
include("alloc_tests.jl")
114118
end

test/test_groups.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[Core]
2+
versions = ["lts", "1", "pre"]
3+
os = ["ubuntu-latest", "macos-latest", "windows-latest"]
4+
num_threads = 11
5+
6+
[QA]
7+
versions = ["lts", "1"]

0 commit comments

Comments
 (0)