Skip to content

Conversation

@JAORMX
Copy link
Collaborator

@JAORMX JAORMX commented Sep 18, 2025

Summary

This PR adds the ginkgolinter to our golangci-lint configuration to ensure better code quality and consistency in our Ginkgo test suites.

Changes

Configuration Updates

  • Added ginkgolinter to the enabled linters list in .golangci.yml
  • Configured ginkgolinter with appropriate settings:
    • Enabled focus container detection to prevent accidentally committed focused tests
    • Enabled async interval validation for proper timeout/polling configuration
    • Kept default settings for assertion style checks

Code Fixes

  • Fixed existing ginkgolinter issues in e2e tests:
    • test/e2e/group_list_e2e_test.go: Changed Expect(len(testGroups)).To(Equal(len(mixedGroupNames))) to Expect(testGroups).To(HaveLen(len(mixedGroupNames)))
    • test/e2e/stdio_proxy_over_streamable_http_mcp_server_test.go: Changed Expect(len(responses)).To(Equal(2)) to Expect(responses).To(HaveLen(2))

Benefits

The ginkgolinter helps us:

  • Catch common mistakes in Ginkgo tests (e.g., function calls in async assertions)
  • Enforce consistent assertion styles (e.g., using HaveLen() instead of checking len() with Equal())
  • Prevent focus containers from being accidentally committed
  • Ensure proper error handling patterns in tests
  • Validate async assertion intervals

Testing

  • Ran task lint - all checks pass
  • Verified ginkgolinter is properly configured and working
  • Fixed all existing ginkgolinter issues in the codebase

- Added ginkgolinter to the enabled linters list
- Configured ginkgolinter settings with appropriate rules
- Fixed existing ginkgolinter issues in e2e tests:
  - Use HaveLen() matcher instead of len() with Equal()
  - Applied fixes to group_list_e2e_test.go and stdio_proxy_over_streamable_http_mcp_server_test.go

This ensures better code quality and consistency in our Ginkgo test suites.
@JAORMX JAORMX requested a review from rdimitrov September 18, 2025 12:09
@JAORMX JAORMX merged commit 25ae23a into main Sep 18, 2025
21 of 22 checks passed
@JAORMX JAORMX deleted the add-ginkgolinter branch September 18, 2025 14:16
@codecov
Copy link

codecov bot commented Sep 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.93%. Comparing base (3a73947) to head (1ccd5c2).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1956      +/-   ##
==========================================
- Coverage   47.00%   46.93%   -0.08%     
==========================================
  Files         223      223              
  Lines       27679    27679              
==========================================
- Hits        13011    12990      -21     
- Misses      13670    13694      +24     
+ Partials      998      995       -3     

☔ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants