-
Notifications
You must be signed in to change notification settings - Fork 36
Refactors the test suite #63
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
Conversation
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.
Thanks for the cleaning! See just my comment on the include. It will avoid having to add each new file separately
@testset "distances" begin | ||
include(joinpath("distances", "dotproduct.jl")) | ||
include(joinpath("distances", "delta.jl")) | ||
end | ||
|
||
@testset "transform" begin | ||
include(joinpath("transform", "scaletransform.jl")) | ||
include(joinpath("transform", "ardtransform.jl")) | ||
include(joinpath("transform", "lowranktransform.jl")) | ||
include(joinpath("transform", "functiontransform.jl")) | ||
include(joinpath("transform", "selecttransform.jl")) | ||
include(joinpath("transform", "chaintransform.jl")) | ||
include(joinpath("transform", "transform.jl")) | ||
end | ||
|
||
@testset "kernels" begin | ||
include(joinpath("kernels", "exponential.jl")) | ||
include(joinpath("kernels", "matern.jl")) | ||
include(joinpath("kernels", "polynomial.jl")) | ||
include(joinpath("kernels", "constant.jl")) | ||
include(joinpath("kernels", "rationalquad.jl")) | ||
include(joinpath("kernels", "exponentiated.jl")) | ||
include(joinpath("kernels", "cosine.jl")) | ||
include(joinpath("kernels", "transformedkernel.jl")) | ||
include(joinpath("kernels", "scaledkernel.jl")) | ||
include(joinpath("kernels", "kernelsum.jl")) | ||
include(joinpath("kernels", "kernelproduct.jl")) | ||
|
||
# Legacy tests that don't correspond to anything meaningful in src. Unclear how | ||
# helpful these are. | ||
include(joinpath("kernels", "custom.jl")) | ||
end | ||
|
||
@testset "matrix" begin | ||
include(joinpath("matrix", "kernelmatrix.jl")) | ||
include(joinpath("matrix", "kernelkroneckermat.jl")) | ||
include(joinpath("matrix", "kernelpdmat.jl")) | ||
end | ||
|
||
@testset "approximations" begin | ||
include(joinpath("approximations", "nystrom.jl")) | ||
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.
Replace each list of include by
for f in readdir(folder)
include(joinpath(folder,f))
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.
Ah, yeah, I specifically don't want to do that. See here
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.
Looks like I stopped reading after point 5 😅
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.
Nice and clear test setup, in particular I like the detailed instructions and motivation for the approach!
Just wanted to add that I was a bit surprised about point 8 (all using
statements in the runtests.jl file) since that means it's not possible anymore to run each test file separately. Additionally, I'm a fan of using SafeTestsets to avoid/limit the interactions between different test files. Maybe that could be useful here as well?
Ah, interesting -- I had not come across As regards testing individual files, my preferred workflow is simply to comment out tests that you don't want to run during development. The benefit of having all of the |
That's exactly why I like SafeTestsets - you can keep the
If you want to be able to run each test file separately, you have to add |
@devmotion I think you've got some really good points. Would you be happy for us to merge this, and you to open another PR with the proposed approach? I would like to get this in so that I can push on some other stuff concurrently. |
Sure, go ahead! |
Doesn't modify any of the tests beyond adding the occasional random number generator explicitly.
Now that we're having more contributions to the repo, it makes sense to formalise the structure of our tests. The one I'm proposing is widely used and I have always found it to work well.
edit:
I appear to have lost two tests somewhere, but I'm not sure where 😬I found them, and some extra ones!