puppetlabs / puppet_litmus

Providing a simple command line tool for puppet content creators, to enable simple and complex test deployments.
Apache License 2.0
88 stars 55 forks source link

(maint) - Fix failing tests exiting 0 #558

Closed jordanbreen28 closed 2 months ago

jordanbreen28 commented 2 months ago

Summary

Prior to this PR, the spec tests would falsely exit 0, meaning that the CI pipelines would pass and that failures would slip through the cracks.

This was because we invoke rake tasks in some of our unit testing, which explicity exit with 0 (in this case the offending tasks was litmus:check_connectivity). This exit code would interfere with the exit code 1 of the failing rspec tests, leading to a false passing CI pipeline.

This now stubs the exit method, which is called during these rake tasks, and ensures that it is not actually invoked and interferes with the rspec exit code.

Additional Context

https://github.com/puppetlabs/puppet_litmus/actions/runs/8894625813/job/24423273766?pr=558 now failures will show.

Related Issues (if any)

Mention any related issues or pull requests.

Checklist

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 63.95%. Comparing base (55f7d1f) to head (bd4c6e8).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #558 +/- ## ========================================== + Coverage 63.04% 63.95% +0.91% ========================================== Files 6 6 Lines 763 763 ========================================== + Hits 481 488 +7 + Misses 282 275 -7 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.