Skip to content

Commit df19161

Browse files
authored
Run tests in parallel (#232)
* Run tests in parallel * Newlines * Test on min version * Fix deletion in testsuite
1 parent c2853f0 commit df19161

File tree

5 files changed

+30
-23
lines changed

5 files changed

+30
-23
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
fail-fast: false
2727
matrix:
2828
version:
29+
- 'min'
2930
- 'lts'
3031
- '1'
3132
os:

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Documenter = "1"
2525
FillArrays = "1"
2626
LinearAlgebra = "1"
2727
MatrixFactorizations = "1, 2, 3"
28+
ParallelTestRunner = "2"
2829
Random = "1"
2930
SparseArrays = "1"
3031
Test = "1"
@@ -33,9 +34,10 @@ julia = "1.10"
3334
[extras]
3435
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
3536
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
37+
ParallelTestRunner = "d3525ed8-44d0-4b2c-a655-542cee43accc"
3638
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
3739
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
3840
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
3941

4042
[targets]
41-
test = ["Aqua", "Random", "SparseArrays", "Test", "Documenter"]
43+
test = ["Aqua", "ParallelTestRunner", "Random", "SparseArrays", "Test", "Documenter"]

test/runtests.jl

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,20 @@
11
using BlockBandedMatrices
2-
using Test
2+
using ParallelTestRunner
33

4-
import Aqua
5-
downstream_test = "--downstream_integration_test" in ARGS
6-
@testset "Project quality" begin
7-
Aqua.test_all(BlockBandedMatrices, ambiguities=false, piracies=false,
8-
stale_deps=!downstream_test)
4+
const init_code = quote
5+
using Test
6+
using BlockBandedMatrices
97
end
108

11-
using Documenter
12-
@testset "docstrings" begin
13-
# don't test docstrings on old versions to avoid failures due to changes in types
14-
if VERSION >= v"1.9"
15-
DocMeta.setdocmeta!(BlockBandedMatrices, :DocTestSetup, :(using BlockBandedMatrices); recursive=true)
16-
doctest(BlockBandedMatrices)
17-
end
9+
# Start with autodiscovered tests
10+
testsuite = find_tests(pwd())
11+
12+
if "--downstream_integration_test" in ARGS
13+
delete!(testsuite, "test_aqua")
1814
end
1915

20-
include("test_blockbanded.jl")
21-
include("test_blockskyline.jl")
22-
include("test_bandedblockbanded.jl")
23-
include("test_broadcasting.jl")
24-
include("test_linalg.jl")
25-
include("test_misc.jl")
26-
include("test_triblockbanded.jl")
27-
include("test_adjtransblockbanded.jl")
28-
include("test_blockskylineqr.jl")
16+
filtered_args = filter(!=("--downstream_integration_test"), ARGS)
17+
# Parse arguments
18+
args = parse_args(filtered_args)
19+
20+
runtests(BlockBandedMatrices, args; init_code, testsuite)

test/test_aqua.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import Aqua
2+
@testset "Project quality" begin
3+
Aqua.test_all(BlockBandedMatrices, ambiguities=false, piracies=false)
4+
end

test/test_docstrings.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using Documenter
2+
@testset "docstrings" begin
3+
# don't test docstrings on old versions to avoid failures due to changes in types
4+
if VERSION >= v"1.9"
5+
DocMeta.setdocmeta!(BlockBandedMatrices, :DocTestSetup, :(using BlockBandedMatrices); recursive=true)
6+
doctest(BlockBandedMatrices)
7+
end
8+
end

0 commit comments

Comments
 (0)