From 62a11ef3d0a8f0f11d8a058878b805eb4c6859e6 Mon Sep 17 00:00:00 2001 From: Tortar Date: Tue, 22 Oct 2024 22:37:52 +0200 Subject: [PATCH] Enable Aqua tests --- Project.toml | 8 +++--- README.md | 6 +++++ test/Project.toml | 21 +++++++++++++++ test/package_sanity_tests.jl | 7 +++++ test/runtests.jl | 50 ++++++++++++++++++++---------------- 5 files changed, 67 insertions(+), 25 deletions(-) create mode 100644 test/Project.toml create mode 100644 test/package_sanity_tests.jl diff --git a/Project.toml b/Project.toml index 9488478..ae4506c 100644 --- a/Project.toml +++ b/Project.toml @@ -8,7 +8,6 @@ Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819" -JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MAT = "23992714-dd62-5051-b70f-ba57cb901cac" MutableNamedTuples = "af6c499f-54b4-48cc-bbd2-094bba7533c7" @@ -16,14 +15,17 @@ Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd" -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [compat] +Dates = "1" Distributions = "0.25" FileIO = "1.16" JLD2 = "0.4" -JuliaFormatter = "1.0.56" +LinearAlgebra = "1" MAT = "0.10" MutableNamedTuples = "0.1.3" +Plots = "1" +Random = "1" StatsBase = "0.34" +StatsPlots = "0.15" julia = "1.9" diff --git a/README.md b/README.md index c2d6621..38b95a8 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ + +[![CI](https://github.com/bancaditalia/BeforeIT.jl/workflows/CI/badge.svg)](https://github.com/bancaditalia/BeforeIT.jl/actions?query=workflow%3ACI) +[![](https://img.shields.io/badge/docs-dev-blue.svg)](https://bancaditalia.github.io/BeforeIT.jl/dev/) +[![Aqua QA](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl) + +
diff --git a/test/Project.toml b/test/Project.toml new file mode 100644 index 0000000..02ac795 --- /dev/null +++ b/test/Project.toml @@ -0,0 +1,21 @@ + +[deps] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" +Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" +FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" +JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819" +JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899" +LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" +MAT = "23992714-dd62-5051-b70f-ba57cb901cac" +MutableNamedTuples = "af6c499f-54b4-48cc-bbd2-094bba7533c7" +Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" +Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" +StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" +StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[compat] +Aqua = "0.8" +JuliaFormatter = "1.0.56" +Test = "1" diff --git a/test/package_sanity_tests.jl b/test/package_sanity_tests.jl new file mode 100644 index 0000000..30408ad --- /dev/null +++ b/test/package_sanity_tests.jl @@ -0,0 +1,7 @@ + +using Aqua + +@testset "Code quality" begin + Aqua.test_all(BeforeIT, ambiguities = false, unbound_args = false) + @test Test.detect_ambiguities(BeforeIT) == Tuple{Method, Method}[] +end \ No newline at end of file diff --git a/test/runtests.jl b/test/runtests.jl index 2a81504..62612cc 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,27 +1,33 @@ + using BeforeIT, Test -#utils -include("utils/positive.jl") -include("utils/randpl.jl") -include("utils/nfvar3_and_estimate.jl") -include("utils/estimations.jl") - -# search_and_matching -include("markets/search_and_matching.jl") - -# agent_actions -@testset "test agent actions" begin - include("./agent_actions/bank.jl") - include("./agent_actions/central_bank.jl") - include("./agent_actions/firms.jl") - include("./agent_actions/estimations.jl") -end +@testset "BeforeIT.jl Tests" begin + + include("package_sanity_tests.jl") + + #utils + include("utils/positive.jl") + include("utils/randpl.jl") + include("utils/nfvar3_and_estimate.jl") + include("utils/estimations.jl") -# accounting identities -include("accounting_identities.jl") + # search_and_matching + include("markets/search_and_matching.jl") -# shock tests -include("shocks/shocks.jl") + # agent_actions + @testset "test agent actions" begin + include("./agent_actions/bank.jl") + include("./agent_actions/central_bank.jl") + include("./agent_actions/firms.jl") + include("./agent_actions/estimations.jl") + end -# WARNING: this should be the last include -include("deterministic/runtests_deterministic.jl") + # accounting identities + include("accounting_identities.jl") + + # shock tests + include("shocks/shocks.jl") + + # WARNING: this should be the last include + include("deterministic/runtests_deterministic.jl") +end