-
Notifications
You must be signed in to change notification settings - Fork 167
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
separate tox testenvs to cache CRDS reference files retrieved by initial test #7323
Conversation
5a9a659
to
1637313
Compare
268228f
to
ffbae47
Compare
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.
This looks good! Some comments below.
01ee2df
to
2013cf4
Compare
Codecov ReportBase: 79.66% // Head: 79.63% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #7323 +/- ##
==========================================
- Coverage 79.66% 79.63% -0.04%
==========================================
Files 411 411
Lines 37347 37350 +3
==========================================
- Hits 29752 29743 -9
- Misses 7595 7607 +12
*This pull request uses carry forward flags. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
c849a15
to
752d22b
Compare
962eeb3
to
f77fc21
Compare
c96fd33
to
1b703b3
Compare
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.
This is a hard nut to crack.
I really like the refactor of tox.ini
. Structurally much better and easier to work with, and importantly, a good distinction between checks and tests. 🚀
I don't like the needs: [ quick_test ]
dependency, as this dramatically increases the runtime of the test suite, likely doubling it. And it seems the main reason behind it is to get CRDS caching to work. Would be better to get the caching to work and keep the flat, concurrent set of checks we already have, I think.
The main problem with the CRDS cache is that we are trying to restore a cache whose contents we are using to make a hash. But it needs to be there before we can hash it, but we need to hash it before it is restored. Chicken, egg.
The next-best thing would be to hash files that exist after repo checkout, or some other state that corresponds with a state of the CRDS cache. While the cache of files needed for the tests will not change with every increment of the default context, it's probably the best proxy we have. Of course it needs to be created first and cached before it can be used, so still the chicken-egg problem, which I recall having a helluva time trying to get sorted when I first implemented (then unimplemented) this caching long ago.
I've been pinging some ideas around today and might have a solution based off the nice tox refactor you did here. Look for a PR.
.github/workflows/ci.yml
Outdated
- uses: actions/cache@v3 | ||
with: | ||
path: .tox | ||
key: tox-${{ matrix.toxenv }}-${{ env.pythonLocation }}-${{ runner.os }}-${{ hashFiles('pyproject.toml', 'setup.*') }} |
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.
I think it is not a good idea to cache .tox
, especially since the requirements in setup.cfg do not accurately represent the state of the packages installed on any given run of the CI. I.e. setup.cfg could not change for months, meanwhile there may be patch releases of numpy
and other direct dependencies, or other indirect dependencies. This caching would mask such updates to dependencies and defeat the purpose of daily CI testing.
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.
Oh, nevermind, I see this has been removed. 👍
- name: Code style check | ||
os: ubuntu-latest | ||
python-version: 3.9 | ||
toxenv: style | ||
|
||
toxenv: check-style |
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.
These and the other 2 are already in the matrix above. Probably no need to add them here.
if: ${{ contains(matrix.toxenv,'-cov') }} | ||
- run: pip install tox | ||
- run: tox -e ${{ matrix.toxenv }} | ||
quick_test: |
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.
Is the sole purpose of this quick_test to generate a cache that the other tests can use?
path: reference_files_hash.txt | ||
test: | ||
name: ${{ matrix.toxenv }} (Python ${{ matrix.python-version }}, ${{ matrix.os }}) | ||
needs: [ quick_test ] |
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.
Since these tests don't even kick off until quick_test
is finished, this is going to ~double the runtime of the test suite.
- name: Upload coverage to codecov | ||
if: ${{ contains(matrix.toxenv,'-cov') }} | ||
uses: codecov/codecov-action@v3 |
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.
Removing coverage reporting here is probably a good idea since nothing is changing on master
when this cron job runs.
matrix: | ||
toxenv: [ test-xdist, test-oldestdeps, test-sdpdeps-xdist ] | ||
python-version: [ '3.8', '3.9', '3.10', '3.11' ] | ||
os: [ ubuntu-latest, macos-latest ] |
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.
And I don't think we should be running on macos. The runners are too slow, and they don't test anything extra compared to the linux runners. If our test suite was 3 minutes, fine. But it is over an hour on the macos runners.
Likewise, oldestdeps probably only needs to run on the oldest supported version of python (and in fact probably only can), and the sdpdeps probably only should run on whatever version of python DMS/SDP is currently using, python 3.9 currently, i.e. whatever our JenkinsfileRT says.
The other thing to keep in mind is that caches created in branches cannot be used on master, though caches created on master can be used on branches. So this complicates any rollout. Probably will have to be 2 successive PRs. Chicken. Egg. |
This PR sets up dependent CI jobs and attempts to cache CRDS reference files, succeeding #6867 with suggestions from #6867 (review).
Checklist for maintainers
CHANGES.rst
within the relevant release sectionHow to run regression tests on a PR