From e58bb516d22db83e0de96585e2ea25198e993d10 Mon Sep 17 00:00:00 2001 From: Jishnu Bhattacharya Date: Mon, 1 Dec 2025 22:39:55 +0530 Subject: [PATCH 1/2] Run tests in parallel --- Project.toml | 6 ++++-- test/runtests.jl | 39 ++++++++++++++++++++------------------- test/test_aqua.jl | 10 ++++++++++ test/test_cumsum.jl | 4 +++- test/test_layoutarray.jl | 6 +++--- 5 files changed, 40 insertions(+), 25 deletions(-) create mode 100644 test/test_aqua.jl diff --git a/Project.toml b/Project.toml index 8ea4c0b..6c0a89e 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ArrayLayouts" uuid = "4c555306-a7a7-4459-81d9-ec55ddd5c99a" -authors = ["Sheehan Olver "] version = "1.12.2" +authors = ["Sheehan Olver "] [deps] FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b" @@ -20,6 +20,7 @@ FillArrays = "1.2.1" Infinities = "0.1" JLArrays = "0.2" LinearAlgebra = "1" +ParallelTestRunner = "2" Quaternions = "0.7" Random = "1" SparseArrays = "1" @@ -32,6 +33,7 @@ julia = "1.10" Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" Infinities = "e1ba4f0e-776d-440f-acd9-e1d2e9742647" JLArrays = "27aeb0d3-9eb9-45fb-866b-73c2ecf80fcb" +ParallelTestRunner = "d3525ed8-44d0-4b2c-a655-542cee43accc" Quaternions = "94ee1d12-ae83-5a48-8b1c-48b8ff168ae0" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" @@ -39,4 +41,4 @@ StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Aqua", "Infinities", "JLArrays", "Quaternions", "Random", "StableRNGs", "SparseArrays", "Test"] +test = ["Aqua", "Infinities", "JLArrays", "ParallelTestRunner", "Quaternions", "Random", "StableRNGs", "SparseArrays", "Test"] diff --git a/test/runtests.jl b/test/runtests.jl index f3c625b..e05a573 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,27 +1,28 @@ module ArrayLayoutsTests import ArrayLayouts -import Aqua -import Random -using Test - -downstream_test = "--downstream_integration_test" in ARGS -@testset "Project quality" begin - Aqua.test_all(ArrayLayouts, - ambiguities = false, - piracies = (; broken=true), - stale_deps = !downstream_test, - ) +using ParallelTestRunner + +const init_code = quote + import Random + Random.seed!(0) +end + +# Start with autodiscovered tests +testsuite = find_tests(pwd()) + +if "--downstream_integration_test" in ARGS + delete!(testsuite, "test_aqua") end -Random.seed!(0) +filtered_args = filter(!=("--downstream_integration_test"), ARGS) +# Parse arguments +args = parse_args(filtered_args) + +if filter_tests!(testsuite, args) + delete!(testsuite, "infinitearrays") +end -include("infinitearrays.jl") -include("test_utils.jl") -include("test_layouts.jl") -include("test_muladd.jl") -include("test_ldiv.jl") -include("test_layoutarray.jl") -include("test_cumsum.jl") +runtests(ArrayLayouts, args; testsuite, init_code) end diff --git a/test/test_aqua.jl b/test/test_aqua.jl new file mode 100644 index 0000000..cfe6a77 --- /dev/null +++ b/test/test_aqua.jl @@ -0,0 +1,10 @@ +import Aqua +import ArrayLayouts +using Test + +@testset "Project quality" begin + Aqua.test_all(ArrayLayouts, + ambiguities = false, + piracies = (; broken=true), + ) +end \ No newline at end of file diff --git a/test/test_cumsum.jl b/test/test_cumsum.jl index 08ba552..7142218 100644 --- a/test/test_cumsum.jl +++ b/test/test_cumsum.jl @@ -1,7 +1,9 @@ module TestCumsum using ArrayLayouts, Test, Infinities -using ..InfiniteArrays + +include("infinitearrays.jl") +using .InfiniteArrays cmpop(p) = isinteger(real(first(p))) && isinteger(real(step(p))) ? (==) : (≈) diff --git a/test/test_layoutarray.jl b/test/test_layoutarray.jl index 7f1a4c9..cd8f4f3 100644 --- a/test/test_layoutarray.jl +++ b/test/test_layoutarray.jl @@ -6,6 +6,9 @@ import ArrayLayouts: triangulardata, MemoryLayout import LinearAlgebra: Diagonal, Bidiagonal, Tridiagonal, SymTridiagonal import Base.Broadcast: BroadcastStyle, AbstractArrayStyle +include("infinitearrays.jl") +using .InfiniteArrays + struct MyMatrix{T,M<:AbstractMatrix{T}} <: LayoutMatrix{T} A::M end @@ -706,9 +709,6 @@ triangulardata(A::MyUpperTriangular) = triangulardata(A.A) VERSION >= v"1.9" && @test U / MyMatrix(A) ≈ U / A end -# Tests needed for InfiniteRandomArrays.jl (see https://github.com/DanielVandH/InfiniteRandomArrays.jl/issues/5) -using ..InfiniteArrays - @testset "* for infinite layouts" begin tup = InfSymTridiagonal(), InfTridiagonal(), InfBidiagonal('U'), InfBidiagonal('L'), From 1d37e1d22041d6355b0f2a0bf65e05c2afaee12f Mon Sep 17 00:00:00 2001 From: Jishnu Bhattacharya Date: Mon, 1 Dec 2025 22:45:34 +0530 Subject: [PATCH 2/2] Wrap Aqua tests in a module --- test/test_aqua.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/test_aqua.jl b/test/test_aqua.jl index cfe6a77..572468c 100644 --- a/test/test_aqua.jl +++ b/test/test_aqua.jl @@ -1,3 +1,5 @@ +module AquaTests + import Aqua import ArrayLayouts using Test @@ -7,4 +9,6 @@ using Test ambiguities = false, piracies = (; broken=true), ) -end \ No newline at end of file +end + +end