From 9a548770172f356617bdcb0fa65a5dad0b0d89f4 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Mon, 13 May 2024 09:14:33 +1200 Subject: [PATCH 1/3] resolve verbosity=0 bug to close #41 --- src/test.jl | 10 ++++------ test/test.jl | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/test.jl b/src/test.jl index 0c19fbd..25a1e05 100644 --- a/src/test.jl +++ b/src/test.jl @@ -491,12 +491,10 @@ function test(model; mod=Main, level=2, throw=false, verbosity=1,) println() end if !isempty(fails) - if verbosity > 0 - @warn "\n Failures encounted for these tests:" - for e in fails - @warn "\t [$(e.test)]" - push!(exceptions, e) - end + verbosity > 0 && @warn "\n Failures encounted for these tests:" + for e in fails + @warn "\t [$(e.test)]" + push!(exceptions, e) end end end diff --git a/test/test.jl b/test/test.jl index 8b1fbd1..e264371 100644 --- a/test/test.jl +++ b/test/test.jl @@ -4,6 +4,7 @@ using MLJTestIntegration using MLJ using MLJModels const MTI = MLJTestIntegration +const MMI = MLJ.MLJBase.MLJModelInterface classifiers = [ (name = "ConstantClassifier", package_name = "MLJModels"), @@ -315,4 +316,18 @@ end ) end +struct JunkModel <: Deterministic end + +MMI.fit(::JunkModel, verbosity, X, y) = error("I am always broken") +MMI.input_scitype(::Type{JunkModel}) = Table(Continuous) +MMI.target_scitype(::Type{JunkModel}) = AbstractVector{<:Continuous} + +@testset "test(model, ...) catches failure" begin + @test(@test_logs( + (:warn, MTI.WARN_FAILURES_ENCOUNTERED), + match_mode=:any, + !isempty(MTI.test(JunkModel; mod=@__MODULE__, verbosity=0, throw=false)), + )) +end + true From 657326d65506ea686a046057dca92050d8571c3a Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Mon, 13 May 2024 09:15:09 +1200 Subject: [PATCH 2/3] bump 0.5.1 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 7e50333..ebc95f4 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "MLJTestIntegration" uuid = "697918b4-fdc1-4f9e-8ff9-929724cee270" authors = ["Anthony D. Blaom "] -version = "0.5.0" +version = "0.5.1" [deps] MLJ = "add582a8-e3ab-11e8-2d5e-e98b27df1bc7" From 1827bf2598aaf64db26e759115886ae42f2edb32 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Mon, 13 May 2024 09:27:28 +1200 Subject: [PATCH 3/3] rm nightly from ci --- .github/workflows/ci_nightly.yml | 50 -------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 .github/workflows/ci_nightly.yml diff --git a/.github/workflows/ci_nightly.yml b/.github/workflows/ci_nightly.yml deleted file mode 100644 index dbb29cd..0000000 --- a/.github/workflows/ci_nightly.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: CI (Julia nightly) -on: - pull_request: - branches: - - master - - dev - push: - branches: - - master - - dev - tags: '*' -env: - TEST_MLJBASE: "true" -jobs: - test: - name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - version: - - 'nightly' - os: - - ubuntu-latest - arch: - - x64 - steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v1 - with: - version: ${{ matrix.version }} - arch: ${{ matrix.arch }} - - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- - - uses: julia-actions/julia-buildpkg@v1 - - uses: julia-actions/julia-runtest@v1 - env: - JULIA_NUM_THREADS: 2 - - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v1 - with: - file: lcov.info