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

tests: replace panic with t.Fatal #3287

Merged

Conversation

kevsecurity
Copy link
Contributor

@kevsecurity kevsecurity commented Jan 9, 2025

Panicking in tests is bad as it fails to tell the test handler that the test failed. Instead we should use t.Fatal(). This commit changes instances of panic in tests to t.Fatal().

[Upstream PR: #2685]

kevsecurity and others added 2 commits January 9, 2025 12:01
Panicking in tests is bad as it fails to tell the test handler that the
test failed. Instead we should use t.Fatal(). This commit changes
instances of panic in tests to t.Fatal().

[Upstream commit: ae2f3c1]

Signed-off-by: Kevin Sheldrake <[email protected]>
Use the output returned by Fatal instead of passing stuff to printf

[Upstream commit: 057d734]

Signed-off-by: Mahe Tardy <[email protected]>
@kevsecurity kevsecurity added the release-note/misc This PR makes changes that have no direct user impact. label Jan 9, 2025
@kevsecurity kevsecurity force-pushed the backports/kevsecurity/v1.1/change-panic-to-fatal-in-tests branch 2 times, most recently from b88cd0e to d3fccfc Compare January 9, 2025 14:58
@kevsecurity kevsecurity force-pushed the backports/kevsecurity/v1.1/change-panic-to-fatal-in-tests branch from d3fccfc to a1c5438 Compare January 9, 2025 16:51
@kevsecurity kevsecurity marked this pull request as ready for review January 9, 2025 17:32
@kevsecurity kevsecurity requested a review from a team as a code owner January 9, 2025 17:32
@kevsecurity kevsecurity requested review from will-isovalent and removed request for a team January 9, 2025 17:32
@kevsecurity kevsecurity merged commit a443b54 into v1.1 Jan 9, 2025
37 checks passed
@kevsecurity kevsecurity deleted the backports/kevsecurity/v1.1/change-panic-to-fatal-in-tests branch January 9, 2025 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants