From def5be630a217ea9ed60faf984c051cd12f37b6e Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Thu, 23 Aug 2018 14:18:45 -0700 Subject: [PATCH 01/11] Use Pkg3 API in travis_commands.jl --- test/travis_commands.jl | 49 ++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/test/travis_commands.jl b/test/travis_commands.jl index b4e6ff7e..cd6363ec 100644 --- a/test/travis_commands.jl +++ b/test/travis_commands.jl @@ -1,34 +1,29 @@ using Pkg -Pkg.add("ImageMagick") -Pkg.build("ImageMagick") - -# Pkg.clone("GR") -# Pkg.build("GR") - -Pkg.checkout("https://github.com/JuliaPlots/PlotReferenceImages.jl.git") - -# Pkg.clone("https://github.com/JuliaStats/KernelDensity.jl.git") - -# Pkg.add("StatPlots") -Pkg.checkout("PlotUtils") -Pkg.checkout("RecipesBase") - -# Pkg.clone("Blink") -# Pkg.build("Blink") -# import Blink -# Blink.AtomShell.install() -# Pkg.add("Rsvg") -# Pkg.add("PlotlyJS") - -# Pkg.checkout("RecipesBase") -# Pkg.clone("VisualRegressionTests") - # need this to use Conda # ENV["PYTHON"] = "" -# Pkg.add("PyPlot") + +Pkg.add([ + PackageSpec("ImageMagick"), + # PackageSpec("GR"), + PackageSpec(url="https://github.com/JuliaPlots/PlotReferenceImages.jl.git"), + PackageSpec("StatPlots"), + # PackageSpec(url="https://github.com/JuliaStats/KernelDensity.jl.git"), + PackageSpec(name="PlotUtils", rev="master"), + PackageSpec(name="RecipesBase", rev="master"), + # PackageSpec(name="Blink", rev="master"), + # PackageSpec(name="Rsvg", rev="master"), + # PackageSpec(name="PlotlyJS", rev="master"), + # PackageSpec(name="VisualRegressionTests", rev="master"), + # PackageSpec("PyPlot"), + # PackageSpec("InspectDR"), +]) + +Pkg.build("ImageMagick") +# Pkg.build("GR") +# Pkg.build("Blink") +# import Blink +# Blink.AtomShell.install() # Pkg.build("PyPlot") -# Pkg.add("InspectDR") - Pkg.test("Plots"; coverage=false) From 7fcd008f2ff319a21b65ef14722871a5ae804427 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Thu, 23 Aug 2018 14:32:05 -0700 Subject: [PATCH 02/11] Fix appveyor.yml --- appveyor.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index a626cae5..e43c45b6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -31,8 +31,12 @@ install: build_script: # Need to convert from shallow to complete for Pkg.clone to work - IF EXIST .git\shallow (git fetch --unshallow) - - C:\projects\julia\bin\julia -e "versioninfo(); Pkg.clone(pwd(), \"Plots\"); Pkg.build(\"Plots\")" + - C:\projects\julia\bin\julia -e " + using InteractiveUtils, Pkg; + versioninfo(); + Pkg.clone(pwd(), \"Plots\"); + Pkg.build(\"Plots\")" test_script: # - C:\projects\julia\bin\julia -e "Pkg.test(\"Plots\")" - - C:\projects\julia\bin\julia -e "include(Pkg.dir(\"Plots\", \"test\", \"travis_commands.jl\"))" + - C:\projects\julia\bin\julia test\travis_commands.jl From 4a51e4e7fb5fb5519dfc36ea55e1aa7ec7423c5f Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Thu, 23 Aug 2018 15:39:20 -0700 Subject: [PATCH 03/11] Import Random --- test/imgcomp.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/test/imgcomp.jl b/test/imgcomp.jl index abc08b13..ea15284c 100644 --- a/test/imgcomp.jl +++ b/test/imgcomp.jl @@ -15,6 +15,7 @@ using VisualRegressionTests using Plots # using StatPlots +using Random using Test default(size=(500,300)) From 374580a3d6735d97cd5e6ba85c039b28048ff1f4 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Thu, 23 Aug 2018 15:50:22 -0700 Subject: [PATCH 04/11] Import Pkg --- test/imgcomp.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/test/imgcomp.jl b/test/imgcomp.jl index ea15284c..b580b1a7 100644 --- a/test/imgcomp.jl +++ b/test/imgcomp.jl @@ -15,6 +15,7 @@ using VisualRegressionTests using Plots # using StatPlots +using Pkg using Random using Test From 80da14c1fbefcfd92329c32a445941fe84567c27 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Thu, 23 Aug 2018 21:01:56 -0700 Subject: [PATCH 05/11] Use pathof(PlotReferenceImages) instead of Pkg.dir --- test/imgcomp.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/imgcomp.jl b/test/imgcomp.jl index b580b1a7..0bec9b52 100644 --- a/test/imgcomp.jl +++ b/test/imgcomp.jl @@ -15,7 +15,7 @@ using VisualRegressionTests using Plots # using StatPlots -using Pkg +using PlotReferenceImages using Random using Test @@ -40,7 +40,7 @@ function image_comparison_tests(pkg::Symbol, idx::Int; debug = false, popup = is # reference image directory setup # refdir = joinpath(Pkg.dir("ExamplePlots"), "test", "refimg", string(pkg)) - refdir = Pkg.dir("PlotReferenceImages", "Plots", string(pkg)) + refdir = joinpath(dirname(pathof(PlotReferenceImages)), "..", "Plots", string(pkg)) fn = "ref$idx.png" # firgure out version info From e483ce85dcb3964e81ebe8300c75cc1a6a8a8b51 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Thu, 23 Aug 2018 21:02:48 -0700 Subject: [PATCH 06/11] Install unregistered packages in test/runtests.jl --- .travis.yml | 8 ++++---- appveyor.yml | 3 +-- test/{travis_commands.jl => add_packages.jl} | 5 ----- test/runtests.jl | 1 + 4 files changed, 6 insertions(+), 11 deletions(-) rename test/{travis_commands.jl => add_packages.jl} (85%) diff --git a/.travis.yml b/.travis.yml index fb9a97a2..31817d0b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,10 +43,10 @@ before_install: notifications: email: true # uncomment the following lines to override the default test script -script: - - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi - - julia -e 'import Pkg; Pkg.add(Pkg.PackageSpec(path=pwd())); Pkg.build("Plots")' - - julia test/travis_commands.jl +# script: + # - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi + # - julia -e 'import Pkg; Pkg.add(Pkg.PackageSpec(path=pwd())); Pkg.build("Plots")' + # - julia test/travis_commands.jl # - julia -e 'Pkg.clone("ImageMagick"); Pkg.build("ImageMagick")' # - julia -e 'Pkg.clone("GR"); Pkg.build("GR")' # # - julia -e 'Pkg.clone("https://github.com/tbreloff/ImageMagick.jl.git"); Pkg.checkout("ImageMagick","tb_write"); Pkg.build("ImageMagick")' diff --git a/appveyor.yml b/appveyor.yml index e43c45b6..15796f23 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -38,5 +38,4 @@ build_script: Pkg.build(\"Plots\")" test_script: - # - C:\projects\julia\bin\julia -e "Pkg.test(\"Plots\")" - - C:\projects\julia\bin\julia test\travis_commands.jl + - C:\projects\julia\bin\julia -e "using Pkg; Pkg.test(\"Plots\")" diff --git a/test/travis_commands.jl b/test/add_packages.jl similarity index 85% rename from test/travis_commands.jl rename to test/add_packages.jl index cd6363ec..655ec4d6 100644 --- a/test/travis_commands.jl +++ b/test/add_packages.jl @@ -4,10 +4,7 @@ using Pkg # ENV["PYTHON"] = "" Pkg.add([ - PackageSpec("ImageMagick"), - # PackageSpec("GR"), PackageSpec(url="https://github.com/JuliaPlots/PlotReferenceImages.jl.git"), - PackageSpec("StatPlots"), # PackageSpec(url="https://github.com/JuliaStats/KernelDensity.jl.git"), PackageSpec(name="PlotUtils", rev="master"), PackageSpec(name="RecipesBase", rev="master"), @@ -25,5 +22,3 @@ Pkg.build("ImageMagick") # import Blink # Blink.AtomShell.install() # Pkg.build("PyPlot") - -Pkg.test("Plots"; coverage=false) diff --git a/test/runtests.jl b/test/runtests.jl index fd9f00bf..61d0e049 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,5 +1,6 @@ module PlotsTests +include("add_packages.jl") include("imgcomp.jl") # don't actually show the plots From 531dd432841b5e864a8e49f49de4619199c572b0 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Thu, 23 Aug 2018 21:37:27 -0700 Subject: [PATCH 07/11] Add FileIO to test/REQUIRE --- test/REQUIRE | 1 + 1 file changed, 1 insertion(+) diff --git a/test/REQUIRE b/test/REQUIRE index 6cd6a973..a11706d9 100644 --- a/test/REQUIRE +++ b/test/REQUIRE @@ -2,6 +2,7 @@ StatPlots Images ImageMagick @osx QuartzImageIO +FileIO GR 0.31.0 RDatasets VisualRegressionTests From eefea1506912aebb8f961faff0b9bca30dca4ea4 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Thu, 23 Aug 2018 21:41:26 -0700 Subject: [PATCH 08/11] Don't use Base.mean --- src/Plots.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Plots.jl b/src/Plots.jl index 2b96c5cb..502996ba 100644 --- a/src/Plots.jl +++ b/src/Plots.jl @@ -116,7 +116,7 @@ ignorenan_minimum(x) = Base.minimum(x) ignorenan_maximum(x::AbstractArray{F}) where {F<:AbstractFloat} = NaNMath.maximum(x) ignorenan_maximum(x) = Base.maximum(x) ignorenan_mean(x::AbstractArray{F}) where {F<:AbstractFloat} = NaNMath.mean(x) -ignorenan_mean(x) = Base.mean(x) +ignorenan_mean(x) = mean(x) ignorenan_extrema(x::AbstractArray{F}) where {F<:AbstractFloat} = NaNMath.extrema(x) ignorenan_extrema(x) = Base.extrema(x) From ebf32390ef56f6a71cd54ddf4324031e67e35dc2 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Fri, 24 Aug 2018 17:16:05 -0700 Subject: [PATCH 09/11] Import Gtk in interactive session --- test/imgcomp.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/imgcomp.jl b/test/imgcomp.jl index 0bec9b52..8294c1f7 100644 --- a/test/imgcomp.jl +++ b/test/imgcomp.jl @@ -2,6 +2,10 @@ using VisualRegressionTests # using ExamplePlots +if isinteractive() + @eval Main import Gtk +end + # import DataFrames, RDatasets # don't let pyplot use a gui... it'll crash From 6d0d8ea90aefb3044c3d9778cfb6e7ff2c5ef11a Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sat, 25 Aug 2018 07:14:33 -0700 Subject: [PATCH 10/11] Use qualified name Statistics.mean --- src/Plots.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Plots.jl b/src/Plots.jl index 502996ba..e02cc169 100644 --- a/src/Plots.jl +++ b/src/Plots.jl @@ -116,7 +116,7 @@ ignorenan_minimum(x) = Base.minimum(x) ignorenan_maximum(x::AbstractArray{F}) where {F<:AbstractFloat} = NaNMath.maximum(x) ignorenan_maximum(x) = Base.maximum(x) ignorenan_mean(x::AbstractArray{F}) where {F<:AbstractFloat} = NaNMath.mean(x) -ignorenan_mean(x) = mean(x) +ignorenan_mean(x) = Statistics.mean(x) ignorenan_extrema(x::AbstractArray{F}) where {F<:AbstractFloat} = NaNMath.extrema(x) ignorenan_extrema(x) = Base.extrema(x) From e0f9313b8b22df896022274f3adf3516dae6eb89 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sat, 25 Aug 2018 07:15:24 -0700 Subject: [PATCH 11/11] Use import PlotReferenceImages --- test/imgcomp.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/imgcomp.jl b/test/imgcomp.jl index 8294c1f7..92841b92 100644 --- a/test/imgcomp.jl +++ b/test/imgcomp.jl @@ -19,7 +19,7 @@ end using Plots # using StatPlots -using PlotReferenceImages +import PlotReferenceImages using Random using Test