Skip to content

Commit

Permalink
Extend aqua tests
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskawczynski committed Sep 8, 2023
1 parent 11e1f1a commit a980608
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/nl_solvers/newtons_method.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ export NewtonsMethod, KrylovMethod
export JacobianFreeJVP, ForwardDiffJVP, ForwardDiffStepSize
export ForwardDiffStepSize1, ForwardDiffStepSize2, ForwardDiffStepSize3
export ForcingTerm, ConstantForcing, EisenstatWalkerForcing
export Verbosity

# TODO: Implement AutoDiffJVP after ClimaAtmos's cache is moved from f! to x (so
# that we only need to define Dual.(x), and not also make_dual(f!)).
Expand Down
32 changes: 27 additions & 5 deletions test/aqua.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,35 @@
using Aqua
using Test
using ClimaTimeSteppers
using Aqua

@testset "Aqua tests" begin
@testset "Aqua tests (performance)" begin
# This tests that we don't accidentally run into
# https://github.com/JuliaLang/julia/issues/29393
Aqua.test_unbound_args(ClimaTimeSteppers)
# Aqua.test_unbound_args(ClimaTimeSteppers)
ua = Aqua.detect_unbound_args_recursively(ClimaTimeSteppers)
@test length(ua) == 0

# See: https://github.com/SciML/OrdinaryDiffEq.jl/issues/1750
# Test that we're not introducing method ambiguities
@test isempty(Aqua.detect_ambiguities(ClimaTimeSteppers; recursive = true))
# Test that we're not introducing method ambiguities across deps
ambs = Aqua.detect_ambiguities(ClimaTimeSteppers; recursive = true)
pkg_match(pkgname, pkdir::Nothing) = false
pkg_match(pkgname, pkdir::AbstractString) = occursin(pkgname, pkdir)
filter!(x -> pkg_match("ClimaTimeSteppers", pkgdir(last(x).module)), ambs)

# Uncomment for debugging:
# for method_ambiguity in ambs
# @show method_ambiguity
# end
@test length(ambs) == 0
end

@testset "Aqua tests (additional)" begin
Aqua.test_undefined_exports(ClimaTimeSteppers)
Aqua.test_stale_deps(ClimaTimeSteppers)
Aqua.test_deps_compat(ClimaTimeSteppers)
Aqua.test_project_extras(ClimaTimeSteppers)
Aqua.test_project_toml_formatting(ClimaTimeSteppers)
Aqua.test_piracy(ClimaTimeSteppers)
end

nothing

0 comments on commit a980608

Please sign in to comment.