Re-work test caching - #628
Conversation
WalkthroughThis PR refactors test data caching in CI workflows by consolidating functionality from a standalone GitHub Action into the Changes
Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #628 +/- ##
==========================================
+ Coverage 99.49% 99.93% +0.44%
==========================================
Files 135 135
Lines 11570 11584 +14
==========================================
+ Hits 11511 11576 +65
+ Misses 59 8 -51
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/actions/mamba-install-dascore/action.yml:
- Around line 77-84: The "export test data cache env" step always runs; gate it
behind the prepare-test-data input so it only runs when test data prep is
enabled: add an if conditional like if: ${{ inputs.prepare-test-data == 'true'
}} to the step (the one running python
.github/scripts/export_test_data_cache_env.py) so the step executes only when
the prepare-test-data input is true and is skipped otherwise.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 52b523d8-f7c1-494a-8e7b-d13221a3394e
📒 Files selected for processing (13)
.github/actions/cache-test-data/action.yml.github/actions/mamba-install-dascore/action.yml.github/scripts/cache_test_data.py.github/scripts/export_test_data_cache_env.py.github/workflows/build_deploy_master_docs.yaml.github/workflows/build_deploy_stable_docs.yaml.github/workflows/get_coverage.yml.github/workflows/profile.yml.github/workflows/run_min_dep_tests.yml.github/workflows/runtests.yml.github/workflows/test_doc_build.ymldascore/utils/downloader.pytests/test_utils/test_downloader.py
💤 Files with no reviewable changes (1)
- .github/actions/cache-test-data/action.yml
| - name: export test data cache env | ||
| shell: bash -el {0} | ||
| env: | ||
| INPUT_CACHE_NUMBER: ${{ inputs.cache-number }} | ||
| RUNNER_OS: ${{ runner.os }} | ||
| run: | | ||
| python .github/scripts/export_test_data_cache_env.py >> "$GITHUB_ENV" | ||
|
|
There was a problem hiding this comment.
Gate cache env export behind prepare-test-data.
The step at Line 77 always runs, even when prepare-test-data is "false". That makes the flag partially ineffective and can introduce avoidable failures/overhead in jobs that explicitly disable test-data prep.
Suggested fix
- name: export test data cache env
+ if: "${{ inputs.prepare-test-data == 'true' }}"
shell: bash -el {0}
env:
INPUT_CACHE_NUMBER: ${{ inputs.cache-number }}
RUNNER_OS: ${{ runner.os }}
run: |
python .github/scripts/export_test_data_cache_env.py >> "$GITHUB_ENV"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - name: export test data cache env | |
| shell: bash -el {0} | |
| env: | |
| INPUT_CACHE_NUMBER: ${{ inputs.cache-number }} | |
| RUNNER_OS: ${{ runner.os }} | |
| run: | | |
| python .github/scripts/export_test_data_cache_env.py >> "$GITHUB_ENV" | |
| - name: export test data cache env | |
| if: "${{ inputs.prepare-test-data == 'true' }}" | |
| shell: bash -el {0} | |
| env: | |
| INPUT_CACHE_NUMBER: ${{ inputs.cache-number }} | |
| RUNNER_OS: ${{ runner.os }} | |
| run: | | |
| python .github/scripts/export_test_data_cache_env.py >> "$GITHUB_ENV" |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/actions/mamba-install-dascore/action.yml around lines 77 - 84, The
"export test data cache env" step always runs; gate it behind the
prepare-test-data input so it only runs when test data prep is enabled: add an
if conditional like if: ${{ inputs.prepare-test-data == 'true' }} to the step
(the one running python .github/scripts/export_test_data_cache_env.py) so the
step executes only when the prepare-test-data input is true and is skipped
otherwise.
Description
This PR simplifies previous changes to test data caching (eg in #626). It is now part of the mamba env setup, and uses DASCore's exact caching machinery to avoid cache misses and un-configured envs, which was the issue before.
Checklist
I have (if applicable):
Summary by CodeRabbit
New Features
Tests
Chores