DACCESS-737: Fix Jenkins test permission issues#2438
Open
JeremyDuncan wants to merge 5 commits intodevfrom
Open
DACCESS-737: Fix Jenkins test permission issues#2438JeremyDuncan wants to merge 5 commits intodevfrom
JeremyDuncan wants to merge 5 commits intodevfrom
Conversation
…SS-737_update-test-coverage-to-use-jenkins-permissions
Contributor
Author
|
I have this branch deployed to Integration as well. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
docker-compose-test.yaml&docker-compose-test-interactive.yamlDOCKER_UID/DOCKER_GIDas the containeruser, and setsHOME=/tmpso tools like Bundler and Selenium Manager have a writable home directory when running as a non-root UIDcucumber-features.sh/rspec.shDOCKER_UID/DOCKER_GIDfrom the Jenkins shell and pre-creates the coverage directory withmkdir -pso it is owned by Jenkins before the container writes to itDockerfile(test stage)chmod -R a+rwXon/root,APP_PATH, andBUNDLE_PATHso the non-root Jenkins user can write to Chrome user-data directories, app temp files, and the gem bundleJenkinsfilemkdir -p coverage/chmod/ dummy-file lines from the Publish Coverage stage that were creating a root-ownedcoverage/directory at the wrong path in the workspaceReason 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 asrootinside the bind-mounted coverage directory. Since Jenkins runs as a non-root user it could not delete those files during workspace cleanup, causingCompositeIOException: Unable to deleteerrors on every subsequent build.Before:

After:
