Repository navigation
Add downstream-pyvo and downstream-astroquery tox jobs - #20604
jdavies-st wants to merge 2 commits into
Conversation
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
|
Eventually we will also need to update the developer doc to go with this, but we can hold off on that for now until we figure out the gritty details. Thanks! |
|
Doesn't this duplicate the integration dashboard? |
|
Does the integration dashboard allow testing from unmerged astropy PR branch on demand? |
|
No but I guess I'm worried about a slippery slope here - reproject for instance integrates tightly with astropy.wcs etc so we could end up testing a lot here. Actually the integration dashboard can be called via a reusable workflow so maybe we could call it here? I'll have a think! |
|
Anyway I guess it would be good to have a way to share infrastructure between the integration dashboard and this. |
|
So far this is a proof-of-concept. Developing locally, I wanted a one-liner to run downstream dependency unit tests. And having it as something that can be called via CI with say a label (maybe
Clearly this would need to be opt-in if available for CI. |
gives a CLI such as: Maybe we could extend it to be able to test PRs? |
|
Philosophically I also worry about creating an undesirable precedent here. If we start upstreaming integration testing, where does it end ? and what would remain the responsibility of downstream testing ? The integration testing dashboard is precisely designed to fit that space so it would make much more sense to develop a solution there. |
|
So I don't think this is a slippery slope. The goal here isn't to replace integration testing. It's just a proposal for something that is useful here, now, for testing PRs. It's just one tool. I think this is quite a different use case than integration testing for releases, which we already have, or for backports as #17861 was concerned with. Though clearly the tox infrastructure does not need to be unique. I did read the comments on #17861. The differences here in this draft PR:
|
|
So I've added a small CI workflow to this as well, that runs each of the 2 So the CI workflow can run on a PR with the Here it is running on my fork |
- Run the downstream-* tox jobs on a pull request that has the needs-downstream-testing label, or from the "Run workflow" button - Build one CI job per package from `tox list -f downstream`, so adding a package to tox.ini also adds it to CI. Currently this is for pyvo and astroquery - Run the jobs through the OpenAstronomy tox workflow on Python 3.14 - Drop the Python version from the downstream tox env names, so the downstream tests run on the same Python as the outer tox env
ab0df69 to
ef5fd35
Compare
|
Just to clarify, I think it would be useful to have a way to run downstream tests here - what I am concerned about is duplicating the infrastructure and config to do so. Another concern is that it's not unusual for the main branch of coordinated packages to be failing for other reasons, so what we really need to see here is the before/after of the tests based on this PR. I'm pretty sure we could adjust the integration dashboard so that we could easily just run it here on-demand and make a before/after dashboard for a set of downstream packages (and I can adjust the integration dashboard to support testing packages individually rather than all together). So basically I'm conceptually 👍 on having downstream testing, but I'd like to take a bit of time today or tomorrow to investigate if we can integrate it with the integration dashboard 😆 |
|
That looks really cool @astrofrog ! The before/after is the right approach. I have hit two bugs already existing in astropy and numpy this week that are unrelated to the PRs at hand that were flagged in the downstream tox jobs. Both were pre-existing. So compared to the integration testing approach, this PR:
@astrofrog it looks like you can do that on your end too, so I am on board. 👍 One thing I'll note is that running I also notice that pyvo is failing on the integration dashbaord. The cause is the same reason - astropy runs the tests in a different way from pyvo. 😅 (Gory detail interlude - it has a top-level conftest.py that sets some variables, and testing it with So perhaps you could add a per-package option to test the way the package's own CI does: from a clone of its repo, using its own test command, as here with astropy replaced with PR astropy. That's how pyvo's doctest break would be caught. Also pyvo is an affiliated package, not a coordinated package. So if we only added the per-PR run capability to coordinated packages, it would miss pyvo, my use case here. Can we add affiliated as well? And make them selectable in which run, so as not to waste electrons? Anyway, I can close this PR, or shrink it down just to the tox wrapper for local runs if that still has some value. |
If you're brave enough, you have my support to re-open |
|
Nooo! 😅 I don't have much to add to those discussions except for opinion and lots of time fixing test/build systems, including half my commit history in this repo. Only thing I will say is that once you've decided on src/ layout you have then decided not to bundle your tests or test data in the wheel, and you definitely don't have tests in subdirs in your production code. All benefits from my view, but given the history of this repo, controversial. Two things not mentioned there:
In order for a src/-layout to work for the test scenarios discussed here, all the under-test packages would have to switch to src/, which is probably less likely than this repo. 😅 Hence my suggestion to just run the tox envs already in those repos. It's the minimum churn, maximum "catch all the bugs" workflow. |


Description
This pull request adds two tox jobs that run the downstream devdeps jobs for astroquery and pyvo. The idea here is that we should have some way in this repo to run the unit tests of these downstream packages that tightly integrate with
astropy.io.votableandastroy.utils.xml. My last two PRs fixing bugs here in astropy broke something in these downstream packages because they had unit tests that depended on the bugs. Nice to catch that early.I've implemented the tox jobs generally, so that any other downstream dependency could be added by editing/adding 3 lines in the tox env.
The trick is that it runs the devdeps tox job in the downstream repo. And that makes it a perfect proxy for changes done in astropy that will break something downstream. Each job runs in its own provisioned venv. At the top level:
So whatever the rules are for the devdeps job downstream, it runs it in an identical way here, but instead of using a nightly wheel of astropy, it uses the current astropy installed locally (or a merged branch on a PR if run in CI).
I have not added a CI job for this yet, but I can.
To run them:
or to run both
Related to work done in #17861
AI Disclosure
Claude Opus 5.5 was used to draft and troubleshoot this.
Merge method