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

Move conformance tests into AA itself (possibly in a package extension) #1936

Open
fingolfin opened this issue Dec 19, 2024 · 4 comments
Open
Assignees

Comments

@fingolfin
Copy link
Member

fingolfin commented Dec 19, 2024

Right now, in order to run ring conformance tests in the REPL (e.g. to debug issues with them), one has to do something like this:

import AbstractAlgebra, Test
include(joinpath(pathof(AbstractAlgebra), "..", "..", "test", "Rings-conformance-tests.jl"))

before invoking e.g. test_Field_interface_recursive.

In many cases this then runs into an error because actually you also need to find and run one or more test_elem methods which are used by the conformance tests for the particular ring you are interested in.

All of this could be solved if we integrated Rings-conformance-tests.jl directly into AbstractAlgebra, so that its tests are available after using AbstractAlgebra.

This would require adding Test as a dependency. Doesn't seem like a major issue to me, but even that could be avoided by putting the code into a package extension (which would imply upping the minimal required Julia version to at least 1.9, IIRC).

Then packages like Nemo could do the same, and implement test_elem methods directly in the package (while we are at it, we could also rename test_elem, it was a bit of a spur of the moment decision to use that name -- as usual, naming things well is one of the hardest problems...)

Afterwards, you could just do

using Nemo, Test
test_Field_interface_recursive(GF(5))

or whatever, and it would "just work".

(This is idea is not new, and at the very least @lgoettgens also came up with essentially the same idea. But I realized now that we don't have an issue.)

@fingolfin fingolfin pinned this issue Dec 19, 2024
@fingolfin
Copy link
Member Author

Of course this is about all conformance tests: for rings, fields, matrix spaces, but also e.g. groups, and stuff we don't have yet.

@lgoettgens
Copy link
Collaborator

I am happy to look into doing this. I would try to first do this in a backwards-compatible way, i.e. that this still works using the current include in all julia versions back to 1.6 (so that we can update our downstream packages in a non-breaking way).

@lgoettgens lgoettgens self-assigned this Dec 19, 2024
@thofma
Copy link
Member

thofma commented Dec 19, 2024

I would prefer if we could make Test not a dependency. (Apart from that, I like the idea.)

@fingolfin
Copy link
Member Author

We could follow the Julia docs and use Requires.jl for Julia 1.6-1.8, and package extensions above.

@lgoettgens that kind of backwards compatibility would indeed be useful. Presumably this would mean test/Rings-conformance-tests.jl in AA stays but is changed to something like this:

using AbstractAlgebra.ConformanceTests

and export statements in there would make available test_elem, test_Ring_interface etc.

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

No branches or pull requests

3 participants