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

🧹 v3 (chore): Update test workflow to use gotestsum #2895

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

nickajacks1
Copy link
Member

@nickajacks1 nickajacks1 commented Mar 4, 2024

Description

Use gotestsum instead of go test to make test workflow output easier to read. In particular, test failures are summarized at the end, so we no longer have to dig through the logs to find what went wrong.

Uses https://github.com/marketplace/actions/gotestsum-installer

Fixes #2885

Type of change

Please delete options that are not relevant.

  • Code consistency (non-breaking change which improves code reliability and robustness)

Checklist

Before you submit your pull request, please make sure you meet these requirements:

  • Conducted a self-review of the code and provided comments for complex or critical parts.
  • Ensured that new and existing unit tests pass locally with the changes.
  • Verified that any new dependencies are essential and have been agreed upon by the maintainers/community.

Summary by CodeRabbit

  • New Features
    • Enhanced test reporting in CI workflows by integrating gotestsum.
    • Improved test command with specific gotestsum version and format.

@nickajacks1 nickajacks1 requested a review from a team as a code owner March 4, 2024 04:46
@nickajacks1 nickajacks1 requested review from gaby, sixcolors, ReneWerner87 and efectn and removed request for a team March 4, 2024 04:46
Copy link
Contributor

coderabbitai bot commented Mar 4, 2024

Walkthrough

This update integrates gotestsum into the project's test workflow, enhancing test output readability and functionality. By replacing go test -v with gotestsum, the project benefits from clearer outputs, rerun capabilities for failed tests, and junit output generation, addressing the challenge of locating failed tests in verbose logs.

Changes

Files Change Summary
.github/workflows/test.yml - Added steps to install and run gotestsum before executing tests.
- Modified the test command to utilize gotestsum with a specific version and format.

Assessment against linked issues

Objective Addressed Explanation
Update unit test workflows to utilize gotestsum (#2885)
Replace go test -v with gotestsum for running unit tests (#2885)
Leverage gotestsum for enhanced output readability and functionality (#2885)
Utilize gotestsum's feature of printing failures at the end (#2885)

Poem

In the realm of code, where tests unfold,
A rabbit dances, its tale retold.
With gotestsum in tow, it skips and hums,
Making test results clear, like beating drums.

"No more hunting for failures lost,
gotestsum presents them at the end, no cost."
So here's to the rabbit, code wizard so true,
Test logs now readable, a joyful view. 🐇🌟📝

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 67d35dc and ca85ce8.
Files selected for processing (1)
  • .github/workflows/test.yml (1 hunks)
Additional comments: 2
.github/workflows/test.yml (2)
  • 33-36: The addition of the gotestsum setup step using autero1/[email protected] is a good practice for ensuring that the required version of gotestsum is installed. However, it's important to verify the reliability and maintenance status of the third-party GitHub Action, as well as the compatibility of gotestsum version 1.11.0 with the project's requirements.
  • 38-38: The modification of the test command to use gotestsum -f testname -- ./... -race is a positive change for enhancing test output readability and running tests with the race detector enabled. Ensure that the chosen output format (testname) meets the project's needs and consider the potential overhead introduced by the race detector, especially in CI environments where resources may be limited.

.github/workflows/test.yml Outdated Show resolved Hide resolved
@gaby
Copy link
Member

gaby commented Mar 4, 2024

Output looks so much better :-)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between ca85ce8 and 5a77fdf.
Files selected for processing (1)
  • .github/workflows/test.yml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/test.yml

.github/workflows/test.yml Outdated Show resolved Hide resolved
@gaby gaby changed the title chore: Update test workflow to use gotestsum 🧹 v3 (chore): Update test workflow to use gotestsum Mar 4, 2024
.github/workflows/test.yml Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 5a77fdf and 992f973.
Files selected for processing (1)
  • .github/workflows/test.yml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/test.yml

@gaby
Copy link
Member

gaby commented Mar 5, 2024

@nickajacks1 There's a merge conflict now. Coverage reports were addsd to the main branch.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 77770a9 and 78d5d39.
Files selected for processing (1)
  • .github/workflows/test.yml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/test.yml

Copy link

codecov bot commented Mar 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (main@77770a9). Click here to learn what that means.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2895   +/-   ##
=======================================
  Coverage        ?   82.49%           
=======================================
  Files           ?      116           
  Lines           ?     8321           
  Branches        ?        0           
=======================================
  Hits            ?     6864           
  Misses          ?     1110           
  Partials        ?      347           
Flag Coverage Δ
unittests 82.49% <ø> (?)

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.

@efectn efectn merged commit 6389961 into gofiber:main Mar 5, 2024
11 of 19 checks passed
@ReneWerner87 ReneWerner87 added the v3 label Mar 5, 2024
@ReneWerner87 ReneWerner87 added this to the v3 milestone Mar 5, 2024
@nickajacks1 nickajacks1 deleted the gotestsum branch March 5, 2024 20:54
grivera64 pushed a commit to grivera64/fiber that referenced this pull request Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

🧹 [Maintenance]: Use Gotestsum for Test Workflow
4 participants