From 3e506f3925addd21802b428757979292e2ca63bb Mon Sep 17 00:00:00 2001 From: adrhill Date: Tue, 22 Oct 2024 14:12:04 +0200 Subject: [PATCH 1/3] Fix URL tests --- test/runtests.jl | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index ca2ea07..7722682 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -26,6 +26,7 @@ using Arxiv: @arXiv_str # hosted on GitLab using GPMaxlik: gnll # hosted on sourcehut function url_exists(url) + url = replace(url, r"#.*$" => "") # strip line number response = request("GET", url; status_exception=false, redirect=true, retry=true) if 200 ≤ response.status < 400 return true @@ -75,22 +76,22 @@ end @testset "Base" begin m = @which sqrt(0.0) u = first(@inferred url(m)) - # @test url_exists(u) + @test url_exists(u) end @testset "Stdlib" begin @testset "within julialang/julia" begin m = @which @test true u = first(@inferred url(m)) - # @test url_exists(u) + @test url_exists(u) m = @which det(rand(2, 2)) u = first(@inferred url(m)) - # @test url_exists(u) + @test url_exists(u) end - @testset "own repository" begin + @testset "standalone repository" begin m = @which mean(rand(5)) u = first(@inferred url(m)) - # @test url_exists(u) + @test url_exists(u) end end @@ -98,28 +99,28 @@ end @testset "GitHub" begin m = @which Aqua.test_all(MethodURL) u = first(@inferred url(m)) - # @test url_exists(u) - end - @testset "GitHub monorepo" begin - m = first(methods(Plots.RecipesBase.create_kw_body)) - u = first(@inferred url(m)) - # @test url_exists(u) + @test url_exists(u) end + # @testset "GitHub monorepo" begin + # m = first(methods(Plots.RecipesBase.create_kw_body)) + # u = first(@inferred url(m)) + # @test url_exists(u) + # end @testset "GitLab" begin m = @which arXiv"1234.5678" u = first(@inferred url(m)) - # @test url_exists(u) # no tags in Arxiv.jl + @test_broken url_exists(u) # no tags in Arxiv.jl end @testset "Sourcehut" begin m = first(methods(gnll)) u = first(@inferred url(m)) - # @test url_exists(u) # no tags in GPMaxlik.jl + @test_broken url_exists(u) # no tags in GPMaxlik.jl end end # @testset "Local" begin # m = @which url(@which sqrt(1.0)) # u = first(@inferred url(m)) - # # @test url_exists(u) + # @test_broken url_exists(u) # end end end From 215325864de68565eeaeee3498857bb14d700bac Mon Sep 17 00:00:00 2001 From: adrhill Date: Tue, 22 Oct 2024 14:56:19 +0200 Subject: [PATCH 2/3] Fix test --- test/runtests.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 7722682..0a27640 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -91,7 +91,9 @@ end @testset "standalone repository" begin m = @which mean(rand(5)) u = first(@inferred url(m)) - @test url_exists(u) + if VERSION > v"1.10" # no tag for Statistics.jl v1.10.0 + @test url_exists(u) + end end end From 1139eef3efcb908bb0aa5abd69fea95c65782215 Mon Sep 17 00:00:00 2001 From: adrhill Date: Tue, 22 Oct 2024 15:37:26 +0200 Subject: [PATCH 3/3] Fix v2 --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 0a27640..74d7d40 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -91,7 +91,7 @@ end @testset "standalone repository" begin m = @which mean(rand(5)) u = first(@inferred url(m)) - if VERSION > v"1.10" # no tag for Statistics.jl v1.10.0 + if VERSION >= v"1.11" # no tag for Statistics.jl v1.10.0 @test url_exists(u) end end