Closed danyeaw closed 5 months ago
For understanding better, can you add a step ls -l
after the pytest run but before the cache teardown step? Actually, also before the pytest run would be helpful.
Specifically ls -l /home/runner/work/gaphor/gaphor/
.
Hi @bluetech yup, let me try to build up a quick minimum reproducible repo and I'll add that as a step.
I created a minimum reproducible example with a single test, no dependencies except for Pytest 8.2.0, on a Fedora 39 image is here: https://github.com/danyeaw/pytest-issue-reproduction
The list of files is:
Run ls -l -a
total 60
drwxr-xr-x 7 root root 4096 May 14 01:56 .
drwxr-xr-x 3 1001 127 4096 May 14 01:55 ..
drwxr-xr-x 8 root root 4096 May 14 01:56 .git
drwxr-xr-x 3 root root 4096 May 14 01:56 .github
-rw-r--r-- 1 root root 3078 May 14 01:56 .gitignore
drwx------ 3 root root 4096 May 14 01:56 .pytest_cache
drwxr-xr-x 5 root root 4096 May 14 01:56 .venv
-rw-r--r-- 1 root root 11357 May 14 01:56 LICENSE
-rw-r--r-- 1 root root 180 May 14 01:56 README.md
drwxr-xr-x 2 root root 4096 May 14 01:56 __pycache__
-rw-r--r-- 1 root root 2714 May 14 01:56 poetry.lock
-rw-r--r-- 1 root root 349 May 14 01:56 pyproject.toml
-rw-r--r-- 1 root root 103 May 14 01:56 test_example.py
The test run with debugging enabled is here: https://github.com/danyeaw/pytest-issue-reproduction/actions/runs/9072535335
Makes sense:
drwx------ 3 root root 4096 May 14 01:56 .pytest_cache
I assume that the TemporaryDirectory
we're using since #12168 is creating a directory with 700 permissions, while the github cache action wants to access the directory as another user so wants 755 permissions.
The fix would be to add path.chmod(0o755)
after this line. Let me see.
Thanks so much for the fix @bluetech!
pip list
from the virtual environment you are usingWhen upgrading to Pytest 8.2.0, I was getting a
Error: The template is not valid. .github/workflows/full-build.yml (Line: 92, Col: 16): hashFiles('**/poetry.lock') failed. Fail to hash files under directory '/home/runner/work/gaphor/gaphor'
. When I turned on debug mode on the runner, it looks like the error is caused by an access issue with .pytest_cache which could be a regression caused by https://github.com/pytest-dev/pytest/pull/12168.OS: Fedora 39 Docker running on Ubuntu 22.04 VM Python: Python 3.11.9 Pytest: 8.2.0
The error happens during the Post Use Dependency Cache step with actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9.
The larger traceback is:
The full run is here: https://github.com/gaphor/gaphor/actions/runs/8976797623/job/24855725418
The output of pip list for this environment is: