Skip to content
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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

charleskawczynski
Copy link
Contributor

This PR adds Aqua tests.

test/AquaTest.jl Outdated Show resolved Hide resolved
test/AquaTest.jl Outdated Show resolved Hide resolved
Copy link

codecov bot commented Jan 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d300209) 89.65% compared to head (1a99035) 7.87%.

❗ Current head 1a99035 differs from pull request most recent head 15bdd61. Consider uploading reports for the commit 15bdd61 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #662       +/-   ##
==========================================
- Coverage   89.65%   7.87%   -81.79%     
==========================================
  Files          11      11               
  Lines         967     927       -40     
==========================================
- Hits          867      73      -794     
- Misses        100     854      +754     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@hyrodium hyrodium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add the following badge to README.md?

[![Aqua QA](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl)

Aqua QA

test/AquaTest.jl Outdated Show resolved Hide resolved
@charleskawczynski
Copy link
Contributor Author

I'd appreciate feedback on what to do with the tests, here. From what I can see, it seems like CI is broken on master

Comment on lines +7 to +12
@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
Copy link
Member

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 with unbound_args = true below instead of this custom test.

Copy link
Contributor Author

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.,

@generated function one_tuple(::Type{NTuple{N,V}}) where {N, V}

to

@generated function one_tuple(::Type{Tuple{V,Vararg{R1,N}}) where {N, V}

Should I move forward with those changes?

test/AquaTest.jl Outdated
pkg_match(pkgname, pkdir::AbstractString) = occursin(pkgname, pkdir)
filter!(x -> pkg_match("ForwardDiff", pkgdir(last(x).module)), ambs)

@test length(ambs) == 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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, @inline Base.convert(::Type{Dual{T,V,N}}, x) where {T,V,N} = Dual{T}(V(x), zero(Partials{N,V})), can be eliminated, but we would need to depend on ChainRulesCore, and define @inline Base.convert(::Type{Dual{T,V,N}}, x::ChainRulesCore.AbstractZero) where {T,V,N} = Dual{T}(V(x), zero(Partials{N,V})) in order to do so.

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.

Copy link
Member

Choose a reason for hiding this comment

The 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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).

@charleskawczynski
Copy link
Contributor Author

bump

1 similar comment
@charleskawczynski
Copy link
Contributor Author

bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants