I got troubles persisting my cypress test results as pipeline artifacts. I can verify, that the folder cypress saves the reports to are correct.
there may be something going wrong with the volume mapping from container to pipeline workspace.
bitbucket yml
pipelines:
custom:
e2e:
- step:
services:
- docker
script:
- mkdir -p cypress-reports/screenshots cypress-reports/mochawesome-report
- docker-compose -f docker-compose.e2e.yml up -d
artifacts:
- cypress-reports/**
docker compose yml
services:
cypress:
build:
context: .
volumes:
- ./cypress-reports/screenshots:/cypress/screenshots
- ./cypress-reports/mochawesome-report:/mochawesome-report
I got troubles persisting my cypress test results as pipeline artifacts. I can verify, that the folder cypress saves the reports to are correct.
there may be something going wrong with the volume mapping from container to pipeline workspace.
bitbucket yml
pipelines:
custom:
e2e:
- step:
services:
- docker
script:
- mkdir -p cypress-reports/screenshots cypress-reports/mochawesome-report
- docker-compose -f docker-compose.e2e.yml up -d
artifacts:
- cypress-reports/**
docker compose yml
services:
cypress:
build:
context: .
volumes:
- ./cypress-reports/screenshots:/cypress/screenshots
- ./cypress-reports/mochawesome-report:/mochawesome-report
Share
Improve this question
asked Nov 19, 2024 at 13:31
neukoellnjennyneukoellnjenny
18012 bronze badges
1 Answer
Reset to default 0Assuming your Dockerfile
features a RUN
directive with a command that would produce the expected reports in a given time:
I'd bet your problem stems from the -d|--detach
flag after the docker compose up
command: it will immediately detach the pipeline runner shell from the command and, because it is the last command in your pipeline script, the pipeline step ends much before the background process can finish the artifacts.
I'd suggest you replace the docker compose up --detach
by a docker compose run cypress
instead, which will unequivocally wait for the command to end.