Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(maint) - Fix failing tests exiting 0 #558

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

jordanbreen28
Copy link
Contributor

@jordanbreen28 jordanbreen28 commented Apr 30, 2024

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

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified.

Prior to this commit, 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 the cause 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.
@jordanbreen28 jordanbreen28 requested a review from a team as a code owner April 30, 2024 12:17
Copy link

codecov bot commented Apr 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files
@@            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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jordanbreen28 jordanbreen28 force-pushed the maint-fix_0_exit_code_on_failure branch from 11bd80b to bd4c6e8 Compare April 30, 2024 12:20
@david22swan david22swan merged commit 144ba65 into main Apr 30, 2024
11 checks passed
@david22swan david22swan deleted the maint-fix_0_exit_code_on_failure branch April 30, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants