diff --git a/Project.toml b/Project.toml index 5a37c25..05f4828 100644 --- a/Project.toml +++ b/Project.toml @@ -19,8 +19,10 @@ julia = "1.10" CanonicalMoments = "0.1" DiscreteMeasures = "0.1" OUQBase = "0.1" +Pkg = "1.10" Reexport = "1.2.2" SafeTestsets = "0.1" +Test = "1.10" SciMLTesting = "1" [extras] diff --git a/lib/CanonicalMoments/Project.toml b/lib/CanonicalMoments/Project.toml index 0ebc55f..18c8db1 100644 --- a/lib/CanonicalMoments/Project.toml +++ b/lib/CanonicalMoments/Project.toml @@ -31,6 +31,7 @@ ForwardDiff = "0.10, 1" InteractiveUtils = "1.10" IntervalArithmetic = "0.18 - 0.20, =0.20.9" LinearAlgebra = "1.10" +Pkg = "1.10" PolynomialRoots = "1.0" Polynomials = "4" Random = "1.10" @@ -49,6 +50,7 @@ DiscreteMeasures = { path = "../DiscreteMeasures" } [extras] InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" IntervalArithmetic = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" PolynomialRoots = "3a141323-8675-5d76-9d11-e1df1406c778" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" @@ -57,4 +59,4 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["InteractiveUtils", "IntervalArithmetic", "PolynomialRoots", "Random", "SafeTestsets", "SpecialFunctions", "StaticArrays", "Test"] +test = ["InteractiveUtils", "IntervalArithmetic", "Pkg", "PolynomialRoots", "Random", "SafeTestsets", "SpecialFunctions", "StaticArrays", "Test"] diff --git a/lib/CanonicalMoments/test/qa/Project.toml b/lib/CanonicalMoments/test/qa/Project.toml new file mode 100644 index 0000000..50503eb --- /dev/null +++ b/lib/CanonicalMoments/test/qa/Project.toml @@ -0,0 +1,18 @@ +[deps] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +CanonicalMoments = "58d2c334-1a3c-4862-bb37-9012b9e58a38" +DiscreteMeasures = "7766d772-2108-41ee-a4bd-11c51440a39b" +JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[sources] +CanonicalMoments = {path = "../.."} +DiscreteMeasures = {path = "../../../DiscreteMeasures"} + +[compat] +Aqua = "0.8" +CanonicalMoments = "0.1" +DiscreteMeasures = "0.1" +JET = "0.9, 0.10, 0.11" +Test = "1" +julia = "1.10" diff --git a/lib/CanonicalMoments/test/qa/qa.jl b/lib/CanonicalMoments/test/qa/qa.jl new file mode 100644 index 0000000..b4a326e --- /dev/null +++ b/lib/CanonicalMoments/test/qa/qa.jl @@ -0,0 +1,12 @@ +using CanonicalMoments +using Aqua +using JET +using Test + +@testset "Aqua" begin + Aqua.test_all(CanonicalMoments) +end + +@testset "JET" begin + JET.test_package(CanonicalMoments; target_defined_modules = true) +end diff --git a/lib/CanonicalMoments/test/runtests.jl b/lib/CanonicalMoments/test/runtests.jl index ef6b2d7..cf294cc 100644 --- a/lib/CanonicalMoments/test/runtests.jl +++ b/lib/CanonicalMoments/test/runtests.jl @@ -1,13 +1,34 @@ +using Pkg using SafeTestsets using Test const TEST_GROUP = get(ENV, "OPTIMALUNCERTAINTYQUANTIFICATION_TEST_GROUP", "All") +function activate_qa_env() + Pkg.activate(joinpath(@__DIR__, "qa")) + # On Julia < 1.11, the [sources] section in Project.toml is not honored. + # Manually Pkg.develop the local path dependencies so QA tests the PR branch code. + if VERSION < v"1.11.0-DEV.0" + Pkg.develop( + [ + Pkg.PackageSpec(path = joinpath(@__DIR__, "..")), + Pkg.PackageSpec(path = joinpath(@__DIR__, "..", "..", "DiscreteMeasures")) + ] + ) + end + return Pkg.instantiate() +end + if TEST_GROUP == "Core" || TEST_GROUP == "All" @safetestset "Orthogonal Polynomial Roots" include("Core/orthopoly_roots.jl") @safetestset "Moment Sequence" include("Core/moment_sequence.jl") end +if (TEST_GROUP == "QA" || TEST_GROUP == "All") && isempty(VERSION.prerelease) + activate_qa_env() + @safetestset "Quality Assurance" include("qa/qa.jl") +end + # @safetestset "Root Domain Restriction" begin # using IntervalArithmetic # import OptimalUncertaintyQuantification.CanonicalMoments: clamp_domain diff --git a/lib/CanonicalMoments/test/test_groups.toml b/lib/CanonicalMoments/test/test_groups.toml index dda1469..1fe84cd 100644 --- a/lib/CanonicalMoments/test/test_groups.toml +++ b/lib/CanonicalMoments/test/test_groups.toml @@ -1,2 +1,5 @@ [Core] versions = ["lts", "1", "pre"] + +[QA] +versions = ["lts", "1"] diff --git a/lib/DiscreteMeasures/Project.toml b/lib/DiscreteMeasures/Project.toml index 4944557..1f57362 100644 --- a/lib/DiscreteMeasures/Project.toml +++ b/lib/DiscreteMeasures/Project.toml @@ -12,13 +12,15 @@ IntervalArithmeticExt = "IntervalArithmetic" [compat] julia = "1.10" IntervalArithmetic = "0.16 - 0.20, =0.20.9" +Pkg = "1.10" SafeTestsets = "0.1" Test = "1.10" [extras] IntervalArithmetic = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["IntervalArithmetic", "SafeTestsets", "Test"] +test = ["IntervalArithmetic", "Pkg", "SafeTestsets", "Test"] diff --git a/lib/DiscreteMeasures/test/qa/Project.toml b/lib/DiscreteMeasures/test/qa/Project.toml new file mode 100644 index 0000000..4f3c930 --- /dev/null +++ b/lib/DiscreteMeasures/test/qa/Project.toml @@ -0,0 +1,15 @@ +[deps] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +DiscreteMeasures = "7766d772-2108-41ee-a4bd-11c51440a39b" +JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[sources] +DiscreteMeasures = {path = "../.."} + +[compat] +Aqua = "0.8" +DiscreteMeasures = "0.1" +JET = "0.9, 0.10, 0.11" +Test = "1" +julia = "1.10" diff --git a/lib/DiscreteMeasures/test/qa/qa.jl b/lib/DiscreteMeasures/test/qa/qa.jl new file mode 100644 index 0000000..c76ecaa --- /dev/null +++ b/lib/DiscreteMeasures/test/qa/qa.jl @@ -0,0 +1,12 @@ +using DiscreteMeasures +using Aqua +using JET +using Test + +@testset "Aqua" begin + Aqua.test_all(DiscreteMeasures) +end + +@testset "JET" begin + JET.test_package(DiscreteMeasures; target_defined_modules = true) +end diff --git a/lib/DiscreteMeasures/test/runtests.jl b/lib/DiscreteMeasures/test/runtests.jl index bcdf257..2b8381a 100644 --- a/lib/DiscreteMeasures/test/runtests.jl +++ b/lib/DiscreteMeasures/test/runtests.jl @@ -1,8 +1,24 @@ +using Pkg using SafeTestsets using Test const TEST_GROUP = get(ENV, "OPTIMALUNCERTAINTYQUANTIFICATION_TEST_GROUP", "All") +function activate_qa_env() + Pkg.activate(joinpath(@__DIR__, "qa")) + # On Julia < 1.11, the [sources] section in Project.toml is not honored. + # Manually Pkg.develop the local path dependency so QA tests the PR branch code. + if VERSION < v"1.11.0-DEV.0" + Pkg.develop(Pkg.PackageSpec(path = joinpath(@__DIR__, ".."))) + end + return Pkg.instantiate() +end + if TEST_GROUP == "Core" || TEST_GROUP == "All" @safetestset "Discrete Measures" include("Core/discrete_measures_tests.jl") end + +if (TEST_GROUP == "QA" || TEST_GROUP == "All") && isempty(VERSION.prerelease) + activate_qa_env() + @safetestset "Quality Assurance" include("qa/qa.jl") +end diff --git a/lib/DiscreteMeasures/test/test_groups.toml b/lib/DiscreteMeasures/test/test_groups.toml index dda1469..1fe84cd 100644 --- a/lib/DiscreteMeasures/test/test_groups.toml +++ b/lib/DiscreteMeasures/test/test_groups.toml @@ -1,2 +1,5 @@ [Core] versions = ["lts", "1", "pre"] + +[QA] +versions = ["lts", "1"] diff --git a/lib/OUQBase/Project.toml b/lib/OUQBase/Project.toml index e37e2e4..3b3a53e 100644 --- a/lib/OUQBase/Project.toml +++ b/lib/OUQBase/Project.toml @@ -30,6 +30,7 @@ NaNMath = "1.1.3" Optimization = "5" OptimizationBBO = "0.4" OrderedCollections = "1.7.0" +Pkg = "1.10" PolynomialRoots = "1" Polynomials = "4.0.13" Reexport = "1.2.2" @@ -45,8 +46,9 @@ DiscreteMeasures = { path = "../DiscreteMeasures" } [extras] OptimizationBBO = "3e6eede4-6085-4f62-9a71-46d9bc1eb92b" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["OptimizationBBO", "SafeTestsets", "Test"] +test = ["OptimizationBBO", "Pkg", "SafeTestsets", "Test"] diff --git a/lib/OUQBase/test/qa/Project.toml b/lib/OUQBase/test/qa/Project.toml new file mode 100644 index 0000000..98aba77 --- /dev/null +++ b/lib/OUQBase/test/qa/Project.toml @@ -0,0 +1,21 @@ +[deps] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +CanonicalMoments = "58d2c334-1a3c-4862-bb37-9012b9e58a38" +DiscreteMeasures = "7766d772-2108-41ee-a4bd-11c51440a39b" +JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" +OUQBase = "01930cae-99d2-7439-8f4f-ace2ece9f1b9" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[sources] +CanonicalMoments = {path = "../../../CanonicalMoments"} +DiscreteMeasures = {path = "../../../DiscreteMeasures"} +OUQBase = {path = "../.."} + +[compat] +Aqua = "0.8" +CanonicalMoments = "0.1" +DiscreteMeasures = "0.1" +JET = "0.9, 0.10, 0.11" +OUQBase = "0.1" +Test = "1" +julia = "1.10" diff --git a/lib/OUQBase/test/qa/qa.jl b/lib/OUQBase/test/qa/qa.jl new file mode 100644 index 0000000..1bbf9ff --- /dev/null +++ b/lib/OUQBase/test/qa/qa.jl @@ -0,0 +1,12 @@ +using OUQBase +using Aqua +using JET +using Test + +@testset "Aqua" begin + Aqua.test_all(OUQBase) +end + +@testset "JET" begin + JET.test_package(OUQBase; target_defined_modules = true) +end diff --git a/lib/OUQBase/test/runtests.jl b/lib/OUQBase/test/runtests.jl index bdc2e37..a0b3d0f 100644 --- a/lib/OUQBase/test/runtests.jl +++ b/lib/OUQBase/test/runtests.jl @@ -1,8 +1,25 @@ +using Pkg using SafeTestsets using Test const TEST_GROUP = get(ENV, "OPTIMALUNCERTAINTYQUANTIFICATION_TEST_GROUP", "All") +function activate_qa_env() + Pkg.activate(joinpath(@__DIR__, "qa")) + # On Julia < 1.11, the [sources] section in Project.toml is not honored. + # Manually Pkg.develop the local path dependencies so QA tests the PR branch code. + if VERSION < v"1.11.0-DEV.0" + Pkg.develop( + [ + Pkg.PackageSpec(path = joinpath(@__DIR__, "..")), + Pkg.PackageSpec(path = joinpath(@__DIR__, "..", "..", "CanonicalMoments")), + Pkg.PackageSpec(path = joinpath(@__DIR__, "..", "..", "DiscreteMeasures")) + ] + ) + end + return Pkg.instantiate() +end + if TEST_GROUP == "Core" || TEST_GROUP == "All" @safetestset "Flood Problem (Q only)" include("Core/FloodProblem/Q_only.jl") @@ -14,3 +31,8 @@ if TEST_GROUP == "Core" || TEST_GROUP == "All" include("Core/FloodProblem/test_canonical_moments.jl") end end + +if (TEST_GROUP == "QA" || TEST_GROUP == "All") && isempty(VERSION.prerelease) + activate_qa_env() + @safetestset "Quality Assurance" include("qa/qa.jl") +end diff --git a/lib/OUQBase/test/test_groups.toml b/lib/OUQBase/test/test_groups.toml index dda1469..1fe84cd 100644 --- a/lib/OUQBase/test/test_groups.toml +++ b/lib/OUQBase/test/test_groups.toml @@ -1,2 +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..d7d9df5 --- /dev/null +++ b/test/qa/Project.toml @@ -0,0 +1,24 @@ +[deps] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +CanonicalMoments = "58d2c334-1a3c-4862-bb37-9012b9e58a38" +DiscreteMeasures = "7766d772-2108-41ee-a4bd-11c51440a39b" +JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" +OUQBase = "01930cae-99d2-7439-8f4f-ace2ece9f1b9" +OptimalUncertaintyQuantification = "91ab1271-1799-4997-981e-07ad84422b0d" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[sources] +CanonicalMoments = {path = "../../lib/CanonicalMoments"} +DiscreteMeasures = {path = "../../lib/DiscreteMeasures"} +OUQBase = {path = "../../lib/OUQBase"} +OptimalUncertaintyQuantification = {path = "../.."} + +[compat] +Aqua = "0.8" +CanonicalMoments = "0.1" +DiscreteMeasures = "0.1" +JET = "0.9, 0.10, 0.11" +OUQBase = "0.1" +OptimalUncertaintyQuantification = "0.1" +Test = "1" +julia = "1.10" diff --git a/test/qa/qa.jl b/test/qa/qa.jl new file mode 100644 index 0000000..701b77c --- /dev/null +++ b/test/qa/qa.jl @@ -0,0 +1,12 @@ +using OptimalUncertaintyQuantification +using Aqua +using JET +using Test + +@testset "Aqua" begin + Aqua.test_all(OptimalUncertaintyQuantification) +end + +@testset "JET" begin + JET.test_package(OptimalUncertaintyQuantification; target_defined_modules = true) +end diff --git a/test/runtests.jl b/test/runtests.jl index e6cf689..01bda88 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -53,7 +53,13 @@ const GROUP = get(ENV, "GROUP", "All") withenv("OPTIMALUNCERTAINTYQUANTIFICATION_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" - run_tests(; core = () -> @safetestset("Umbrella Load", include("umbrella_load.jl"))) + elseif GROUP == "All" || GROUP == "Core" || GROUP == "QA" + run_tests(; + core = () -> @safetestset("Umbrella Load", include("umbrella_load.jl")), + # QA (Aqua/JET): dep-adding group in its own sub-env (test/qa), excluded from "All". + groups = Dict( + "QA" => (; env = joinpath(@__DIR__, "qa"), body = joinpath(@__DIR__, "qa", "qa.jl")), + ), + ) end end # @time diff --git a/test/test_groups.toml b/test/test_groups.toml index dda1469..1fe84cd 100644 --- a/test/test_groups.toml +++ b/test/test_groups.toml @@ -1,2 +1,5 @@ [Core] versions = ["lts", "1", "pre"] + +[QA] +versions = ["lts", "1"]