Not the most elegant solution, but I tried it out and it seems to work just fine:
Set up the directories (coverage/e2e
, artifacts/playwright/report/
, playwright-reports
) as an initial step in your job.
Then when the job runs, if it’s a parallel run that is running tests, those directories will get written with contents and persisted to the workspace just fine. If it’s a parallel run that is not running tests, your persist_to_workspace
step should not fail because the directories are present.
Something like:
steps:
- checkout
- run: mkdir no_files_here
- run: #test command with circleci tests run
- store_test_results:
path: ./test-results
- store_artifacts:
path: ./test-results
- persist_to_workspace:
root: .
paths:
- no_files_here
In the example above, no_files_here
is the equivalent of your coverage/e2e
, etc. directories.