Skip to content

Fix fatal error calls in adapter_test.go#3810

Merged
ReneWerner87 merged 2 commits intomainfrom
fix-lint
Oct 20, 2025
Merged

Fix fatal error calls in adapter_test.go#3810
ReneWerner87 merged 2 commits intomainfrom
fix-lint

Conversation

@ReneWerner87
Copy link
Member

No description provided.

@ReneWerner87 ReneWerner87 requested a review from a team as a code owner October 20, 2025 11:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes incorrect usage of t.Fatalf by replacing it with t.Fatal in test cases where no format string arguments are provided.

Key Changes

  • Replaced t.Fatalf calls with t.Fatal in two test functions where format arguments were not being used

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 20, 2025

Caution

Review failed

The pull request is closed.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

The PR replaces two t.Fatalf() calls with t.Fatal() in middleware adaptor tests that verify http.Flusher interface support. The error message and control flow remain identical—only the logging mechanism changes from formatted to unformatted output.

Changes

Cohort / File(s) Summary
Test utility updates
middleware/adaptor/adaptor_test.go
Replaced 2 instances of t.Fatalf("w does not implement http.Flusher") with t.Fatal("w does not implement http.Flusher") in http.Flusher verification test branches

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • gofiber/fiber#3807: Adds/extends flushing-related tests in the same middleware/adaptor/adaptor_test.go file, addressing http.Flusher support validation.

Suggested labels

🧹 Updates, v3

Suggested reviewers

  • gaby
  • sixcolors
  • efectn

Poem

🐰 A tiny tweak, so clean and neat,
From Fatalf to Fatal, the tests run sweet!
No logic lost, just format reformed,
The flusher checks keep safely performed! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-lint

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c257f02 and 225d3b5.

📒 Files selected for processing (2)
  • adapter_test.go (2 hunks)
  • middleware/adaptor/adaptor_test.go (2 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ReneWerner87, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the error handling within specific test cases in adapter_test.go. By switching from t.Fatalf to t.Fatal, the change streamlines the test failure mechanism, ensuring that tests immediately stop upon encountering critical conditions without needing to format a specific error message. This improves the conciseness of the test code.

Highlights

  • Test Error Handling: Replaced t.Fatalf with t.Fatal in two test cases within adapter_test.go to simplify error reporting when a specific formatted message is not strictly necessary.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request correctly replaces t.Fatalf with t.Fatal for calls that do not use format strings. This is a good improvement. My review includes suggestions to further enhance the code by using the testify/require package for assertions, which will improve conciseness and maintain consistency with the existing test style in the file.

@codecov
Copy link

codecov bot commented Oct 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.02%. Comparing base (c257f02) to head (225d3b5).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3810      +/-   ##
==========================================
- Coverage   92.06%   92.02%   -0.05%     
==========================================
  Files         115      115              
  Lines       12257    12257              
==========================================
- Hits        11285    11279       -6     
- Misses        709      714       +5     
- Partials      263      264       +1     
Flag Coverage Δ
unittests 92.02% <ø> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ReneWerner87 ReneWerner87 merged commit f669de4 into main Oct 20, 2025
13 of 15 checks passed
@ReneWerner87 ReneWerner87 deleted the fix-lint branch October 20, 2025 11:23
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.

3 participants