ci: fix e2e templates tests failing on mise shim cwd resolution#1885
Merged
ci: fix e2e templates tests failing on mise shim cwd resolution#1885
Conversation
The apify/setup-apify-cli-action installs apify-cli via a mise shim that resolves the version from cwd. Tests that subprocess into pytest's tmp_path under /tmp couldn't find a mise config and failed with "No version is set for shim: apify". Move pytest's basetemp under the project root so mise's parent traversal finds the action's mise.toml in $GITHUB_WORKSPACE, and set GIT_CEILING_DIRECTORIES on apify push so git doesn't reach the project's .git/.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1885 +/- ##
==========================================
+ Coverage 92.70% 92.76% +0.05%
==========================================
Files 161 161
Lines 11356 11356
==========================================
+ Hits 10528 10534 +6
+ Misses 828 822 -6
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:
|
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.
Summary
The scheduled e2e template tests have been failing on every matrix job since #1874 / #1880 adopted
apify/setup-apify-cli-action@v1.0.0. The action installs apify-cli via amiseshim that resolves the apify version by walking up from cwd looking for amise.toml. Our tests runsubprocess.run(['apify', ...], cwd=tmp_path / actor_name)from pytest's defaulttmp_path(/tmp/pytest-of-runner/...), which is outsideMISE_TRUSTED_CONFIG_PATHSand contains no mise config. The shim therefore errors withNo version is set for shim: apify.This mirrors how
apify/crawleehandles the same situation intest/e2e/tools.mjs(runningapify pushfrom a directory under the project root and settingGIT_CEILING_DIRECTORIES).Changes
pyproject.toml: pass--basetemp=./.pytest-tmpto thee2e-templates-testspoe task so pytest'stmp_pathlives under the project root, wheremise's parent traversal finds themise.tomlwritten byjdx/mise-actionto$GITHUB_WORKSPACE..gitignore: ignore.pytest-tmp.tests/e2e/project_template/test_static_crawlers_templates.py: setGIT_CEILING_DIRECTORIES=tmp_pathon theapify pushcall so git stops before reaching the project's.git/.Failing run: https://github.com/apify/crawlee-python/actions/runs/25541426007