-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Aqua tests #662
base: master
Are you sure you want to change the base?
Add Aqua tests #662
Changes from 4 commits
5639465
4fae6eb
7a4fe94
75416f2
7d7dc43
9d24e2e
15bdd61
be2f879
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
module AquaTest | ||
|
||
using Test | ||
using ForwardDiff | ||
using Aqua | ||
|
||
@testset "Aqua tests - unbound_args" begin | ||
# This tests that we don't accidentally run into | ||
# https://github.com/JuliaLang/julia/issues/29393 | ||
ua = Aqua.detect_unbound_args_recursively(ForwardDiff) | ||
@test length(ua) == 6 | ||
end | ||
|
||
@testset "Aqua tests - ambiguities" begin | ||
# See: https://github.com/SciML/OrdinaryDiffEq.jl/issues/1750 | ||
# Test that we're not introducing method ambiguities across deps | ||
ambs = Aqua.detect_ambiguities(ForwardDiff; recursive = true) | ||
pkg_match(pkgname, pkdir::Nothing) = false | ||
pkg_match(pkgname, pkdir::AbstractString) = occursin(pkgname, pkdir) | ||
filter!(x -> pkg_match("ForwardDiff", pkgdir(last(x).module)), ambs) | ||
|
||
@test length(ambs) == 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wasn't able to reproduce this locally for 1.10. One of the ambiguities that I'm seeing on 1.6, I'm not sure that adding the dependency is worth it? I suppose we could add it as an extension, but I'd rather address that in a followup PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just run the Aqua tests first, before StaticArrays etc are loaded (I think StaticArrays or some other test dependency might pull in ChainRulesCore?). If only ForwardDiff, Aqua, and Test are loaded such indirect issues should not show up. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done, let's see what happens. Hmm, I'm getting the same thing locally (6 ambiguities). |
||
end | ||
|
||
@testset "Aqua tests - remaining" begin | ||
Aqua.test_all(ForwardDiff; ambiguities = false, unbound_args = false) | ||
end | ||
|
||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally the unbound arguments should be fixed, which would also allow us to just run the default
Aqua.test_all
test withunbound_args = true
below instead of this custom test.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These ambiguities seem to be upstream issues. See JuliaTesting/Aqua.jl#86 and JuliaLang/julia#28086.
We can "fix" this (I'm not 100% sure if the issue is here or upstream, even based on discussions) by changing e.g.,
to
Should I move forward with those changes?