diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ace1c011..975ccb9b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ concurrency: cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} jobs: test: - name: Julia ${{ matrix.version }} - ${{ github.event_name }} + name: Julia ${{ matrix.version }} - ${{ matrix.test_suite }} runs-on: ubuntu-latest strategy: fail-fast: false @@ -21,8 +21,8 @@ jobs: - "1.9" - "1" test_suite: - - "normal" - - "hmmbase" + - "Standard" + - "HMMBase" env: JULIA_HMM_TEST_SUITE: ${{ matrix.test_suite }} steps: diff --git a/libs/HMMTest/ext/HMMTestHMMBaseExt.jl b/libs/HMMTest/ext/HMMTestHMMBaseExt.jl index e397cf8f..f3c1c379 100644 --- a/libs/HMMTest/ext/HMMTestHMMBaseExt.jl +++ b/libs/HMMTest/ext/HMMTestHMMBaseExt.jl @@ -64,5 +64,4 @@ function HMMTest.test_identical_hmmbase( end end - end diff --git a/test/correctness.jl b/test/correctness.jl index cb139823..7b2706d1 100644 --- a/test/correctness.jl +++ b/test/correctness.jl @@ -42,7 +42,7 @@ seq_ends = cumsum(length.(control_seqs)); hmm = HMM(init, trans, dists) hmm_guess = HMM(init_guess, trans_guess, dists_guess) - test_identical_hmmbase(rng, hmm, T; hmm_guess) + TEST_SUITE == "HMMBase" && test_identical_hmmbase(rng, hmm, T; hmm_guess) test_coherent_algorithms(rng, hmm, control_seq; seq_ends, hmm_guess, init=false) test_type_stability(rng, hmm, control_seq; seq_ends, hmm_guess) test_allocations(rng, hmm, control_seq; seq_ends, hmm_guess) @@ -57,7 +57,7 @@ end hmm = HMM(init, trans, dists) hmm_guess = HMM(init_guess, trans_guess, dists_guess) - test_identical_hmmbase(rng, hmm, T; hmm_guess) + TEST_SUITE == "HMMBase" && test_identical_hmmbase(rng, hmm, T; hmm_guess) test_coherent_algorithms(rng, hmm, control_seq; seq_ends, hmm_guess, init=false) test_type_stability(rng, hmm, control_seq; seq_ends, hmm_guess) end @@ -93,7 +93,7 @@ end hmm = HMM(init, sparse(trans), dists) hmm_guess = HMM(init_guess, trans_guess, dists_guess) - test_identical_hmmbase(rng, hmm, T; hmm_guess) + TEST_SUITE == "HMMBase" && test_identical_hmmbase(rng, hmm, T; hmm_guess) test_coherent_algorithms(rng, hmm, control_seq; seq_ends, hmm_guess, init=false) test_type_stability(rng, hmm, control_seq; seq_ends, hmm_guess) @test_skip test_allocations(rng, hmm, control_seq; seq_ends, hmm_guess) @@ -106,7 +106,7 @@ end hmm = transpose_hmm(HMM(init, trans, dists)) hmm_guess = transpose_hmm(HMM(init_guess, trans_guess, dists_guess)) - test_identical_hmmbase(rng, hmm, T; hmm_guess) + TEST_SUITE == "HMMBase" && test_identical_hmmbase(rng, hmm, T; hmm_guess) test_coherent_algorithms(rng, hmm, control_seq; seq_ends, hmm_guess, init=false) test_type_stability(rng, hmm, control_seq; seq_ends, hmm_guess) test_allocations(rng, hmm, control_seq; seq_ends, hmm_guess) @@ -119,6 +119,6 @@ end hmm = HMM(init, trans, dists) hmm_guess = HMM(init_guess, trans_guess, dists_guess) - test_identical_hmmbase(rng, hmm, T; hmm_guess) + TEST_SUITE == "HMMBase" && test_identical_hmmbase(rng, hmm, T; hmm_guess) test_coherent_algorithms(rng, hmm, control_seq; seq_ends, hmm_guess, init=false) end diff --git a/test/runtests.jl b/test/runtests.jl index 96b2f0fa..662cfc9e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -6,41 +6,48 @@ using JuliaFormatter: JuliaFormatter using Pkg using Test +TEST_SUITE = get(ENV, "JULIA_HMM_TEST_SUITE", "Standard") +if TEST_SUITE == "HMMBase" + Pkg.add("HMMBase") +end + Pkg.develop(; path=joinpath(dirname(@__DIR__), "libs", "HMMTest")) @testset verbose = true "HiddenMarkovModels.jl" begin - @testset "Code formatting" begin - @test JuliaFormatter.format(HiddenMarkovModels; verbose=false, overwrite=false) - end + if TEST_SUITE == "Standard" + @testset "Code formatting" begin + @test JuliaFormatter.format(HiddenMarkovModels; verbose=false, overwrite=false) + end - @testset "Code quality" begin - Aqua.test_all( - HiddenMarkovModels; ambiguities=false, deps_compat=(check_extras=false,) - ) - end + @testset "Code quality" begin + Aqua.test_all( + HiddenMarkovModels; ambiguities=false, deps_compat=(check_extras=false,) + ) + end - @testset "Code linting" begin - using Distributions - using Zygote - JET.test_package(HiddenMarkovModels; target_defined_modules=true) - end + @testset "Code linting" begin + using Distributions + using Zygote + JET.test_package(HiddenMarkovModels; target_defined_modules=true) + end - @testset "Distributions" begin - include("distributions.jl") - end + @testset "Distributions" begin + include("distributions.jl") + end - @testset "Correctness" begin - include("correctness.jl") - end + examples_path = joinpath(dirname(@__DIR__), "examples") + for file in readdir(examples_path) + @testset "Example - $file" begin + include(joinpath(examples_path, file)) + end + end - examples_path = joinpath(dirname(@__DIR__), "examples") - for file in readdir(examples_path) - @testset "Example - $file" begin - include(joinpath(examples_path, file)) + @testset "Doctests" begin + Documenter.doctest(HiddenMarkovModels) end end - @testset "Doctests" begin - Documenter.doctest(HiddenMarkovModels) + @testset "Correctness - $TEST_SUITE" begin + include("correctness.jl") end end