bland-wolf-59979
06/27/2024, 6:42 PMgarden test
to test run all tests found in all modules, if some of them fail, the command exits with exit code 0
how can i run all the tests and fail if any test fails?microscopic-river-74022
06/27/2024, 6:42 PMmicroscopic-river-74022
06/27/2024, 6:43 PMgarden test
command, it will execute all or specified tests defined in your project. If any of the tests fail, the command should not exit with exit code 0
. An exit code of 0
typically indicates that the command was successful, while any non-zero exit code indicates an error or failure.
In the Garden test results, each test that was executed will have an exitCode
field. If the test was successful, the exitCode
should be 0
. If the test failed, the exitCode
should be non-zero. This is how you can determine if any tests failed when running the garden test
command.
Here is an example of what the test results might look like:
yaml
test:
<Test name>:
success: false
exitCode: 1
startedAt: <timestamp>
completedAt: <timestamp>
log: <log output>
In this example, the test named <Test name>
failed because the success
field is false
and the exitCode
is 1
.
If you want the garden test
command to fail if any test fails, you should check the exit code of the command. If the exit code is non-zero, that means at least one test failed.
Sources:
- Garden Test Command ()
- Garden Test Outputs ()
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------microscopic-river-74022
06/27/2024, 6:43 PM