From 3b7a2df143a6560d1dcde7534ae81ff7c45b8298 Mon Sep 17 00:00:00 2001 From: Simone Carlo Surace <51025924+simsurace@users.noreply.github.com> Date: Tue, 6 Feb 2024 23:35:21 +0100 Subject: [PATCH] Fix `@test_broken` problems (#546) * Fix `@test_broken` problems * Correct remaining tests * Bump version --- Project.toml | 2 +- test/basekernels/periodic.jl | 3 ++- test/basekernels/sm.jl | 3 ++- test/basekernels/wiener.jl | 3 ++- test/transform/selecttransform.jl | 40 ++++++++++++++++++++++++------- 5 files changed, 39 insertions(+), 12 deletions(-) diff --git a/Project.toml b/Project.toml index c46c5c334..16bd8514d 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "KernelFunctions" uuid = "ec8451be-7e33-11e9-00cf-bbf324bd1392" -version = "0.10.60" +version = "0.10.61" [deps] ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" diff --git a/test/basekernels/periodic.jl b/test/basekernels/periodic.jl index fb149dff5..046687962 100644 --- a/test/basekernels/periodic.jl +++ b/test/basekernels/periodic.jl @@ -16,6 +16,7 @@ TestUtils.test_interface(PeriodicKernel(; r=[0.8, 0.7]), RowVecs{Float64}) # test_ADs(r->PeriodicKernel(r =exp.(r)), log.(r), ADs = [:ForwardDiff, :ReverseDiff]) - @test_broken "Undefined adjoint for Sinus metric, and failing randomly for ForwardDiff and ReverseDiff" + # Undefined adjoint for Sinus metric, and failing randomly for ForwardDiff and ReverseDiff + @test_broken false test_params(k, (r,)) end diff --git a/test/basekernels/sm.jl b/test/basekernels/sm.jl index 5cbc37243..d9037aadd 100644 --- a/test/basekernels/sm.jl +++ b/test/basekernels/sm.jl @@ -57,5 +57,6 @@ end # test_ADs(x->spectral_mixture_kernel(exp.(x[1:3]), reshape(x[4:18], 5, 3), reshape(x[19:end], 5, 3)), vcat(log.(αs₁), γs[:], ωs[:]), dims = [5,5]) - @test_broken "No tests passing (BaseKernel)" + # No tests passing (BaseKernel) + @test_broken false end diff --git a/test/basekernels/wiener.jl b/test/basekernels/wiener.jl index 9dd60ba43..621b3dcbc 100644 --- a/test/basekernels/wiener.jl +++ b/test/basekernels/wiener.jl @@ -44,5 +44,6 @@ TestUtils.test_interface(k2, x0, x1, x2) TestUtils.test_interface(k3, x0, x1, x2) # test_ADs(()->WienerKernel(i=1)) - @test_broken "No tests passing" + # No tests passing + @test_broken false end diff --git a/test/transform/selecttransform.jl b/test/transform/selecttransform.jl index b0e3bfa81..a6d382462 100644 --- a/test/transform/selecttransform.jl +++ b/test/transform/selecttransform.jl @@ -104,17 +104,41 @@ end @testset "$(AD)" for AD in [:ReverseDiff] - @test_broken ga = gradient(AD, A) do a - testfunction(ta_row, a, 2) + @test_broken let + gx = gradient(AD, X) do x + testfunction(tx_row, x, 2) + end + ga = gradient(AD, A) do a + testfunction(ta_row, a, 2) + end + gx ≈ ga end - @test_broken ga = gradient(AD, A) do a - testfunction(ta_col, a, 1) + @test_broken let + gx = gradient(AD, X) do x + testfunction(tx_col, x, 1) + end + ga = gradient(AD, A) do a + testfunction(ta_col, a, 1) + end + gx ≈ ga end - @test_broken ga = gradient(AD, A) do a - testfunction(ta_row, a, B, 2) + @test_broken let + gx = gradient(AD, X) do x + testfunction(tx_row, x, Y, 2) + end + ga = gradient(AD, A) do a + testfunction(ta_row, a, B, 2) + end + gx ≈ ga end - @test_broken ga = gradient(AD, A) do a - testfunction(ta_col, a, C, 1) + @test_broken let + gx = gradient(AD, X) do x + testfunction(tx_col, x, Z, 1) + end + ga = gradient(AD, A) do a + testfunction(ta_col, a, C, 1) + end + gx ≈ ga end end