diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d6112a8..be3bb3e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -18,10 +18,22 @@ jobs: strategy: fail-fast: false matrix: + # Only the root umbrella package's own test groups are listed here. + # The lib/* sublibraries are covered by SublibraryCI.yml (project model); + # they are intentionally not re-tested through the root matrix. + group: + - Core + - QA version: - - "1" - "lts" + - "1" + - "pre" + exclude: + # QA (explicit-imports check) does not need the pre-release Julia. + - group: QA + version: "pre" uses: "SciML/.github/.github/workflows/tests.yml@v1" with: julia-version: "${{ matrix.version }}" + group: "${{ matrix.group }}" secrets: "inherit" diff --git a/.github/workflows/Downgrade.yml b/.github/workflows/Downgrade.yml index 743ef8f..36d3b21 100644 --- a/.github/workflows/Downgrade.yml +++ b/.github/workflows/Downgrade.yml @@ -10,14 +10,13 @@ on: - master paths-ignore: - 'docs/**' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} jobs: downgrade: name: "Downgrade" - strategy: - matrix: - julia-version: ['1.10'] uses: "SciML/.github/.github/workflows/downgrade.yml@v1" with: - julia-version: "${{ matrix.julia-version }}" - skip: "Pkg,TOML" + group: "Core" secrets: "inherit" diff --git a/.github/workflows/DowngradeSublibraries.yml b/.github/workflows/DowngradeSublibraries.yml index 590a0e2..8cf4dab 100644 --- a/.github/workflows/DowngradeSublibraries.yml +++ b/.github/workflows/DowngradeSublibraries.yml @@ -18,5 +18,6 @@ jobs: uses: "SciML/.github/.github/workflows/sublibrary-downgrade.yml@v1" secrets: "inherit" with: - julia-version: "lts" - skip: "Pkg,TOML,Statistics,LinearAlgebra,SparseArrays,InteractiveUtils,Random,Test,Markdown" + group-env-name: "DIFFEQPROBLEMLIBRARY_TEST_GROUP" + group-env-value: "Core" + # Every lib/* sublibrary is downgrade-tested (projects auto-discovered, no exclusions). diff --git a/.github/workflows/Downstream.yml b/.github/workflows/Downstream.yml new file mode 100644 index 0000000..b25a5ea --- /dev/null +++ b/.github/workflows/Downstream.yml @@ -0,0 +1,53 @@ +name: IntegrationTest +on: + push: + branches: [master] + tags: [v*] + pull_request: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} +jobs: + test: + name: ${{ matrix.package.repo }}/${{ matrix.package.group }}/${{ matrix.julia-version }} + runs-on: ${{ matrix.os }} + env: + GROUP: ${{ matrix.package.group }} + strategy: + fail-fast: false + matrix: + julia-version: ['1.10'] + os: [ubuntu-latest] + package: + - {user: SciML, repo: DiffEqDevTools.jl, group: All} + - {user: SciML, repo: OrdinaryDiffEq.jl, group: Regression_I} + steps: + - uses: actions/checkout@v6 + - uses: julia-actions/setup-julia@v3 + with: + version: ${{ matrix.julia-version }} + arch: x64 + - name: Clone Downstream + uses: actions/checkout@v6 + with: + repository: ${{ matrix.package.user }}/${{ matrix.package.repo }} + path: downstream + - name: Load this and run the downstream tests + shell: julia --color=yes --project=downstream {0} + run: | + using Pkg + try + Pkg.develop(map(path ->Pkg.PackageSpec.(;path="lib/$(path)"), readdir("./lib"))); + Pkg.test(coverage=true) + catch err + err isa Pkg.Resolve.ResolverError || rethrow() + @info "Not compatible with this release. No problem." exception=err + exit(0) + end + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v6 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: lcov.info + fail_ci_if_error: false + disable_safe_directory: true diff --git a/.github/workflows/SublibraryCI.yml b/.github/workflows/SublibraryCI.yml index 6cec66b..6e62171 100644 --- a/.github/workflows/SublibraryCI.yml +++ b/.github/workflows/SublibraryCI.yml @@ -19,4 +19,7 @@ concurrency: jobs: sublibraries: uses: "SciML/.github/.github/workflows/sublibrary-project-tests.yml@v1" + with: + group-env-name: DIFFEQPROBLEMLIBRARY_TEST_GROUP + check-bounds: auto secrets: "inherit" diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml index f49313b..5b9ed11 100644 --- a/.github/workflows/TagBot.yml +++ b/.github/workflows/TagBot.yml @@ -1,15 +1,26 @@ -name: TagBot +name: "TagBot" on: issue_comment: - types: - - created + types: [created] workflow_dispatch: jobs: - TagBot: - if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' - runs-on: ubuntu-latest - steps: - - uses: JuliaRegistries/TagBot@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - ssh: ${{ secrets.DOCUMENTER_KEY }} + tagbot: + uses: "SciML/.github/.github/workflows/tagbot.yml@v1" + secrets: "inherit" + + tagbot-subpackages: + strategy: + fail-fast: false + matrix: + subdir: + - "lib/BVProblemLibrary" + - "lib/DAEProblemLibrary" + - "lib/DDEProblemLibrary" + - "lib/JumpProblemLibrary" + - "lib/NonlinearProblemLibrary" + - "lib/ODEProblemLibrary" + - "lib/SDEProblemLibrary" + uses: "SciML/.github/.github/workflows/tagbot.yml@v1" + with: + subdir: "${{ matrix.subdir }}" + secrets: "inherit" diff --git a/Project.toml b/Project.toml index 57756a0..84bf407 100644 --- a/Project.toml +++ b/Project.toml @@ -12,6 +12,15 @@ NonlinearProblemLibrary = "b7050fa9-e91f-4b37-bcee-a89a063da141" ODEProblemLibrary = "fdc4e326-1af4-4b90-96e7-779fcce2daa5" SDEProblemLibrary = "c72e72a9-a271-4b2b-8966-303ed956772e" +[sources] +BVProblemLibrary = {path = "lib/BVProblemLibrary"} +DAEProblemLibrary = {path = "lib/DAEProblemLibrary"} +DDEProblemLibrary = {path = "lib/DDEProblemLibrary"} +JumpProblemLibrary = {path = "lib/JumpProblemLibrary"} +NonlinearProblemLibrary = {path = "lib/NonlinearProblemLibrary"} +ODEProblemLibrary = {path = "lib/ODEProblemLibrary"} +SDEProblemLibrary = {path = "lib/SDEProblemLibrary"} + [compat] BVProblemLibrary = "0.1" DAEProblemLibrary = "0.1" @@ -19,12 +28,15 @@ DDEProblemLibrary = "0.1" JumpProblemLibrary = "1, 2.0" NonlinearProblemLibrary = "0.1" ODEProblemLibrary = "1" +SafeTestsets = "0.1" SDEProblemLibrary = "1" +Test = "1.10" julia = "1.10" [extras] -ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["ExplicitImports", "Test"] +test = ["Pkg", "SafeTestsets", "Test"] diff --git a/lib/BVProblemLibrary/LICENSE b/lib/BVProblemLibrary/LICENSE.md similarity index 100% rename from lib/BVProblemLibrary/LICENSE rename to lib/BVProblemLibrary/LICENSE.md diff --git a/lib/BVProblemLibrary/Project.toml b/lib/BVProblemLibrary/Project.toml index b685b91..c6718eb 100644 --- a/lib/BVProblemLibrary/Project.toml +++ b/lib/BVProblemLibrary/Project.toml @@ -8,14 +8,17 @@ Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a" SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" [compat] -Aqua = "0.8" DiffEqBase = "6, 7" Markdown = "1.10" +SafeTestsets = "0.1" SpecialFunctions = "2.3" +Test = "1.10" julia = "1.10" [extras] -Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Aqua"] +test = ["Pkg", "SafeTestsets", "Test"] diff --git a/lib/BVProblemLibrary/README.md b/lib/BVProblemLibrary/README.md new file mode 100644 index 0000000..cbe383b --- /dev/null +++ b/lib/BVProblemLibrary/README.md @@ -0,0 +1,10 @@ +# BVProblemLibrary.jl + +[![Join the chat at https://julialang.zulipchat.com #sciml-bridged](https://img.shields.io/static/v1?label=Zulip&message=chat&color=9558b2&labelColor=389826)](https://julialang.zulipchat.com/#narrow/stream/279055-sciml-bridged) +[![Global Docs](https://img.shields.io/badge/docs-SciML-blue.svg)](https://docs.sciml.ai/DiffEqDocs/stable/) + +[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor%27s%20Guide-blueviolet)](https://github.com/SciML/ColPrac) +[![SciML Code Style](https://img.shields.io/static/v1?label=code%20style&message=SciML&color=9558b2&labelColor=389826)](https://github.com/SciML/SciMLStyle) + +BVProblemLibrary.jl is a component of the [DiffEqProblemLibrary.jl](https://github.com/SciML/DiffEqProblemLibrary.jl) monorepo. A library of premade boundary value problems (BVProblems) for testing and benchmarking boundary value differential equation solvers. +While completely independent and usable on its own, users wanting the full set of premade differential equation problems should use [DiffEqProblemLibrary.jl](https://github.com/SciML/DiffEqProblemLibrary.jl). diff --git a/lib/BVProblemLibrary/test/qa/Project.toml b/lib/BVProblemLibrary/test/qa/Project.toml new file mode 100644 index 0000000..3b6a6c9 --- /dev/null +++ b/lib/BVProblemLibrary/test/qa/Project.toml @@ -0,0 +1,13 @@ +[deps] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +BVProblemLibrary = "ded0fc24-dfea-4565-b1d9-79c027d14d84" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[sources] +BVProblemLibrary = {path = "../.."} + +[compat] +Aqua = "0.8" +BVProblemLibrary = "0.1" +Test = "1.10" +julia = "1.10" diff --git a/lib/BVProblemLibrary/test/qa/qa.jl b/lib/BVProblemLibrary/test/qa/qa.jl new file mode 100644 index 0000000..36a36a3 --- /dev/null +++ b/lib/BVProblemLibrary/test/qa/qa.jl @@ -0,0 +1,6 @@ +using BVProblemLibrary +using Aqua + +@testset "Aqua" begin + Aqua.test_all(BVProblemLibrary; ambiguities = false) +end diff --git a/lib/BVProblemLibrary/test/runtests.jl b/lib/BVProblemLibrary/test/runtests.jl index fabf5d5..0821ce9 100644 --- a/lib/BVProblemLibrary/test/runtests.jl +++ b/lib/BVProblemLibrary/test/runtests.jl @@ -1,8 +1,24 @@ -# The test is simply that all of the examples build! +using Pkg using BVProblemLibrary +using SafeTestsets, Test -# Check that there are no undefined exports, stale dependencies, etc. -# Ambiguity checks are disabled since tests fail due to ambiguities -# in dependencies -using Aqua -Aqua.test_all(BVProblemLibrary; ambiguities = false) +const TEST_GROUP = get(ENV, "DIFFEQPROBLEMLIBRARY_TEST_GROUP", "All") + +function activate_qa_env() + Pkg.activate(joinpath(@__DIR__, "qa")) + return Pkg.instantiate() +end + +# The Core test is simply that all of the examples build (load the module). +if TEST_GROUP == "Core" || TEST_GROUP == "All" + @time @testset "Load Tests" begin + @test BVProblemLibrary isa Module + end +end + +# Quality assurance: no undefined exports, stale dependencies, etc. +# Ambiguity checks are disabled since tests fail due to ambiguities in dependencies. +if TEST_GROUP == "QA" || TEST_GROUP == "All" + activate_qa_env() + @time @safetestset "Aqua" include("qa/qa.jl") +end diff --git a/lib/BVProblemLibrary/test/test_groups.toml b/lib/BVProblemLibrary/test/test_groups.toml new file mode 100644 index 0000000..1fe84cd --- /dev/null +++ b/lib/BVProblemLibrary/test/test_groups.toml @@ -0,0 +1,5 @@ +[Core] +versions = ["lts", "1", "pre"] + +[QA] +versions = ["lts", "1"] diff --git a/lib/DAEProblemLibrary/LICENSE b/lib/DAEProblemLibrary/LICENSE.md similarity index 100% rename from lib/DAEProblemLibrary/LICENSE rename to lib/DAEProblemLibrary/LICENSE.md diff --git a/lib/DAEProblemLibrary/Project.toml b/lib/DAEProblemLibrary/Project.toml index 1fc77af..1492602 100644 --- a/lib/DAEProblemLibrary/Project.toml +++ b/lib/DAEProblemLibrary/Project.toml @@ -7,13 +7,16 @@ DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e" Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a" [compat] -Aqua = "0.8" DiffEqBase = "6, 7" Markdown = "1.10" +SafeTestsets = "0.1" +Test = "1.10" julia = "1.10" [extras] -Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Aqua"] +test = ["Pkg", "SafeTestsets", "Test"] diff --git a/lib/DAEProblemLibrary/README.md b/lib/DAEProblemLibrary/README.md new file mode 100644 index 0000000..77a9b50 --- /dev/null +++ b/lib/DAEProblemLibrary/README.md @@ -0,0 +1,10 @@ +# DAEProblemLibrary.jl + +[![Join the chat at https://julialang.zulipchat.com #sciml-bridged](https://img.shields.io/static/v1?label=Zulip&message=chat&color=9558b2&labelColor=389826)](https://julialang.zulipchat.com/#narrow/stream/279055-sciml-bridged) +[![Global Docs](https://img.shields.io/badge/docs-SciML-blue.svg)](https://docs.sciml.ai/DiffEqDocs/stable/) + +[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor%27s%20Guide-blueviolet)](https://github.com/SciML/ColPrac) +[![SciML Code Style](https://img.shields.io/static/v1?label=code%20style&message=SciML&color=9558b2&labelColor=389826)](https://github.com/SciML/SciMLStyle) + +DAEProblemLibrary.jl is a component of the [DiffEqProblemLibrary.jl](https://github.com/SciML/DiffEqProblemLibrary.jl) monorepo. A library of premade differential-algebraic equation problems (DAEProblems) for testing and benchmarking DAE solvers. +While completely independent and usable on its own, users wanting the full set of premade differential equation problems should use [DiffEqProblemLibrary.jl](https://github.com/SciML/DiffEqProblemLibrary.jl). diff --git a/lib/DAEProblemLibrary/test/qa/Project.toml b/lib/DAEProblemLibrary/test/qa/Project.toml new file mode 100644 index 0000000..5883ba1 --- /dev/null +++ b/lib/DAEProblemLibrary/test/qa/Project.toml @@ -0,0 +1,13 @@ +[deps] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +DAEProblemLibrary = "dfb8ca35-80a1-48ba-a605-84916a45b4f8" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[sources] +DAEProblemLibrary = {path = "../.."} + +[compat] +Aqua = "0.8" +DAEProblemLibrary = "0.1" +Test = "1.10" +julia = "1.10" diff --git a/lib/DAEProblemLibrary/test/qa/qa.jl b/lib/DAEProblemLibrary/test/qa/qa.jl new file mode 100644 index 0000000..0bb41bc --- /dev/null +++ b/lib/DAEProblemLibrary/test/qa/qa.jl @@ -0,0 +1,6 @@ +using DAEProblemLibrary +using Aqua + +@testset "Aqua" begin + Aqua.test_all(DAEProblemLibrary; ambiguities = false) +end diff --git a/lib/DAEProblemLibrary/test/runtests.jl b/lib/DAEProblemLibrary/test/runtests.jl index bc4d71f..0d470a9 100644 --- a/lib/DAEProblemLibrary/test/runtests.jl +++ b/lib/DAEProblemLibrary/test/runtests.jl @@ -1,8 +1,24 @@ -# The test is simply that all of the examples build! +using Pkg using DAEProblemLibrary +using SafeTestsets, Test -# Check that there are no undefined exports, stale dependencies, etc. -# Ambiguity checks are disabled since tests fail due to ambiguities -# in dependencies -using Aqua -Aqua.test_all(DAEProblemLibrary; ambiguities = false) +const TEST_GROUP = get(ENV, "DIFFEQPROBLEMLIBRARY_TEST_GROUP", "All") + +function activate_qa_env() + Pkg.activate(joinpath(@__DIR__, "qa")) + return Pkg.instantiate() +end + +# The Core test is simply that all of the examples build (load the module). +if TEST_GROUP == "Core" || TEST_GROUP == "All" + @time @testset "Load Tests" begin + @test DAEProblemLibrary isa Module + end +end + +# Quality assurance: no undefined exports, stale dependencies, etc. +# Ambiguity checks are disabled since tests fail due to ambiguities in dependencies. +if TEST_GROUP == "QA" || TEST_GROUP == "All" + activate_qa_env() + @time @safetestset "Aqua" include("qa/qa.jl") +end diff --git a/lib/DAEProblemLibrary/test/test_groups.toml b/lib/DAEProblemLibrary/test/test_groups.toml new file mode 100644 index 0000000..1fe84cd --- /dev/null +++ b/lib/DAEProblemLibrary/test/test_groups.toml @@ -0,0 +1,5 @@ +[Core] +versions = ["lts", "1", "pre"] + +[QA] +versions = ["lts", "1"] diff --git a/lib/DDEProblemLibrary/LICENSE b/lib/DDEProblemLibrary/LICENSE.md similarity index 100% rename from lib/DDEProblemLibrary/LICENSE rename to lib/DDEProblemLibrary/LICENSE.md diff --git a/lib/DDEProblemLibrary/Project.toml b/lib/DDEProblemLibrary/Project.toml index 1a3cfcc..6621d19 100644 --- a/lib/DDEProblemLibrary/Project.toml +++ b/lib/DDEProblemLibrary/Project.toml @@ -6,12 +6,15 @@ version = "0.1.5" DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e" [compat] -Aqua = "0.8" DiffEqBase = "6, 7" +SafeTestsets = "0.1" +Test = "1.10" julia = "1.10" [extras] -Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Aqua"] +test = ["Pkg", "SafeTestsets", "Test"] diff --git a/lib/DDEProblemLibrary/README.md b/lib/DDEProblemLibrary/README.md new file mode 100644 index 0000000..dd2d821 --- /dev/null +++ b/lib/DDEProblemLibrary/README.md @@ -0,0 +1,10 @@ +# DDEProblemLibrary.jl + +[![Join the chat at https://julialang.zulipchat.com #sciml-bridged](https://img.shields.io/static/v1?label=Zulip&message=chat&color=9558b2&labelColor=389826)](https://julialang.zulipchat.com/#narrow/stream/279055-sciml-bridged) +[![Global Docs](https://img.shields.io/badge/docs-SciML-blue.svg)](https://docs.sciml.ai/DiffEqDocs/stable/) + +[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor%27s%20Guide-blueviolet)](https://github.com/SciML/ColPrac) +[![SciML Code Style](https://img.shields.io/static/v1?label=code%20style&message=SciML&color=9558b2&labelColor=389826)](https://github.com/SciML/SciMLStyle) + +DDEProblemLibrary.jl is a component of the [DiffEqProblemLibrary.jl](https://github.com/SciML/DiffEqProblemLibrary.jl) monorepo. A library of premade delay differential equation problems (DDEProblems) for testing and benchmarking delay differential equation solvers. +While completely independent and usable on its own, users wanting the full set of premade differential equation problems should use [DiffEqProblemLibrary.jl](https://github.com/SciML/DiffEqProblemLibrary.jl). diff --git a/lib/DDEProblemLibrary/test/qa/Project.toml b/lib/DDEProblemLibrary/test/qa/Project.toml new file mode 100644 index 0000000..233d74a --- /dev/null +++ b/lib/DDEProblemLibrary/test/qa/Project.toml @@ -0,0 +1,13 @@ +[deps] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +DDEProblemLibrary = "f42792ee-6ffc-4e2a-ae83-8ee2f22de800" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[sources] +DDEProblemLibrary = {path = "../.."} + +[compat] +Aqua = "0.8" +DDEProblemLibrary = "0.1" +Test = "1.10" +julia = "1.10" diff --git a/lib/DDEProblemLibrary/test/qa/qa.jl b/lib/DDEProblemLibrary/test/qa/qa.jl new file mode 100644 index 0000000..ce167c0 --- /dev/null +++ b/lib/DDEProblemLibrary/test/qa/qa.jl @@ -0,0 +1,6 @@ +using DDEProblemLibrary +using Aqua + +@testset "Aqua" begin + Aqua.test_all(DDEProblemLibrary; ambiguities = false) +end diff --git a/lib/DDEProblemLibrary/test/runtests.jl b/lib/DDEProblemLibrary/test/runtests.jl index 6b2280d..f69ce74 100644 --- a/lib/DDEProblemLibrary/test/runtests.jl +++ b/lib/DDEProblemLibrary/test/runtests.jl @@ -1,8 +1,24 @@ -# The main test is simply that all of the examples build! +using Pkg using DDEProblemLibrary +using SafeTestsets, Test -# Check that there are no undefined exports, stale dependencies, etc. -# Ambiguity checks are disabled since tests fail due to ambiguities -# in dependencies -using Aqua -Aqua.test_all(DDEProblemLibrary; ambiguities = false) +const TEST_GROUP = get(ENV, "DIFFEQPROBLEMLIBRARY_TEST_GROUP", "All") + +function activate_qa_env() + Pkg.activate(joinpath(@__DIR__, "qa")) + return Pkg.instantiate() +end + +# The Core test is simply that all of the examples build (load the module). +if TEST_GROUP == "Core" || TEST_GROUP == "All" + @time @testset "Load Tests" begin + @test DDEProblemLibrary isa Module + end +end + +# Quality assurance: no undefined exports, stale dependencies, etc. +# Ambiguity checks are disabled since tests fail due to ambiguities in dependencies. +if TEST_GROUP == "QA" || TEST_GROUP == "All" + activate_qa_env() + @time @safetestset "Aqua" include("qa/qa.jl") +end diff --git a/lib/DDEProblemLibrary/test/test_groups.toml b/lib/DDEProblemLibrary/test/test_groups.toml new file mode 100644 index 0000000..1fe84cd --- /dev/null +++ b/lib/DDEProblemLibrary/test/test_groups.toml @@ -0,0 +1,5 @@ +[Core] +versions = ["lts", "1", "pre"] + +[QA] +versions = ["lts", "1"] diff --git a/lib/JumpProblemLibrary/LICENSE b/lib/JumpProblemLibrary/LICENSE.md similarity index 100% rename from lib/JumpProblemLibrary/LICENSE rename to lib/JumpProblemLibrary/LICENSE.md diff --git a/lib/JumpProblemLibrary/Project.toml b/lib/JumpProblemLibrary/Project.toml index 9c9e90a..f595ccd 100644 --- a/lib/JumpProblemLibrary/Project.toml +++ b/lib/JumpProblemLibrary/Project.toml @@ -7,13 +7,16 @@ Catalyst = "479239e8-5488-4da2-87a7-35f2df7eef83" RuntimeGeneratedFunctions = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47" [compat] -Aqua = "0.8" Catalyst = "16" RuntimeGeneratedFunctions = "0.5" +SafeTestsets = "0.1" +Test = "1.10" julia = "1.10" [extras] -Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Aqua"] +test = ["Pkg", "SafeTestsets", "Test"] diff --git a/lib/JumpProblemLibrary/README.md b/lib/JumpProblemLibrary/README.md new file mode 100644 index 0000000..5e3f41d --- /dev/null +++ b/lib/JumpProblemLibrary/README.md @@ -0,0 +1,10 @@ +# JumpProblemLibrary.jl + +[![Join the chat at https://julialang.zulipchat.com #sciml-bridged](https://img.shields.io/static/v1?label=Zulip&message=chat&color=9558b2&labelColor=389826)](https://julialang.zulipchat.com/#narrow/stream/279055-sciml-bridged) +[![Global Docs](https://img.shields.io/badge/docs-SciML-blue.svg)](https://docs.sciml.ai/DiffEqDocs/stable/) + +[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor%27s%20Guide-blueviolet)](https://github.com/SciML/ColPrac) +[![SciML Code Style](https://img.shields.io/static/v1?label=code%20style&message=SciML&color=9558b2&labelColor=389826)](https://github.com/SciML/SciMLStyle) + +JumpProblemLibrary.jl is a component of the [DiffEqProblemLibrary.jl](https://github.com/SciML/DiffEqProblemLibrary.jl) monorepo. A library of premade jump process / reaction network problems for testing and benchmarking jump and Gillespie solvers. +While completely independent and usable on its own, users wanting the full set of premade differential equation problems should use [DiffEqProblemLibrary.jl](https://github.com/SciML/DiffEqProblemLibrary.jl). diff --git a/lib/JumpProblemLibrary/test/qa/Project.toml b/lib/JumpProblemLibrary/test/qa/Project.toml new file mode 100644 index 0000000..4d15c00 --- /dev/null +++ b/lib/JumpProblemLibrary/test/qa/Project.toml @@ -0,0 +1,13 @@ +[deps] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +JumpProblemLibrary = "faf0f6d7-8cee-47cb-b27c-1eb80cef534e" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[sources] +JumpProblemLibrary = {path = "../.."} + +[compat] +Aqua = "0.8" +JumpProblemLibrary = "2" +Test = "1.10" +julia = "1.10" diff --git a/lib/JumpProblemLibrary/test/qa/qa.jl b/lib/JumpProblemLibrary/test/qa/qa.jl new file mode 100644 index 0000000..3d703ee --- /dev/null +++ b/lib/JumpProblemLibrary/test/qa/qa.jl @@ -0,0 +1,6 @@ +using JumpProblemLibrary +using Aqua + +@testset "Aqua" begin + Aqua.test_all(JumpProblemLibrary; ambiguities = false, persistent_tasks = false) +end diff --git a/lib/JumpProblemLibrary/test/runtests.jl b/lib/JumpProblemLibrary/test/runtests.jl index 044e97a..9fbaaf7 100644 --- a/lib/JumpProblemLibrary/test/runtests.jl +++ b/lib/JumpProblemLibrary/test/runtests.jl @@ -1,8 +1,24 @@ -# The test is simply that all of the examples build! +using Pkg using JumpProblemLibrary +using SafeTestsets, Test -# Check that there are no undefined exports, stale dependencies, etc. -# Ambiguity checks are disabled since tests fail due to ambiguities -# in dependencies -using Aqua -Aqua.test_all(JumpProblemLibrary; ambiguities = false, persistent_tasks = false) +const TEST_GROUP = get(ENV, "DIFFEQPROBLEMLIBRARY_TEST_GROUP", "All") + +function activate_qa_env() + Pkg.activate(joinpath(@__DIR__, "qa")) + return Pkg.instantiate() +end + +# The Core test is simply that all of the examples build (load the module). +if TEST_GROUP == "Core" || TEST_GROUP == "All" + @time @testset "Load Tests" begin + @test JumpProblemLibrary isa Module + end +end + +# Quality assurance: no undefined exports, stale dependencies, etc. +# Ambiguity checks are disabled since tests fail due to ambiguities in dependencies. +if TEST_GROUP == "QA" || TEST_GROUP == "All" + activate_qa_env() + @time @safetestset "Aqua" include("qa/qa.jl") +end diff --git a/lib/JumpProblemLibrary/test/test_groups.toml b/lib/JumpProblemLibrary/test/test_groups.toml new file mode 100644 index 0000000..1fe84cd --- /dev/null +++ b/lib/JumpProblemLibrary/test/test_groups.toml @@ -0,0 +1,5 @@ +[Core] +versions = ["lts", "1", "pre"] + +[QA] +versions = ["lts", "1"] diff --git a/lib/NonlinearProblemLibrary/LICENSE b/lib/NonlinearProblemLibrary/LICENSE.md similarity index 100% rename from lib/NonlinearProblemLibrary/LICENSE rename to lib/NonlinearProblemLibrary/LICENSE.md diff --git a/lib/NonlinearProblemLibrary/Project.toml b/lib/NonlinearProblemLibrary/Project.toml index 0689990..bc377fc 100644 --- a/lib/NonlinearProblemLibrary/Project.toml +++ b/lib/NonlinearProblemLibrary/Project.toml @@ -7,17 +7,16 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462" [compat] -AllocCheck = "0.2" -Aqua = "0.8" LinearAlgebra = "1.6" +SafeTestsets = "0.1" SciMLBase = "2, 3" Test = "1" julia = "1.10" [extras] -AllocCheck = "9b6a8646-10ed-4001-bbdc-1d2f46dfbb1a" -Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["AllocCheck", "Aqua", "Test"] +test = ["Pkg", "SafeTestsets", "Test"] diff --git a/lib/NonlinearProblemLibrary/README.md b/lib/NonlinearProblemLibrary/README.md new file mode 100644 index 0000000..7b79f56 --- /dev/null +++ b/lib/NonlinearProblemLibrary/README.md @@ -0,0 +1,10 @@ +# NonlinearProblemLibrary.jl + +[![Join the chat at https://julialang.zulipchat.com #sciml-bridged](https://img.shields.io/static/v1?label=Zulip&message=chat&color=9558b2&labelColor=389826)](https://julialang.zulipchat.com/#narrow/stream/279055-sciml-bridged) +[![Global Docs](https://img.shields.io/badge/docs-SciML-blue.svg)](https://docs.sciml.ai/DiffEqDocs/stable/) + +[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor%27s%20Guide-blueviolet)](https://github.com/SciML/ColPrac) +[![SciML Code Style](https://img.shields.io/static/v1?label=code%20style&message=SciML&color=9558b2&labelColor=389826)](https://github.com/SciML/SciMLStyle) + +NonlinearProblemLibrary.jl is a component of the [DiffEqProblemLibrary.jl](https://github.com/SciML/DiffEqProblemLibrary.jl) monorepo. A library of premade nonlinear systems (NonlinearProblems) for testing and benchmarking nonlinear solvers. +While completely independent and usable on its own, users wanting the full set of premade differential equation problems should use [DiffEqProblemLibrary.jl](https://github.com/SciML/DiffEqProblemLibrary.jl). diff --git a/lib/NonlinearProblemLibrary/test/qa/Project.toml b/lib/NonlinearProblemLibrary/test/qa/Project.toml new file mode 100644 index 0000000..5ee5061 --- /dev/null +++ b/lib/NonlinearProblemLibrary/test/qa/Project.toml @@ -0,0 +1,15 @@ +[deps] +AllocCheck = "9b6a8646-10ed-4001-bbdc-1d2f46dfbb1a" +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +NonlinearProblemLibrary = "b7050fa9-e91f-4b37-bcee-a89a063da141" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[sources] +NonlinearProblemLibrary = {path = "../.."} + +[compat] +AllocCheck = "0.2" +Aqua = "0.8" +NonlinearProblemLibrary = "0.1" +Test = "1" +julia = "1.10" diff --git a/lib/NonlinearProblemLibrary/test/qa/allocation_tests.jl b/lib/NonlinearProblemLibrary/test/qa/allocation_tests.jl new file mode 100644 index 0000000..8b27dbf --- /dev/null +++ b/lib/NonlinearProblemLibrary/test/qa/allocation_tests.jl @@ -0,0 +1,34 @@ +using NonlinearProblemLibrary +using AllocCheck +using Test + +@testset "Allocation Tests" begin + # Test p23_f! (Chandrasekhar function) - the fixed function + @testset "p23_f! zero allocations" begin + x = ones(10) + out = zeros(10) + # Warmup + NonlinearProblemLibrary.p23_f!(out, x) + # Test + allocs = @allocated NonlinearProblemLibrary.p23_f!(out, x) + @test allocs == 0 + end + + # Test other key functions + @testset "p1_f! zero allocations" begin + x = ones(10) + x[1] = -1.2 + out = zeros(10) + NonlinearProblemLibrary.p1_f!(out, x) + allocs = @allocated NonlinearProblemLibrary.p1_f!(out, x) + @test allocs == 0 + end + + @testset "p2_f! zero allocations" begin + x = [3.0, -1.0, 0.0, 1.0] + out = zeros(4) + NonlinearProblemLibrary.p2_f!(out, x) + allocs = @allocated NonlinearProblemLibrary.p2_f!(out, x) + @test allocs == 0 + end +end diff --git a/lib/NonlinearProblemLibrary/test/qa/qa.jl b/lib/NonlinearProblemLibrary/test/qa/qa.jl new file mode 100644 index 0000000..5274826 --- /dev/null +++ b/lib/NonlinearProblemLibrary/test/qa/qa.jl @@ -0,0 +1,6 @@ +using NonlinearProblemLibrary +using Aqua + +@testset "Aqua" begin + Aqua.test_all(NonlinearProblemLibrary; ambiguities = false) +end diff --git a/lib/NonlinearProblemLibrary/test/runtests.jl b/lib/NonlinearProblemLibrary/test/runtests.jl index 9fe5dbc..e58a5c2 100644 --- a/lib/NonlinearProblemLibrary/test/runtests.jl +++ b/lib/NonlinearProblemLibrary/test/runtests.jl @@ -1,45 +1,26 @@ -# The test is simply that all of the examples build! +using Pkg using NonlinearProblemLibrary -using Test +using SafeTestsets, Test -# Check that there are no undefined exports, stale dependencies, etc. -# Ambiguity checks are disabled since tests fail due to ambiguities -# in dependencies -using Aqua -Aqua.test_all(NonlinearProblemLibrary; ambiguities = false) +const TEST_GROUP = get(ENV, "DIFFEQPROBLEMLIBRARY_TEST_GROUP", "All") -# Allocation tests - ensure key functions don't allocate -if get(ENV, "GROUP", "all") == "all" || get(ENV, "GROUP", "all") == "nopre" - @testset "Allocation Tests" begin - using AllocCheck - - # Test p23_f! (Chandrasekhar function) - the fixed function - @testset "p23_f! zero allocations" begin - x = ones(10) - out = zeros(10) - # Warmup - NonlinearProblemLibrary.p23_f!(out, x) - # Test - allocs = @allocated NonlinearProblemLibrary.p23_f!(out, x) - @test allocs == 0 - end - - # Test other key functions - @testset "p1_f! zero allocations" begin - x = ones(10) - x[1] = -1.2 - out = zeros(10) - NonlinearProblemLibrary.p1_f!(out, x) - allocs = @allocated NonlinearProblemLibrary.p1_f!(out, x) - @test allocs == 0 - end +function activate_qa_env() + Pkg.activate(joinpath(@__DIR__, "qa")) + return Pkg.instantiate() +end - @testset "p2_f! zero allocations" begin - x = [3.0, -1.0, 0.0, 1.0] - out = zeros(4) - NonlinearProblemLibrary.p2_f!(out, x) - allocs = @allocated NonlinearProblemLibrary.p2_f!(out, x) - @test allocs == 0 - end +if TEST_GROUP == "Core" || TEST_GROUP == "All" + @time @testset "Load Tests" begin + @test NonlinearProblemLibrary isa Module end end + +# Quality assurance: allocation checks (AllocCheck), then no undefined exports, +# stale dependencies, etc. (Aqua). These run in the isolated test/qa environment +# so the heavy tooling stays out of the main test env. Ambiguity checks are +# disabled since tests fail due to ambiguities in dependencies. +if TEST_GROUP == "QA" || TEST_GROUP == "All" + activate_qa_env() + @time @safetestset "Allocation Tests" include("qa/allocation_tests.jl") + @time @safetestset "Aqua" include("qa/qa.jl") +end diff --git a/lib/NonlinearProblemLibrary/test/test_groups.toml b/lib/NonlinearProblemLibrary/test/test_groups.toml new file mode 100644 index 0000000..1fe84cd --- /dev/null +++ b/lib/NonlinearProblemLibrary/test/test_groups.toml @@ -0,0 +1,5 @@ +[Core] +versions = ["lts", "1", "pre"] + +[QA] +versions = ["lts", "1"] diff --git a/lib/ODEProblemLibrary/LICENSE b/lib/ODEProblemLibrary/LICENSE.md similarity index 100% rename from lib/ODEProblemLibrary/LICENSE rename to lib/ODEProblemLibrary/LICENSE.md diff --git a/lib/ODEProblemLibrary/Project.toml b/lib/ODEProblemLibrary/Project.toml index 452f0b5..7d70379 100644 --- a/lib/ODEProblemLibrary/Project.toml +++ b/lib/ODEProblemLibrary/Project.toml @@ -9,15 +9,18 @@ Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" [compat] -Aqua = "0.8" DiffEqBase = "6, 7" LinearAlgebra = "1.10" Markdown = "1.10" Random = "1.10" +SafeTestsets = "0.1" +Test = "1.10" julia = "1.10" [extras] -Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Aqua"] +test = ["Pkg", "SafeTestsets", "Test"] diff --git a/lib/ODEProblemLibrary/README.md b/lib/ODEProblemLibrary/README.md new file mode 100644 index 0000000..69c4aa1 --- /dev/null +++ b/lib/ODEProblemLibrary/README.md @@ -0,0 +1,10 @@ +# ODEProblemLibrary.jl + +[![Join the chat at https://julialang.zulipchat.com #sciml-bridged](https://img.shields.io/static/v1?label=Zulip&message=chat&color=9558b2&labelColor=389826)](https://julialang.zulipchat.com/#narrow/stream/279055-sciml-bridged) +[![Global Docs](https://img.shields.io/badge/docs-SciML-blue.svg)](https://docs.sciml.ai/DiffEqDocs/stable/) + +[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor%27s%20Guide-blueviolet)](https://github.com/SciML/ColPrac) +[![SciML Code Style](https://img.shields.io/static/v1?label=code%20style&message=SciML&color=9558b2&labelColor=389826)](https://github.com/SciML/SciMLStyle) + +ODEProblemLibrary.jl is a component of the [DiffEqProblemLibrary.jl](https://github.com/SciML/DiffEqProblemLibrary.jl) monorepo. A library of premade ordinary differential equation problems (ODEProblems) for testing and benchmarking ODE solvers. +While completely independent and usable on its own, users wanting the full set of premade differential equation problems should use [DiffEqProblemLibrary.jl](https://github.com/SciML/DiffEqProblemLibrary.jl). diff --git a/lib/ODEProblemLibrary/test/qa/Project.toml b/lib/ODEProblemLibrary/test/qa/Project.toml new file mode 100644 index 0000000..d52ff29 --- /dev/null +++ b/lib/ODEProblemLibrary/test/qa/Project.toml @@ -0,0 +1,13 @@ +[deps] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +ODEProblemLibrary = "fdc4e326-1af4-4b90-96e7-779fcce2daa5" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[sources] +ODEProblemLibrary = {path = "../.."} + +[compat] +Aqua = "0.8" +ODEProblemLibrary = "1" +Test = "1.10" +julia = "1.10" diff --git a/lib/ODEProblemLibrary/test/qa/qa.jl b/lib/ODEProblemLibrary/test/qa/qa.jl new file mode 100644 index 0000000..cdfb145 --- /dev/null +++ b/lib/ODEProblemLibrary/test/qa/qa.jl @@ -0,0 +1,6 @@ +using ODEProblemLibrary +using Aqua + +@testset "Aqua" begin + Aqua.test_all(ODEProblemLibrary; ambiguities = false) +end diff --git a/lib/ODEProblemLibrary/test/runtests.jl b/lib/ODEProblemLibrary/test/runtests.jl index 9d7d4e9..ce074ef 100644 --- a/lib/ODEProblemLibrary/test/runtests.jl +++ b/lib/ODEProblemLibrary/test/runtests.jl @@ -1,8 +1,24 @@ -# The test is simply that all of the examples build! +using Pkg using ODEProblemLibrary +using SafeTestsets, Test -# Check that there are no undefined exports, stale dependencies, etc. -# Ambiguity checks are disabled since tests fail due to ambiguities -# in dependencies -using Aqua -Aqua.test_all(ODEProblemLibrary; ambiguities = false) +const TEST_GROUP = get(ENV, "DIFFEQPROBLEMLIBRARY_TEST_GROUP", "All") + +function activate_qa_env() + Pkg.activate(joinpath(@__DIR__, "qa")) + return Pkg.instantiate() +end + +# The Core test is simply that all of the examples build (load the module). +if TEST_GROUP == "Core" || TEST_GROUP == "All" + @time @testset "Load Tests" begin + @test ODEProblemLibrary isa Module + end +end + +# Quality assurance: no undefined exports, stale dependencies, etc. +# Ambiguity checks are disabled since tests fail due to ambiguities in dependencies. +if TEST_GROUP == "QA" || TEST_GROUP == "All" + activate_qa_env() + @time @safetestset "Aqua" include("qa/qa.jl") +end diff --git a/lib/ODEProblemLibrary/test/test_groups.toml b/lib/ODEProblemLibrary/test/test_groups.toml new file mode 100644 index 0000000..1fe84cd --- /dev/null +++ b/lib/ODEProblemLibrary/test/test_groups.toml @@ -0,0 +1,5 @@ +[Core] +versions = ["lts", "1", "pre"] + +[QA] +versions = ["lts", "1"] diff --git a/lib/SDEProblemLibrary/LICENSE b/lib/SDEProblemLibrary/LICENSE.md similarity index 100% rename from lib/SDEProblemLibrary/LICENSE rename to lib/SDEProblemLibrary/LICENSE.md diff --git a/lib/SDEProblemLibrary/Project.toml b/lib/SDEProblemLibrary/Project.toml index 24fb8c6..61614d8 100644 --- a/lib/SDEProblemLibrary/Project.toml +++ b/lib/SDEProblemLibrary/Project.toml @@ -9,15 +9,18 @@ RuntimeGeneratedFunctions = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47" SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462" [compat] -Aqua = "0.8" DiffEqBase = "6, 7" Markdown = "1.10" RuntimeGeneratedFunctions = "0.5" +SafeTestsets = "0.1" SciMLBase = "2.0.1, 3" +Test = "1.10" julia = "1.10" [extras] -Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Aqua"] +test = ["Pkg", "SafeTestsets", "Test"] diff --git a/lib/SDEProblemLibrary/README.md b/lib/SDEProblemLibrary/README.md new file mode 100644 index 0000000..28f6cbd --- /dev/null +++ b/lib/SDEProblemLibrary/README.md @@ -0,0 +1,10 @@ +# SDEProblemLibrary.jl + +[![Join the chat at https://julialang.zulipchat.com #sciml-bridged](https://img.shields.io/static/v1?label=Zulip&message=chat&color=9558b2&labelColor=389826)](https://julialang.zulipchat.com/#narrow/stream/279055-sciml-bridged) +[![Global Docs](https://img.shields.io/badge/docs-SciML-blue.svg)](https://docs.sciml.ai/DiffEqDocs/stable/) + +[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor%27s%20Guide-blueviolet)](https://github.com/SciML/ColPrac) +[![SciML Code Style](https://img.shields.io/static/v1?label=code%20style&message=SciML&color=9558b2&labelColor=389826)](https://github.com/SciML/SciMLStyle) + +SDEProblemLibrary.jl is a component of the [DiffEqProblemLibrary.jl](https://github.com/SciML/DiffEqProblemLibrary.jl) monorepo. A library of premade stochastic differential equation problems (SDEProblems) for testing and benchmarking SDE solvers. +While completely independent and usable on its own, users wanting the full set of premade differential equation problems should use [DiffEqProblemLibrary.jl](https://github.com/SciML/DiffEqProblemLibrary.jl). diff --git a/lib/SDEProblemLibrary/test/qa/Project.toml b/lib/SDEProblemLibrary/test/qa/Project.toml new file mode 100644 index 0000000..2cdb197 --- /dev/null +++ b/lib/SDEProblemLibrary/test/qa/Project.toml @@ -0,0 +1,13 @@ +[deps] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +SDEProblemLibrary = "c72e72a9-a271-4b2b-8966-303ed956772e" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[sources] +SDEProblemLibrary = {path = "../.."} + +[compat] +Aqua = "0.8" +SDEProblemLibrary = "1" +Test = "1.10" +julia = "1.10" diff --git a/lib/SDEProblemLibrary/test/qa/qa.jl b/lib/SDEProblemLibrary/test/qa/qa.jl new file mode 100644 index 0000000..faf5dfb --- /dev/null +++ b/lib/SDEProblemLibrary/test/qa/qa.jl @@ -0,0 +1,6 @@ +using SDEProblemLibrary +using Aqua + +@testset "Aqua" begin + Aqua.test_all(SDEProblemLibrary; ambiguities = false, persistent_tasks = false) +end diff --git a/lib/SDEProblemLibrary/test/runtests.jl b/lib/SDEProblemLibrary/test/runtests.jl index ac537bf..6a700a2 100644 --- a/lib/SDEProblemLibrary/test/runtests.jl +++ b/lib/SDEProblemLibrary/test/runtests.jl @@ -1,8 +1,24 @@ -# The test is simply that all of the examples build! +using Pkg using SDEProblemLibrary +using SafeTestsets, Test -# Check that there are no undefined exports, stale dependencies, etc. -# Ambiguity checks are disabled since tests fail due to ambiguities -# in dependencies -using Aqua -Aqua.test_all(SDEProblemLibrary; ambiguities = false, persistent_tasks = false) +const TEST_GROUP = get(ENV, "DIFFEQPROBLEMLIBRARY_TEST_GROUP", "All") + +function activate_qa_env() + Pkg.activate(joinpath(@__DIR__, "qa")) + return Pkg.instantiate() +end + +# The Core test is simply that all of the examples build (load the module). +if TEST_GROUP == "Core" || TEST_GROUP == "All" + @time @testset "Load Tests" begin + @test SDEProblemLibrary isa Module + end +end + +# Quality assurance: no undefined exports, stale dependencies, etc. +# Ambiguity checks are disabled since tests fail due to ambiguities in dependencies. +if TEST_GROUP == "QA" || TEST_GROUP == "All" + activate_qa_env() + @time @safetestset "Aqua" include("qa/qa.jl") +end diff --git a/lib/SDEProblemLibrary/test/test_groups.toml b/lib/SDEProblemLibrary/test/test_groups.toml new file mode 100644 index 0000000..1fe84cd --- /dev/null +++ b/lib/SDEProblemLibrary/test/test_groups.toml @@ -0,0 +1,5 @@ +[Core] +versions = ["lts", "1", "pre"] + +[QA] +versions = ["lts", "1"] diff --git a/test/qa/Project.toml b/test/qa/Project.toml new file mode 100644 index 0000000..afaeb56 --- /dev/null +++ b/test/qa/Project.toml @@ -0,0 +1,20 @@ +[deps] +DiffEqProblemLibrary = "a077e3f3-b75c-5d7f-a0c6-6bc4c8ec64a9" +ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[sources] +BVProblemLibrary = {path = "../../lib/BVProblemLibrary"} +DAEProblemLibrary = {path = "../../lib/DAEProblemLibrary"} +DDEProblemLibrary = {path = "../../lib/DDEProblemLibrary"} +DiffEqProblemLibrary = {path = "../.."} +JumpProblemLibrary = {path = "../../lib/JumpProblemLibrary"} +NonlinearProblemLibrary = {path = "../../lib/NonlinearProblemLibrary"} +ODEProblemLibrary = {path = "../../lib/ODEProblemLibrary"} +SDEProblemLibrary = {path = "../../lib/SDEProblemLibrary"} + +[compat] +DiffEqProblemLibrary = "5" +ExplicitImports = "1" +Test = "1.10" +julia = "1.10" diff --git a/test/qa/qa.jl b/test/qa/qa.jl new file mode 100644 index 0000000..8c77d8f --- /dev/null +++ b/test/qa/qa.jl @@ -0,0 +1,11 @@ +# The root umbrella package's own test: it re-exports each sublibrary, +# so the test is that the whole thing builds with no implicit or stale +# explicit imports. +using DiffEqProblemLibrary +using ExplicitImports +using Test + +@testset "ExplicitImports" begin + @test check_no_implicit_imports(DiffEqProblemLibrary) === nothing + @test check_no_stale_explicit_imports(DiffEqProblemLibrary) === nothing +end diff --git a/test/runtests.jl b/test/runtests.jl index fa0a720..ceb763e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,9 +1,72 @@ -# The test is simply that all of the examples build! -using DiffEqProblemLibrary -using ExplicitImports -using Test - -@testset "ExplicitImports" begin - @test check_no_implicit_imports(DiffEqProblemLibrary) === nothing - @test check_no_stale_explicit_imports(DiffEqProblemLibrary) === nothing +using Pkg +using SafeTestsets, Test + +const GROUP = get(ENV, "GROUP", "All") + +function activate_qa_env() + Pkg.activate(joinpath(@__DIR__, "qa")) + return Pkg.instantiate() end + +@time begin + # Detect sublibrary test groups. + # GROUP can be a bare sublibrary name (Core test group) or + # "{sublibrary}_{TEST_GROUP}" for any custom group (e.g., QA). + # Sublibraries declare their groups in test/test_groups.toml (when they + # differ from the default Core + QA). + lib_dir = joinpath(dirname(@__DIR__), "lib") + + # Scan underscores right-to-left to find the longest matching sublibrary prefix. + function _detect_sublibrary_group(group, lib_dir) + isdir(joinpath(lib_dir, group)) && return (group, "Core") + for i in length(group):-1:1 + if group[i] == '_' && isdir(joinpath(lib_dir, group[1:(i - 1)])) + return (group[1:(i - 1)], group[(i + 1):end]) + end + end + return (group, "Core") + end + base_group, test_group = _detect_sublibrary_group(GROUP, lib_dir) + + if isdir(joinpath(lib_dir, base_group)) + Pkg.activate(joinpath(lib_dir, base_group)) + # On Julia < 1.11, the [sources] section in Project.toml is not supported. + # Manually Pkg.develop local path dependencies so CI tests the PR branch code. + # The transitive walk also develops each developed dependency's own [sources]. + if VERSION < v"1.11.0-DEV.0" + developed = Set{String}() + push!(developed, normpath(joinpath(lib_dir, base_group))) + specs = Pkg.PackageSpec[] + queue = [joinpath(lib_dir, base_group)] + while !isempty(queue) + pkg_dir = popfirst!(queue) + toml_path = joinpath(pkg_dir, "Project.toml") + isfile(toml_path) || continue + toml = Pkg.TOML.parsefile(toml_path) + if haskey(toml, "sources") + for (dep_name, source_spec) in toml["sources"] + if source_spec isa Dict && haskey(source_spec, "path") + dep_path = normpath(joinpath(pkg_dir, source_spec["path"])) + if isdir(dep_path) && !(dep_path in developed) + push!(developed, dep_path) + @info "Queuing local source dependency" dep_name dep_path + push!(specs, Pkg.PackageSpec(path = dep_path)) + push!(queue, dep_path) + end + end + end + end + end + isempty(specs) || Pkg.develop(specs) + end + withenv("DIFFEQPROBLEMLIBRARY_TEST_GROUP" => test_group) do + Pkg.test(base_group, julia_args = ["--check-bounds=auto", "--compiled-modules=yes", "--depwarn=yes"], force_latest_compatible_version = false, allow_reresolve = true) + end + elseif GROUP == "All" || GROUP == "Core" || GROUP == "QA" + # The root umbrella package's own test: it re-exports each sublibrary, + # so the test is that the whole thing builds with no implicit or stale + # explicit imports. + activate_qa_env() + @time @safetestset "ExplicitImports" include("qa/qa.jl") + end +end # @time