From 9399502d451d3b308747e775e6332c61254710ff Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 14 Oct 2022 15:48:49 -0700 Subject: [PATCH 1/3] switch plot to svg --- Project.toml | 13 ++++++++----- test/runtests.jl | 20 ++++++++++---------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Project.toml b/Project.toml index 140572a..9600bf5 100644 --- a/Project.toml +++ b/Project.toml @@ -3,12 +3,15 @@ uuid = "82f577da-a64f-4709-b926-88c56b51bf4b" authors = ["Simon Byrne "] version = "0.1.0" -[extras] -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" -Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" - [compat] julia = "1.6" +[extras] +Plotly = "58dd65bb-95f3-509e-9936-c39a10fdeae7" +PlotlyBase = "a03496cd-edff-5a9b-9e67-9cda94a718b5" +PlotlyKaleido = "f2990250-8cf9-495f-b13a-cce12b45703c" +Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + [targets] -test = ["Test", "Plots"] +test = ["Test", "Plotly", "PlotlyBase", "PlotlyKaleido", "Plots"] diff --git a/test/runtests.jl b/test/runtests.jl index 62fa838..b90fa93 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -41,23 +41,23 @@ using Plots @test BuildkiteUtils.artifact_search("*") == [] p = plot(identity, sin, -2pi, 2pi) - png(p, joinpath(dir, "sin x.png")) + svg(p, joinpath(dir, "sin x.svg")) cd(dir) do - BuildkiteUtils.artifact_upload("*.png") + BuildkiteUtils.artifact_upload("*.svg") BuildkiteUtils.artifact_upload("**/*.txt") end - @test sort(BuildkiteUtils.artifact_search()) == sort(["sin x.png", "extra/step.txt"]) + @test sort(BuildkiteUtils.artifact_search()) == sort(["sin x.svg", "extra/step.txt"]) newdir = mktempdir() - BuildkiteUtils.artifact_download("*.png", newdir; step=step) - @test readdir(newdir) == ["sin x.png"] - @test read(joinpath(dir, "sin x.png")) == read(joinpath(newdir, "sin x.png")) + BuildkiteUtils.artifact_download("*.svg", newdir; step=step) + @test readdir(newdir) == ["sin x.svg"] + @test read(joinpath(dir, "sin x.svg")) == read(joinpath(newdir, "sin x.svg")) else - @test sort(BuildkiteUtils.artifact_search(step="linux-latest")) == sort(["sin x.png", "extra/step.txt"]) + @test sort(BuildkiteUtils.artifact_search(step="linux-latest")) == sort(["sin x.svg", "extra/step.txt"]) @test isempty(BuildkiteUtils.artifact_search(step=step)) cd(dir) do @@ -71,8 +71,8 @@ using Plots end newdir = mktempdir() - BuildkiteUtils.artifact_download("*.png", newdir; step="linux-latest") - @test readdir(newdir) == ["sin x.png"] + BuildkiteUtils.artifact_download("*.svg", newdir; step="linux-latest") + @test readdir(newdir) == ["sin x.svg"] end end @@ -82,7 +82,7 @@ end BuildkiteUtils.annotate(""" Success! - sin(x) + sin(x) """; style="success", context="xtra") elseif step == "linux-v1.6" From b06f59c92d6f82ac2aa528f136e0b2bdc4ac509a Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Sat, 15 Oct 2022 17:09:29 -0700 Subject: [PATCH 2/3] fix deps, try html as well --- Project.toml | 3 +-- test/runtests.jl | 15 +++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Project.toml b/Project.toml index 9600bf5..f048098 100644 --- a/Project.toml +++ b/Project.toml @@ -7,11 +7,10 @@ version = "0.1.0" julia = "1.6" [extras] -Plotly = "58dd65bb-95f3-509e-9936-c39a10fdeae7" PlotlyBase = "a03496cd-edff-5a9b-9e67-9cda94a718b5" PlotlyKaleido = "f2990250-8cf9-495f-b13a-cce12b45703c" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Test", "Plotly", "PlotlyBase", "PlotlyKaleido", "Plots"] +test = ["Test", "PlotlyBase", "PlotlyKaleido", "Plots"] diff --git a/test/runtests.jl b/test/runtests.jl index b90fa93..b340681 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -30,6 +30,8 @@ end using Plots +plotly() + @testset "artifact" begin dir = mktempdir() subdir = joinpath(dir, "extra") @@ -39,16 +41,19 @@ using Plots if step == "linux-latest" @test BuildkiteUtils.artifact_search("*") == [] + X = range(-2pi,2pi,length=30) + p = plot(X, sin.(X)) - p = plot(identity, sin, -2pi, 2pi) - svg(p, joinpath(dir, "sin x.svg")) + savefig(p, joinpath(dir, "sin x.html")) + savefig(p, joinpath(dir, "sin x.svg")) cd(dir) do BuildkiteUtils.artifact_upload("*.svg") + BuildkiteUtils.artifact_upload("*.html") BuildkiteUtils.artifact_upload("**/*.txt") end - @test sort(BuildkiteUtils.artifact_search()) == sort(["sin x.svg", "extra/step.txt"]) + @test sort(BuildkiteUtils.artifact_search()) == sort(["sin x.html", "sin x.svg", "extra/step.txt"]) newdir = mktempdir() BuildkiteUtils.artifact_download("*.svg", newdir; step=step) @@ -57,7 +62,7 @@ using Plots else - @test sort(BuildkiteUtils.artifact_search(step="linux-latest")) == sort(["sin x.svg", "extra/step.txt"]) + @test sort(BuildkiteUtils.artifact_search(step="linux-latest")) == sort(["sin x.html", "sin x.svg", "extra/step.txt"]) @test isempty(BuildkiteUtils.artifact_search(step=step)) cd(dir) do @@ -83,6 +88,8 @@ end Success! sin(x) + + """; style="success", context="xtra") elseif step == "linux-v1.6" From 0b55134126e8c4281a279a80635f83b96777eab0 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Sat, 15 Oct 2022 20:46:40 -0700 Subject: [PATCH 3/3] try link --- test/runtests.jl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index b340681..f3b1f03 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -87,9 +87,7 @@ end BuildkiteUtils.annotate(""" Success! - sin(x) - - + sin(x) """; style="success", context="xtra") elseif step == "linux-v1.6"