From 90f7e370f38849334764a004ad9feadc0a8f147a Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Fri, 2 Jun 2017 14:58:49 +0200 Subject: [PATCH 1/2] make tests pass for gr and pyplot cf. #877 --- test/imgcomp.jl | 2 +- test/install_wkhtmltoimage.sh | 8 ++-- test/runtests.jl | 71 ++++++++++++++++++++++++++++------- test/travis_commands.jl | 15 +++++--- 4 files changed, 72 insertions(+), 24 deletions(-) diff --git a/test/imgcomp.jl b/test/imgcomp.jl index 890c374b..1934e6b6 100644 --- a/test/imgcomp.jl +++ b/test/imgcomp.jl @@ -13,7 +13,7 @@ try end -using Plots +# using Plots # reexported by StatPlots using StatPlots using FactCheck using Glob diff --git a/test/install_wkhtmltoimage.sh b/test/install_wkhtmltoimage.sh index b265d183..6fdf0d69 100755 --- a/test/install_wkhtmltoimage.sh +++ b/test/install_wkhtmltoimage.sh @@ -5,9 +5,11 @@ set -ex sudo apt-get -qq update # sudo apt-get install -y wkhtmltopdf -sudo apt-get install -y xfonts-75dpi -wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2/wkhtmltox-0.12.2_linux-trusty-amd64.deb -sudo dpkg -i wkhtmltox-0.12.2_linux-trusty-amd64.deb +sudo apt-get install -y xfonts-base +wget https://downloads.wkhtmltopdf.org/0.12/0.12.2/wkhtmltox-0.12.2_linux-precise-amd64.deb +sudo dpkg -i wkhtmltox-0.12.2_linux-precise-amd64.deb +# wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2/wkhtmltox-0.12.2_linux-trusty-amd64.deb +# sudo dpkg -i wkhtmltox-0.12.2_linux-trusty-amd64.deb wkhtmltoimage http://www.google.com test.png ls diff --git a/test/runtests.jl b/test/runtests.jl index dd0d4adf..1232915c 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -19,31 +19,74 @@ img_eps = isinteractive() ? 1e-2 : 10e-2 # image_comparison_facts(:gadfly, skip=[4,6,23,24,27], eps=img_eps) # end -facts("PyPlot") do - @fact pyplot() --> Plots.PyPlotBackend() - @fact backend() --> Plots.PyPlotBackend() - - image_comparison_facts(:pyplot, skip=[6,25,30,31], eps=img_eps) -end facts("GR") do @fact gr() --> Plots.GRBackend() @fact backend() --> Plots.GRBackend() - if is_linux() && isinteractive() - image_comparison_facts(:gr, skip=[2,25,30,31], eps=img_eps) - end + image_comparison_facts(:gr, eps=img_eps) end -facts("Plotly") do - @fact plotly() --> Plots.PlotlyBackend() - @fact backend() --> Plots.PlotlyBackend() - # # until png generation is reliable on OSX, just test on linux - # @static is_linux() && image_comparison_facts(:plotly, only=[1,3,4,7,8,9,10,11,12,14,15,20,22,23,27], eps=img_eps) +facts("PyPlot") do + @fact pyplot() --> Plots.PyPlotBackend() + @fact backend() --> Plots.PyPlotBackend() + + image_comparison_facts(:pyplot, eps=img_eps) end +# The plotlyjs testimages return a connection error on travis: +# connect: connection refused (ECONNREFUSED) + +# facts("PlotlyJS") do +# @fact plotlyjs() --> Plots.PlotlyJSBackend() +# @fact backend() --> Plots.PlotlyJSBackend() +# +# if is_linux() && isinteractive() +# image_comparison_facts(:plotlyjs, +# skip=[ +# 2, # animation (skipped for speed) +# 27, # (polar plots) takes very long / not working +# 31, # animation (skipped for speed) +# ], +# eps=img_eps) +# end +# end + + +# InspectDR returns that error on travis: +# ERROR: LoadError: InitError: Cannot open display: +# in Gtk.GLib.GError(::Gtk.##229#230) at /home/travis/.julia/v0.5/Gtk/src/GLib/gerror.jl:17 + +# facts("InspectDR") do +# @fact inspectdr() --> Plots.InspectDRBackend() +# @fact backend() --> Plots.InspectDRBackend() +# +# image_comparison_facts(:inspectdr, +# skip=[ +# 2, # animation +# 6, # heatmap not defined +# 10, # heatmap not defined +# 22, # contour not defined +# 23, # pie not defined +# 27, # polar plot not working +# 28, # heatmap not defined +# 31, # animation +# ], +# eps=img_eps) +# end + + +# facts("Plotly") do +# @fact plotly() --> Plots.PlotlyBackend() +# @fact backend() --> Plots.PlotlyBackend() +# +# # # until png generation is reliable on OSX, just test on linux +# # @static is_linux() && image_comparison_facts(:plotly, only=[1,3,4,7,8,9,10,11,12,14,15,20,22,23,27], eps=img_eps) +# end + + # facts("Immerse") do # @fact immerse() --> Plots.ImmerseBackend() # @fact backend() --> Plots.ImmerseBackend() diff --git a/test/travis_commands.jl b/test/travis_commands.jl index d0ff84bd..f3abd0fb 100644 --- a/test/travis_commands.jl +++ b/test/travis_commands.jl @@ -1,8 +1,8 @@ -# Pkg.clone("ImageMagick") -# Pkg.build("ImageMagick") +Pkg.clone("ImageMagick") +Pkg.build("ImageMagick") -# Pkg.clone("GR") -# Pkg.build("GR") +Pkg.clone("GR") +Pkg.build("GR") Pkg.clone("https://github.com/JuliaPlots/PlotReferenceImages.jl.git") @@ -11,11 +11,12 @@ Pkg.clone("https://github.com/JuliaPlots/PlotReferenceImages.jl.git") Pkg.clone("StatPlots") Pkg.checkout("PlotUtils") -# Pkg.clone("https://github.com/JunoLab/Blink.jl.git") +# Pkg.clone("Blink") # Pkg.build("Blink") # import Blink # Blink.AtomShell.install() -# Pkg.clone("https://github.com/spencerlyon2/PlotlyJS.jl.git") +# Pkg.add("Rsvg") +# Pkg.add("PlotlyJS") # Pkg.checkout("RecipesBase") # Pkg.clone("VisualRegressionTests") @@ -25,4 +26,6 @@ ENV["PYTHON"] = "" Pkg.add("PyPlot") Pkg.build("PyPlot") +# Pkg.add("InspectDR") + Pkg.test("Plots"; coverage=false) From 6156228c8941726465b14b7bb9cf96499b3bf7ed Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Fri, 2 Jun 2017 15:07:17 +0200 Subject: [PATCH 2/2] install xfonts-75dpi for whtmltox --- test/install_wkhtmltoimage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/install_wkhtmltoimage.sh b/test/install_wkhtmltoimage.sh index 6fdf0d69..061cf606 100755 --- a/test/install_wkhtmltoimage.sh +++ b/test/install_wkhtmltoimage.sh @@ -5,7 +5,7 @@ set -ex sudo apt-get -qq update # sudo apt-get install -y wkhtmltopdf -sudo apt-get install -y xfonts-base +sudo apt-get install -y xfonts-75dpi xfonts-base wget https://downloads.wkhtmltopdf.org/0.12/0.12.2/wkhtmltox-0.12.2_linux-precise-amd64.deb sudo dpkg -i wkhtmltox-0.12.2_linux-precise-amd64.deb # wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2/wkhtmltox-0.12.2_linux-trusty-amd64.deb