Skip to content

DACCESS-737: Fix Jenkins test permission issues#2438

Open
JeremyDuncan wants to merge 5 commits intodevfrom
DACCESS-737_update-test-coverage-to-use-jenkins-permissions
Open

DACCESS-737: Fix Jenkins test permission issues#2438
JeremyDuncan wants to merge 5 commits intodevfrom
DACCESS-737_update-test-coverage-to-use-jenkins-permissions

Conversation

@JeremyDuncan
Copy link
Copy Markdown
Contributor

@JeremyDuncan JeremyDuncan commented Mar 12, 2026

Jira Ticket: https://culibrary.atlassian.net/browse/DACCESS-737

Description

Updates the Jenkins CI pipeline and Docker test image to run test containers as the Jenkins user instead of root, ensuring coverage output files are written with Jenkins-owned permissions.

File Change
docker-compose-test.yaml & docker-compose-test-interactive.yaml Passes DOCKER_UID/DOCKER_GID as the container user, and sets HOME=/tmp so tools like Bundler and Selenium Manager have a writable home directory when running as a non-root UID
cucumber-features.sh / rspec.sh Exports DOCKER_UID/DOCKER_GID from the Jenkins shell and pre-creates the coverage directory with mkdir -p so it is owned by Jenkins before the container writes to it
Dockerfile (test stage) Adds chmod -R a+rwX on /root, APP_PATH, and BUNDLE_PATH so the non-root Jenkins user can write to Chrome user-data directories, app temp files, and the gem bundle
Jenkinsfile Removes redundant mkdir -p coverage / chmod / dummy-file lines from the Publish Coverage stage that were creating a root-owned coverage/ directory at the wrong path in the workspace

Reason for Changes

Jenkins was failing to clean its workspace between builds because SimpleCov coverage output files (.resultset.json, index.html, rcov/, etc.) were being written as root inside the bind-mounted coverage directory. Since Jenkins runs as a non-root user it could not delete those files during workspace cleanup, causing CompositeIOException: Unable to delete errors on every subsequent build.


Before:
image


After:
image

@JeremyDuncan JeremyDuncan requested review from chrisrlc and sk274 March 13, 2026 19:34
@JeremyDuncan JeremyDuncan marked this pull request as ready for review March 13, 2026 19:34
@JeremyDuncan JeremyDuncan changed the title DACCESS-737: updated docker config and test scripts DACCESS-737: Fix Jenkins test permission issues Mar 13, 2026
@JeremyDuncan
Copy link
Copy Markdown
Contributor Author

I have this branch deployed to Integration as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant