Deepomatic / dmake

DMake is a tool to manage micro-service based applications
MIT License
36 stars 3 forks source link

Collect tests results even when some tests fail (or timeout) #482

Closed thomas-riccardi closed 3 years ago

thomas-riccardi commented 3 years ago

closes #374

Collect tests results even when some tests fail (or timeout)

Tricky case: when tests failed, some tests may have not been executed, so tests results files may be missing. We still want to collect them if possible, without raising extra error if we cant. We still want to fail when the collection failed when the tests succeeded though.

Current solution: duplicate the tests results collections commands, wrap tests, and individual collections, with try/catch/rethrow and help messages.

On bash, use https://stackoverflow.com/a/25180186/15151442 for try/catch.

Maybe a better way to handle that would be to have a "super cmd" that takes the individual test results collections cmds, and handle the error handling and duplication in generate_command_bash|pipeline()?

Also:

To test things, uncomment #- lets_fail_here in testweb/dmake.yml

Results

https://build.deepomatic.com/job/dmake/job/PR-482/20 Here is how it looks like when a test fails, with remaining tests results to collect (and DMAKE_DEBUG=1, it's less verbose in real life): in classic logs: Failed in branch test @ dmake-test/test-web

in blue ocean: blue ocean graph

blue ocean steps logs

Also

sonarcloud[bot] commented 3 years ago

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication