cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.84k stars 3.17k forks source link

jUnit test results are owned by root when running as another user #7888

Closed drumbeg closed 1 year ago

drumbeg commented 4 years ago

Current behavior:

I am running Cypress within a Docker container based on Oracle Linux 7. I am kicking off tests using cypress run as a sysadmin user. All test artifacts generated are owned by this user except for my jUnit test output, which is owned by root. This means my CI framework cannot access test results.

Desired behavior:

jUnit test output should be owned by the user I am logged in as when I run Cypress.

Test code to reproduce

docker-compose.yml showing sysadmin test user

my-service:
    user: sysadmin
    image: cypress:4.9.0
    command: npm test
    ipc: host

package.json showing scripts

"scripts": {
    "start": "cypress open",
    "test": "cypress run",

cypress.json

"reporter": "junit",
"reporterOptions": {
    "mochaFile": "results/test-results.xml"
}

Output

image

Versions

4.9.0

BlueWinds commented 1 year ago

Going to close this after two years of inactivity + 7 major versions of Cypress. Please feel free to open another issue if this is still a problem and we'll try and do better about looking into things!