Skip to content

testing: Drop ginkgo in favor of the standard library - #5580

Open
ultrotter wants to merge 1 commit into
prometheus:mainfrom
ultrotter:normaltests
Open

ultrotter wants to merge 1 commit into
prometheus:mainfrom
ultrotter:normaltests

Conversation

@ultrotter

Copy link
Copy Markdown
Contributor

With modern go testing patterns (e.g.m t.Run(...) and testify) we can express a similar style without depending on an external library with arcane syntax which not all golang developers would be fammiliar with.

We were using this particular style only in two packages, so remove it there before it's too late and it spreads.

Pull Request Checklist

Please check all the applicable boxes.

  • Is this a breaking change?
    • My changes do not break the existing cluster messages
    • My changes do not break the existing api
  • I have added/updated the required documentation
  • I have signed-off my commits
  • I will follow best practices for contributing to this project

Which user-facing changes does this PR introduce?

NONE

With modern go testing patterns (e.g.m t.Run(...) and testify) we can
express a similar style without depending on an external library with
arcane syntax which not all golang developers would be fammiliar with.

We were using this particular style only in two packages, so remove it
there before it's too late and it spreads.

Signed-off-by: Guido Trotter <guido@hudson-trading.com>
@ultrotter
ultrotter requested a review from a team as a code owner September 22, 2026 05:39
@coderabbitai

coderabbitai Bot commented Sep 22, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: prometheus/alertmanager/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 0cea1ba4-7476-4bdb-8e65-1f10e4ccc7c7

📥 Commits

Reviewing files that changed from the base of the PR and between 6576c19 and ab33271.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (11)
  • AGENTS.md
  • api/connect/connect_suite_test.go
  • api/connect/connect_test.go
  • api/connect/health_test.go
  • api/connect/helpers_test.go
  • api/connect/status_test.go
  • go.mod
  • test/e2e/e2e_suite_test.go
  • test/e2e/harness_test.go
  • test/e2e/routing_test.go
  • test/e2e/status_test.go
💤 Files with no reviewable changes (3)
  • api/connect/connect_suite_test.go
  • test/e2e/e2e_suite_test.go
  • go.mod

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The pull request replaces Ginkgo/Gomega with Go testing and Testify across Connect API and end-to-end tests. It adds Connect API admission and lifecycle coverage, shared test helpers, sequential e2e harness handling, and removes obsolete dependencies.

Changes

Testing framework migration

Layer / File(s) Summary
Test conventions and dependency cleanup
AGENTS.md, go.mod
Testing guidance now uses Go testing, Testify, subtests, cleanup helpers, and separate parallelism rules. Ginkgo, Gomega, and obsolete indirect dependencies are removed.
Connect API admission and lifecycle coverage
api/connect/connect_test.go, api/connect/helpers_test.go, api/connect/connect_suite_test.go
The old suite entry point is removed. Shared HTTP, streaming, deadline, channel, and cluster test helpers are added. New tests cover API options, procedure registration, admission limits, metrics, streaming lifecycles, error handling, and panic cases.
Connect health and status test migration
api/connect/health_test.go, api/connect/status_test.go
Health and status tests now use standard test functions, subtests, Testify assertions, cleanup helpers, shared servers, and h2c clients while preserving the existing scenarios and expectations.
End-to-end harness and service tests
test/e2e/e2e_suite_test.go, test/e2e/harness_test.go, test/e2e/routing_test.go, test/e2e/status_test.go
The Ginkgo suite entry point is removed. The e2e harness uses TestMain, shared request timeouts, testing.TB, t.TempDir, t.Cleanup, and require.Eventually. Routing and status tests use table-driven subtests and remain sequential because of process-global router state.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~30 minutes

Merge Risk: ⚪ Minimal · up to ab332

No actionable merge-blocking risk remains in the test migration.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 7 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: replacing Ginkgo-based tests with standard Go testing patterns.
Description check ✅ Passed The description explains the migration, records the relevant checklist items, and states that there are no user-facing changes. It omits several non-applicable checklist entries, but the required info…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 7 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🧪 Generate unit tests (beta)
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR

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.

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.

1 participant