-
Notifications
You must be signed in to change notification settings - Fork 451
Closed
Labels
Priority: HighBroken behavior in specific environments like in parallel mode or only on some operating systemsBroken behavior in specific environments like in parallel mode or only on some operating systemsSize: MediumChanges in the same fileChanges in the same fileType: Bug
Milestone
Description
Describe the bug
Report.xml has no contents when using docker to run tests.
To Reproduce
Suppose you have a folder structure like the following:
.
├─ test
├─ test.batsAnd you are running tests like this:
Replace YOUR_DOCKER_IMAGE
docker run -it -v `pwd`:`pwd` -w `pwd` YOUR_DOCKER_IMAGE sh -c 'bats -r test --report-formatter junit --output `pwd`'This renders an empty report file.
Expected behavior
Report file contains results of tests
Environment:
- Bats Version 1.8.2
- OS: MacOS Ventura 13.1
Additional context
If you add a sleep to the end of the command
docker run -it -v `pwd`:`pwd` -w `pwd` YOUR_DOCKER_IMAGE sh -c 'bats -r test --report-formatter junit --output `pwd`; sleep 5'This renders a proper report file.
Not sure of the internals of bats but it seems that the process to write the reports is separate from the main process which allows docker to exit without waiting for the report to be written.
Metadata
Metadata
Assignees
Labels
Priority: HighBroken behavior in specific environments like in parallel mode or only on some operating systemsBroken behavior in specific environments like in parallel mode or only on some operating systemsSize: MediumChanges in the same fileChanges in the same fileType: Bug