Commit 6a1995e
authored
ci: fix e2e templates tests failing on mise shim cwd resolution (#1885)
## 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 a `mise` shim that resolves the apify
version by walking up from cwd looking for a `mise.toml`. Our tests run
`subprocess.run(['apify', ...], cwd=tmp_path / actor_name)` from
pytest's default `tmp_path` (`/tmp/pytest-of-runner/...`), which is
outside `MISE_TRUSTED_CONFIG_PATHS` and contains no mise config. The
shim therefore errors with `No version is set for shim: apify`.
This mirrors how `apify/crawlee` handles the same situation in
`test/e2e/tools.mjs` (running `apify push` from a directory under the
project root and setting `GIT_CEILING_DIRECTORIES`).
## Changes
- `pyproject.toml`: pass `--basetemp=./.pytest-tmp` to the
`e2e-templates-tests` poe task so pytest's `tmp_path` lives under the
project root, where `mise`'s parent traversal finds the `mise.toml`
written by `jdx/mise-action` to `$GITHUB_WORKSPACE`.
- `.gitignore`: ignore `.pytest-tmp`.
- `tests/e2e/project_template/test_static_crawlers_templates.py`: set
`GIT_CEILING_DIRECTORIES=tmp_path` on the `apify push` call so git stops
before reaching the project's `.git/`.
Failing run:
https://github.com/apify/crawlee-python/actions/runs/255414260071 parent 91c0764 commit 6a1995e
3 files changed
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
| 340 | + | |
340 | 341 | | |
341 | 342 | | |
342 | 343 | | |
| |||
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
90 | 98 | | |
91 | 99 | | |
92 | 100 | | |
| |||
0 commit comments