Skip to content

Commit

Permalink
tests: Change test container user to root
Browse files Browse the repository at this point in the history
See this comment by Adrià for details: ckan/ckan-docker-base#86 (comment).
  • Loading branch information
bellisk committed Nov 14, 2024
1 parent 32dfb80 commit bd66b01
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Create ckan container
run: |
/usr/bin/docker create --name test_ckan --network ${{ job.container.network }} --network-alias ckan \
--env-file ${{ github.workspace }}/github-workflow.env \
--env-file ${{ github.workspace }}/github-workflow.env --user root \
-v "/var/run/docker.sock":"/var/run/docker.sock" \
-v "/home/runner/work":"/__w" -v "/home/runner/work/_temp":"/__w/_temp" \
-v "/home/runner/work/_actions":"/__w/_actions" -v "/opt/hostedtoolcache":"/__t" \
Expand All @@ -71,7 +71,7 @@ jobs:
docker start test_ckan
- name: Install requirements and set up ckanext
run: |
docker exec -u root test_ckan $WORKDIR/bin/install_test_requirements.sh
docker exec test_ckan $WORKDIR/bin/install_test_requirements.sh
- name: Run tests
run: |
docker exec test_ckan pytest --ckan-ini=$WORKDIR/test.ini --disable-warnings --cov=ckanext.switzerland \
Expand Down
3 changes: 0 additions & 3 deletions bin/install_test_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,3 @@ pip install -r https://raw.githubusercontent.com/ckan/ckanext-fluent/master/requ
# Init db and re-enable required plugins
ckan -c /__w/ckanext-switzerland/ckanext-switzerland/test.ini db init
ckan -c /__w/ckanext-switzerland/ckanext-switzerland/test.ini db pending-migrations --apply

# Make ckan user owner of this directory so it can save the pytest-coverage file
chown ckan:ckan-sys /srv/app

0 comments on commit bd66b01

Please sign in to comment.