From cf919a2c0c1099bd1d68cef61c327de32347e042 Mon Sep 17 00:00:00 2001 From: lrennels Date: Mon, 14 Jun 2021 18:30:30 -0700 Subject: [PATCH 1/3] Update contrib testing branches --- contrib/test_all_models.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/test_all_models.jl b/contrib/test_all_models.jl index 306755b08..986c025fe 100644 --- a/contrib/test_all_models.jl +++ b/contrib/test_all_models.jl @@ -15,12 +15,12 @@ pkg_that_errored = [] # first set of packages to test packages_to_test = [ - "MimiDICE2010" => ("https://github.com/anthofflab/MimiDICE2010.jl", "df"), # note here we use the df branch - "MimiDICE2013" => ("https://github.com/anthofflab/MimiDICE2013.jl", "df"), # note here we use the df branch + "MimiDICE2010" => ("https://github.com/anthofflab/MimiDICE2010.jl", "master"), + "MimiDICE2013" => ("https://github.com/anthofflab/MimiDICE2013.jl", "master"), "MimiDICE2016" => ("https://github.com/AlexandrePavlov/MimiDICE2016.jl", "master"), "MimiDICE2016R2" => ("https://github.com/anthofflab/MimiDICE2016R2.jl", "master"), "MimiRICE2010" => ("https://github.com/anthofflab/MimiRICE2010.jl", "master"), - "MimiFUND" => ("https://github.com/fund-model/MimiFUND.jl", "mcs"), # note here we use the mcs branch + "MimiFUND" => ("https://github.com/fund-model/MimiFUND.jl", "master"), "MimiPAGE2009" => ("https://github.com/anthofflab/MimiPAGE2009.jl", "mcs"), # note here we use the mcs branch "MimiPAGE2020" => ("https://github.com/lrennels/MimiPAGE2020.jl", "mcs"), # note using lrennels fork mcs branch, and testing this takes a LONG time :) "MimiSNEASY" => ("https://github.com/anthofflab/MimiSNEASY.jl", "master"), @@ -61,7 +61,7 @@ end # test separately because needs MimiFUND 3.8.6 packages_to_test = [ - "MimiIWG" => ("https://github.com/rffscghg/MimiIWG.jl", "mcs") # note here we use the mcs branch + "MimiIWG" => ("https://github.com/rffscghg/MimiIWG.jl", "master") ] mktempdir() do folder_name From 2c5635b3ac01f7d7ca59bea4fc3591f86792cbcd Mon Sep 17 00:00:00 2001 From: lrennels Date: Tue, 6 Jul 2021 21:26:50 -0700 Subject: [PATCH 2/3] Use master instead of mcs branch in testing of models --- contrib/test_all_models.jl | 12 +++--- test/test_dependencies.jl | 81 -------------------------------------- 2 files changed, 6 insertions(+), 87 deletions(-) delete mode 100644 test/test_dependencies.jl diff --git a/contrib/test_all_models.jl b/contrib/test_all_models.jl index 306755b08..7605baa36 100644 --- a/contrib/test_all_models.jl +++ b/contrib/test_all_models.jl @@ -15,18 +15,18 @@ pkg_that_errored = [] # first set of packages to test packages_to_test = [ - "MimiDICE2010" => ("https://github.com/anthofflab/MimiDICE2010.jl", "df"), # note here we use the df branch - "MimiDICE2013" => ("https://github.com/anthofflab/MimiDICE2013.jl", "df"), # note here we use the df branch + "MimiDICE2010" => ("https://github.com/anthofflab/MimiDICE2010.jl", "master") + "MimiDICE2013" => ("https://github.com/anthofflab/MimiDICE2013.jl", "master"), "MimiDICE2016" => ("https://github.com/AlexandrePavlov/MimiDICE2016.jl", "master"), "MimiDICE2016R2" => ("https://github.com/anthofflab/MimiDICE2016R2.jl", "master"), "MimiRICE2010" => ("https://github.com/anthofflab/MimiRICE2010.jl", "master"), - "MimiFUND" => ("https://github.com/fund-model/MimiFUND.jl", "mcs"), # note here we use the mcs branch - "MimiPAGE2009" => ("https://github.com/anthofflab/MimiPAGE2009.jl", "mcs"), # note here we use the mcs branch + "MimiFUND" => ("https://github.com/fund-model/MimiFUND.jl", "master"), + "MimiPAGE2009" => ("https://github.com/anthofflab/MimiPAGE2009.jl", "master"), "MimiPAGE2020" => ("https://github.com/lrennels/MimiPAGE2020.jl", "mcs"), # note using lrennels fork mcs branch, and testing this takes a LONG time :) "MimiSNEASY" => ("https://github.com/anthofflab/MimiSNEASY.jl", "master"), "MimiFAIR" => ("https://github.com/anthofflab/MimiFAIR.jl", "master"), "MimiMAGICC" => ("https://github.com/anthofflab/MimiMAGICC.jl", "master"), - "MimiHector" => ("https://github.com/anthofflab/MimiHector.jl", "master"), + "MimiHector" => ("https://github.com/anthofflab/MimiHector.jl", "master") ] mktempdir() do folder_name @@ -61,7 +61,7 @@ end # test separately because needs MimiFUND 3.8.6 packages_to_test = [ - "MimiIWG" => ("https://github.com/rffscghg/MimiIWG.jl", "mcs") # note here we use the mcs branch + "MimiIWG" => ("https://github.com/rffscghg/MimiIWG.jl", "master") ] mktempdir() do folder_name diff --git a/test/test_dependencies.jl b/test/test_dependencies.jl deleted file mode 100644 index 182c1fd24..000000000 --- a/test/test_dependencies.jl +++ /dev/null @@ -1,81 +0,0 @@ -using Pkg -Pkg.add("InfoZIP") -Pkg.add("ExcelReaders") -Pkg.add("DataFrames") -Pkg.add("CSVFiles") -Pkg.add("CSV") -Pkg.add("StatsBase") -Pkg.add("Distributions") - -using Mimi -using InfoZIP - -function isa_url(x) - return startswith(x, "https:") -end - -#list of URLs of branches of packages to test -dependencies = [ - "https://github.com/fund-model/fund/archive/1768edf12aaaac3a41bbea081d5b51299121f993.zip", - "https://github.com/anthofflab/mimi-rice-2010.jl/archive/2b5996b0a0c8be92290991f045c43af425c5a9c8.zip" -] - -function run_dependency_tests(dependencies=dependencies) - #list of failed tests to build as you go - errors = [] - #make a temporary directory to run the tests in - tmp_path = joinpath(@__DIR__,"tmp_testing/") - mkdir(tmp_path) - - #loop through each dependent package - for d in dependencies - if isa_url(d) - zip_name = chomp(basename(d)) - zip_file_path = joinpath(tmp_path, zip_name) - download(d, zip_file_path) - InfoZIP.unzip(zip_file_path, tmp_path) - rm(zip_file_path) - #find the name of the unzipped package (this only works if the zip archive only has one directory, the package) - package_name = readdir(tmp_path)[1] - file_path = string(tmp_path, package_name) - else - package_name = basename(d) - file_path = d - end - - #first check for mimitests.jl, if not found default to runtests.jl - if "mimitests.jl" in readdir(string(file_path, "/test/")) - process = string(file_path, "/test/mimitests.jl") - else - process = string(file_path, "/test/runtests.jl") - end - - #test the package - try - run(`$(Sys.BINDIR)/julia $process`) - catch e - append!(errors, [(package_name, e)]) - end - #delete current package before testing next one (if it was a downloaded package) - if isa_url(d) - rm(joinpath(tmp_path, package_name), recursive=true) - end - end - - #remove the temporary directory - rm(tmp_path, recursive=true) - - #report the errors that occurred - num_errors = length(errors) - error_message = "Failed tests: $num_errors" - - for (package_name, error) in errors - error_message = string(error_message, "\n", "error in $package_name:", error) - end - - if num_errors > 0 - error(error_message) - else - @info "All dependency tests passed." - end -end From 1975979c5e744f705bea87e2a7bd1ceddeeacac4 Mon Sep 17 00:00:00 2001 From: Lisa Rennels <31779240+lrennels@users.noreply.github.com> Date: Thu, 8 Jul 2021 16:30:57 -0700 Subject: [PATCH 3/3] Update test_all_models.jl --- contrib/test_all_models.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/test_all_models.jl b/contrib/test_all_models.jl index 7605baa36..dbf1eccb7 100644 --- a/contrib/test_all_models.jl +++ b/contrib/test_all_models.jl @@ -22,7 +22,7 @@ packages_to_test = [ "MimiRICE2010" => ("https://github.com/anthofflab/MimiRICE2010.jl", "master"), "MimiFUND" => ("https://github.com/fund-model/MimiFUND.jl", "master"), "MimiPAGE2009" => ("https://github.com/anthofflab/MimiPAGE2009.jl", "master"), - "MimiPAGE2020" => ("https://github.com/lrennels/MimiPAGE2020.jl", "mcs"), # note using lrennels fork mcs branch, and testing this takes a LONG time :) + "MimiPAGE2020" => ("https://github.com/lrennels/MimiPAGE2020.jl", "master"), "MimiSNEASY" => ("https://github.com/anthofflab/MimiSNEASY.jl", "master"), "MimiFAIR" => ("https://github.com/anthofflab/MimiFAIR.jl", "master"), "MimiMAGICC" => ("https://github.com/anthofflab/MimiMAGICC.jl", "master"),