Skip to content

refactor: convert pure unit tests from Ginkgo to table-driven#1499

Open
comtalyst wants to merge 2 commits intocomtalyst/test-reunificationfrom
refactor/ginkgo-to-table-driven
Open

refactor: convert pure unit tests from Ginkgo to table-driven#1499
comtalyst wants to merge 2 commits intocomtalyst/test-reunificationfrom
refactor/ginkgo-to-table-driven

Conversation

@comtalyst
Copy link
Collaborator

Fixes #

Description

Converts pure unit tests (no external dependencies, no provisioning, no env.Client) from Ginkgo BDD-style to standard Go table-driven tests for improved developer experience and faster execution.

Files converted:

  • pkg/apis/v1beta1: hash, localdns, status tests
  • pkg/apis/v1alpha2: hash, localdns, status tests
  • pkg/utils: subnet parser tests
  • pkg/providers/instance: helpers and utils tests
  • pkg/providers/instancetype: ephemeral disk and kube reserved (extracted to separate files)
  • pkg/metrics: image selection error count
  • pkg/operator/options: validation, env var fallback, all option tests

E2E tests using ExpectProvisionedAndWaitForPromises or env.Client remain in Ginkgo.

How was this change tested?

  • All converted tests verified passing: go test -v -run TestXxx ./pkg/...
  • Full build verified: go build ./...
  • Lint verified: golangci-lint-custom run passes with 0 issues on all modified packages
  • Same test cases and assertions preserved — no test logic dropped

Does this change impact docs?

  • Yes, PR includes docs updates
  • Yes, issue opened: #
  • No

Release Note


@comtalyst comtalyst force-pushed the refactor/ginkgo-to-table-driven branch 2 times, most recently from 35517ad to 3046b8e Compare March 7, 2026 09:46
@comtalyst comtalyst force-pushed the comtalyst/test-reunification branch from 8b2b5bf to 3c495a6 Compare March 7, 2026 09:48
@comtalyst comtalyst force-pushed the refactor/ginkgo-to-table-driven branch from 3046b8e to 3537d4c Compare March 7, 2026 09:48
@comtalyst comtalyst force-pushed the comtalyst/test-reunification branch from 3c495a6 to f26017e Compare March 7, 2026 11:28
@comtalyst comtalyst force-pushed the refactor/ginkgo-to-table-driven branch from 3537d4c to fc50bf7 Compare March 7, 2026 11:30
…codebase

Converts pure unit tests (no external dependencies, no provisioning, no
env.Client) from Ginkgo BDD-style to standard Go table-driven tests for
improved developer experience and faster execution.

Files converted:
- pkg/apis/v1beta1: hash, localdns, status tests
- pkg/apis/v1alpha2: hash, localdns, status tests
- pkg/utils: subnet parser tests
- pkg/providers/instance: helpers and utils tests
- pkg/providers/instancetype: ephemeral disk and kube reserved (extracted)
- pkg/metrics: image selection error count
- pkg/operator/options: validation, env var fallback, all option tests

E2E tests using ExpectProvisionedAndWaitForPromises remain in Ginkgo.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@comtalyst comtalyst force-pushed the refactor/ginkgo-to-table-driven branch from fc50bf7 to 9288de1 Compare March 7, 2026 12:28
The file no longer uses Ginkgo and has been fully converted to standard
Go table-driven tests, so the Ginkgo-convention "suite_test.go" name
is misleading. Rename to "options_test.go" per standard Go conventions.

Addresses review comment on PR #1499.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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