From 13e8c8b219b689ea653c2f7e7c356d7939635e68 Mon Sep 17 00:00:00 2001 From: Jonas Schumacher Date: Thu, 28 Sep 2023 11:05:48 +0200 Subject: [PATCH] Switch to Scratch and Artifacts (#16) --- Project.toml | 4 +++- test/Artifacts.toml | 6 ++++++ test/idealGradientField.h5 | Bin 7416 -> 0 bytes test/runtests.jl | 22 ++++++++++++++-------- 4 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 test/Artifacts.toml delete mode 100644 test/idealGradientField.h5 diff --git a/Project.toml b/Project.toml index d528728..f37b3c8 100644 --- a/Project.toml +++ b/Project.toml @@ -23,7 +23,9 @@ julia = "1" [extras] Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" +Scratch = "6c6a2e73-6563-6170-7368-637461726353" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Aqua", "Test"] +test = ["Aqua", "Artifacts", "Scratch", "Test"] diff --git a/test/Artifacts.toml b/test/Artifacts.toml new file mode 100644 index 0000000..3055287 --- /dev/null +++ b/test/Artifacts.toml @@ -0,0 +1,6 @@ +[testData] +git-tree-sha1 = "0b86feae2df3679403e813226d46395e9d5f5bad" + + [[testData.download]] + sha256 = "dd3d78a99d77a5cf8c4575637ee481010d8062e4d90a1358cfda85e6570cc973" + url = "https://gist.github.com/jonschumacher/8e6ff8e2245f9820412864af7d3708e4/raw/0b86feae2df3679403e813226d46395e9d5f5bad.tar.gz" diff --git a/test/idealGradientField.h5 b/test/idealGradientField.h5 deleted file mode 100644 index dfb528d3d3047951937a3cf85e7662e4507496c0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7416 zcmeHMZ){XW5Z~9<>)iqIuCywpAxBy&f(Z>aMiQDmlU7fSK=`8#i3ykXN)MXr_1;wp zDk*13t~QY>4Jn4wrnJi6q(~$n!h(FDfkJA+pMV-0{Q~l(QLB)spF4d&lFkZLwfJ1#6UxN(|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kA&xuOJW>c_0F#eXk5s!2zG5_uoW)uZ&f4A`5 z8;O&rgF(r8WUd;};5Pufmp@>BazE9)(t&x!hsXd)&MVdTjZb!GEIgCzpoo`C%c-c1 XL;@AE)Vea_59u|2*^J{43pD&La_tj# diff --git a/test/runtests.jl b/test/runtests.jl index 92aef06..b1e432a 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -4,13 +4,20 @@ using MPIFiles using SphericalHarmonicExpansions using Test using Aqua +using Artifacts +using Scratch + +const datadir = artifact"testData" +@info "The test data is located at $datadir." + +const tmpdir = @get_scratch!("tmp") +@info "If you want to check the output of the tests, please head to $tmpdir." @testset "MPISphericalHarmonics.jl" begin @testset "Aqua" begin Aqua.test_all(MPISphericalHarmonics, ambiguities=false) end - @testset "Ideal Coefficents" begin ## Calculate some field values @@ -52,7 +59,6 @@ using Aqua @test_throws DimensionMismatch MPISphericalHarmonics.magneticField(coords, fieldValues[:,1:end-1], R, center, L) # number of field values != number of measured positions end - @testset "MagneticFieldCoefficients" begin ## Test Constructor @@ -168,7 +174,7 @@ using Aqua ɛ = eps(Float64) ## measurement data (without coefficients) - filename = "idealGradientField.h5" + filename = joinpath(datadir, "idealGradientField.h5") field = SphericalHarmonicsDefinedField(filename) @test isapprox(field[0.01,0.01,0.01], [-0.01,-0.01,0.02], atol=ε) @@ -181,11 +187,11 @@ using Aqua ## load coefficients from file # write coefficients in file - filename2 = "Coeffs.h5" - filename3 = "Coeffs2.h5" - filename4 = "Coeffs3.h5" - filenameW = "CoeffsW.h5" - filenameE = "CoeffsE.h5" + filename2 = joinpath(tmpdir, "Coeffs.h5") + filename3 = joinpath(tmpdir, "Coeffs2.h5") + filename4 = joinpath(tmpdir, "Coeffs3.h5") + filenameW = joinpath(tmpdir, "CoeffsW.h5") + filenameE = joinpath(tmpdir, "CoeffsE.h5") write(filename2, coeffsMF.coeffs) # add radius and center cp(filename2, filename3)