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

Remove DesiTest; support pytest #464

Merged
merged 15 commits into from
Jan 29, 2025
Merged

Remove DesiTest; support pytest #464

merged 15 commits into from
Jan 29, 2025

Conversation

weaverba137
Copy link
Member

This PR removes DesiTest as requested in desihub/desiutil#215.

@weaverba137 weaverba137 requested a review from sbailey January 15, 2025 17:22
@weaverba137 weaverba137 self-assigned this Jan 15, 2025
@weaverba137
Copy link
Member Author

Tests are failing due to impossible dependency resolutions, so the test matrix will also need to be updated.

@weaverba137
Copy link
Member Author

It looks like it is not possible to compile fiberassign on ubuntu-24.04, or with Python > 3.10. I think that's beyond the scope of this ticket. I think this is ready for review.

@araichoor
Copy link
Contributor

hi @weaverba137, @sbailey

just checking if this PR is going to be merged soon-ish (checks from my PR are failing because of the issue solved by this PR, I think: https://github.com/desihub/fiberassign/pull/466/checks).
sorry I cannot help with reviewing this one..
thanks!

@sbailey
Copy link
Contributor

sbailey commented Jan 29, 2025

@weaverba137 this PR removes DesiTest, thus fully dropping support for python setup.py test even with older versions of desiutil, but I see that in .github/workflows/test.yml you run the tests with

python -c 'import fiberassign.test; fiberassign.test.runtests()'

instead of pytest. Why is that? I haven't been able to check if pytest works without NERSC this week because I haven't been able to compile fiberassign on my laptop setup (some issue with pybind11, still investigating).

We could probably merge this anyway, but I'd like to understand whether pytest works and document any gotchas here.

@weaverba137
Copy link
Member Author

That is a great question. I will have to do a deep dive into the repository history. For example, the test may have been copied from a Travis test written by someone else.

@weaverba137
Copy link
Member Author

The test.yml file was added in ead086d, committed by @tskisner, and the test was copied from the .travis.yml file that was removed in the same commit.

The test was changed in c7ca950, which has the comment "Ensure that we run travis tests with the installed copy of the package."

So I think what's happening here is that python setup.py test would not necessarily test the compiled version of fiberassign, while compiling, installing and then running fiberassign.test.runtests() definitely would.

@sbailey
Copy link
Contributor

sbailey commented Jan 29, 2025

Thanks for checking. Please try to confirm that pytest works for fiberassign, which I think means running

python setup.py build_ext --inplace
pytest

I'm currently stuck on the first step on my laptop, but it hopefully would work within the github actions container or other places that you might have access to. If that becomes onerous, we could also probably merge now and revisit pytest next week when NERSC is back, and separately deal with how to in-place compile fiberassign at other locations.

@weaverba137
Copy link
Member Author

pytest is finding tests in fiberassign/old. pytest can be configured to ignore that, but perhaps it's time to think about removing unused code.

@weaverba137
Copy link
Member Author

Ugh, pytest is interpreting a particular function inside test/simulate.py as a pytest fixture, even though the file is explicitly ignored. However, the function in question, fiberassign.test.simulate.test_subdir_create() sure looks a lot like a pytest fixture and is imported into other test modules. The function will have to be renamed.

@weaverba137
Copy link
Member Author

OK, goal achieved: fiberassign can be tested with bare pytest.

Copy link
Contributor

@sbailey sbailey left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for the work to get bare pytest working.

@sbailey sbailey merged commit 4127563 into main Jan 29, 2025
6 checks passed
@sbailey sbailey changed the title Remove DesiTest Remove DesiTest; support pytest Jan 29, 2025
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.

3 participants