-
Notifications
You must be signed in to change notification settings - Fork 194
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 more aqua tests #892
Add more aqua tests #892
Changes from all commits
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[deps] | ||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" | ||
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" | ||
StatsAPI = "82ae8749-77ed-4fe6-ae5f-f523153014b0" | ||
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" | ||
|
||
[compat] | ||
Documenter = "0.27" |
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,36 @@ | ||||||||||||||
using Test | ||||||||||||||
using StatsBase | ||||||||||||||
using Aqua | ||||||||||||||
|
||||||||||||||
@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(StatsBase) | ||||||||||||||
ua = Aqua.detect_unbound_args_recursively(StatsBase) | ||||||||||||||
@test length(ua) == 0 | ||||||||||||||
|
||||||||||||||
# See: https://github.com/SciML/OrdinaryDiffEq.jl/issues/1750 | ||||||||||||||
# Test that we're not introducing method ambiguities across deps | ||||||||||||||
ambs = Aqua.detect_ambiguities(StatsBase; recursive = true) | ||||||||||||||
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. Why do we want to test ambiguities recursively? It's generally argued against that in JuliaTesting/Aqua.jl#77 (and against the default setting of testing 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 figured that it was more thorough.. I'm happy to change this to |
||||||||||||||
# Uncomment for debugging: | ||||||||||||||
# for method_ambiguity in ambs | ||||||||||||||
# @show method_ambiguity | ||||||||||||||
# end | ||||||||||||||
@test length(ambs) ≤ 5 | ||||||||||||||
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. Is there a simple way to check which functions are ambiguous? 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. We can use @test length(ambs) ≤ 5
@test_broken length(ambs) < 5 so that we're alerted when it's fixed. It's also just easier to spread across the ecosystem than to collect all the functions after printing them all out.. 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'm happy to change it if it means getting the PR merged. |
||||||||||||||
potentially_pirated_methods = Aqua.Piracy.hunt(StatsBase) | ||||||||||||||
# Uncomment for debugging: | ||||||||||||||
# for pirate in potentially_pirated_methods | ||||||||||||||
# @show pirate | ||||||||||||||
# end | ||||||||||||||
@test length(potentially_pirated_methods) ≤ 27 | ||||||||||||||
end | ||||||||||||||
|
||||||||||||||
@testset "Aqua tests (additional)" begin | ||||||||||||||
Aqua.test_undefined_exports(StatsBase) | ||||||||||||||
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 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. While I do like the idea of not missing out on new tests in the future, my issue with |
||||||||||||||
Aqua.test_stale_deps(StatsBase) | ||||||||||||||
Aqua.test_deps_compat(StatsBase) | ||||||||||||||
Aqua.test_project_extras(StatsBase) | ||||||||||||||
Aqua.test_project_toml_formatting(StatsBase) | ||||||||||||||
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's a bug currently and hence this should not be tested generally (see JuliaTesting/Aqua.jl#105). Hence I tend to use
Suggested change
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. Alternatively, I'm fine with commenting this out. |
||||||||||||||
end | ||||||||||||||
|
||||||||||||||
nothing |
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.
Can we just run the full Aqua test suite (see also my other comment below)? It's already included there by default: https://github.com/JuliaTesting/Aqua.jl/blob/3d5ed9fa2c915bbb06b2ef9037d57029d18bc8b5/src/unbound_args.jl#L36
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.
Yeah, I guess we can change it to the test function. I have my own gripe with that interface, tbh. JuliaTesting/Aqua.jl#180