Repository navigation
test: replace the _tests profile with a unit test of profile scripts - #118
Open
cadenmyers13 wants to merge 1 commit into
Open
cadenmyers13 wants to merge 1 commit into
cadenmyers13 wants to merge 1 commit into
Conversation
The _tests profile downloaded pinned release tarballs of srreal, srfit, pyobjcryst, structure and utils and ran their test suites against the conda-forge versions. It broke whenever those drifted apart (srfit 3.3.0 tests need six, which is no longer installed) and the URLs had to be updated by hand. Remove the profile and its scripts, install the pdf pack in CI instead, and cover script extras with a test in tests/test_profilesmanager.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
@sbillinge ready for review |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #118 +/- ##
==========================================
+ Coverage 93.63% 94.04% +0.40%
==========================================
Files 4 4
Lines 220 235 +15
==========================================
+ Hits 206 221 +15
Misses 14 14
🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR address?
closes #106
CI on every PR has been failing at the last step, after the tests themselves pass:
cmi install _testsran_pytest.sh. That script downloaded pinned release tarballs of srreal, srfit, pyobjcryst, structure and utils, listed intar_url.txt, and ran each package's own test suite against whatever versions conda-forge had installed. In the latest run, srfit 3.3.0's test setup doesimport six.sixisn't installed any more, so srfit's tests never start (ModuleNotFoundError: No module named 'six'). The other four suites pass, but the script exits 1 overall, so the whole profile is marked failed.This breaks whenever a pinned tag and the conda-forge release drift apart. Someone also has to update
tar_url.txtby hand after every dependency release. On top of that, these tests belong to other packages, and each of those runs its own CI.The only diffpy.cmi behaviour this exercised was that a profile's extras scripts run when the profile is installed. This PR tests that directly:
test_install_with_script_extrastotests/test_profilesmanager.py. It builds a temporary profile whose extras list a small.shand.batscript, installs it, and checks that:It needs no network or conda, and it runs on Linux, macOS and Windows.
_testsprofile and its scripts (_pytest.sh,_pytest.bat,tar_url.txt).tests-on-pr.ymlandmatrix-and-codecov-on-merge-to-main.yml, replacecmi install _testswithcmi install pdf, so CI still checks that a real pack installs._testssection fromdocs/source/available-profiles.rstand add a news item.Local results:
tests/test_profilesmanager.pypasses (3 passed). In my local env, the only other failure istest_version.py, because the editable install reports version0.0.0. It is unrelated to this PR.🤖 Generated with Claude Code