jupyterhub / repo2docker-action

A GitHub action to build data science environment images with repo2docker and push them to registries.
MIT License
142 stars 28 forks source link

Running tests defined in `image-tests` fail when `REPO_DIR` is not chowned by user #110

Closed jnywong closed 5 months ago

jnywong commented 7 months ago

Describe the bug I defined REPO_DIR=/srv/repo and the repo2docker action chowns this to the root user. Therefore in the action, when using docker run for pytesting files in image-tests, this also needs to be run with the -u root rather than the -u 1000 flag so that the REPO_DIR is read-writable, which is required for generating a .pytest_cache folder.

To Reproduce Steps to reproduce the behavior:

  1. Define REPO_DIR=/srv/repo
  2. Add test to image-tests
  3. Push to remote repo to trigger repo2docker action
  4. See error
   ../../opt/conda/lib/python3.11/site-packages/_pytest/stepwise.py:57
    /opt/conda/lib/python3.11/site-packages/_pytest/stepwise.py:57: PytestCacheWarning: could not create cache path /srv/repo/image-tests/.pytest_cache/v/cache/stepwise: [Errno 13] Permission denied: '/srv/repo/image-tests/.pytest_cache'
      session.config.cache.set(STEPWISE_CACHE_DIR, [])