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

Move test utilities to test package fromt utils folder to move ginkgo v1 import #3208

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

Brian-McM
Copy link
Contributor

@Brian-McM Brian-McM commented Feb 28, 2024

Description

Currently we import ginkgo v1 in the utils.go folder for test utilities.
This means that anything importing the controllers package also
imports ginkgo v1, and if that importer also imports ginkgo v2 then a
panic will occur.

Moving the test utilities to the test folder ensures we don't import
ginkgo v1 when we're using the controller libraries.

For PR author

  • Tests for change.
  • If changing pkg/apis/, run make gen-files
  • If changing versions, run make gen-versions

For PR reviewers

A note for code reviewers - all pull requests must have the following:

  • Milestone set according to targeted release.
  • Appropriate labels:
    • kind/bug if this is a bugfix.
    • kind/enhancement if this is a a new feature.
    • enterprise if this PR applies to Calico Enterprise only.

@Brian-McM Brian-McM requested a review from a team as a code owner February 28, 2024 20:59
@marvin-tigera marvin-tigera added this to the v1.34.0 milestone Feb 28, 2024
@Brian-McM Brian-McM force-pushed the bm-update-test-package-names branch 2 times, most recently from 5fb4f1a to 672dee0 Compare February 28, 2024 21:47
@Brian-McM Brian-McM changed the title Update test pacakges to have _test suffix / ensure ginkgo instead imp… Update test pacakges to have _test suffix / ensure ginkgo isn't imported for non test packages Mar 19, 2024
@Brian-McM Brian-McM force-pushed the bm-update-test-package-names branch from 672dee0 to 32198df Compare March 19, 2024 15:09
@Brian-McM Brian-McM changed the title Update test pacakges to have _test suffix / ensure ginkgo isn't imported for non test packages Update test packages to have _test suffix / ensure ginkgo isn't imported for non test packages Mar 19, 2024
… v1 import

Currently we import ginkgo v1 in the utils.go folder for test utilities.
This means that anything importing the controllers package also
imports ginkgo v1, and if that importer also imports ginkgo v2 then a
panic will occur.

Moving the test utilities to the test folder ensures we don't import
ginkgo v1 when we're using the controller libraries.
@Brian-McM Brian-McM force-pushed the bm-update-test-package-names branch from 32198df to d522394 Compare March 27, 2024 16:43
@Brian-McM Brian-McM changed the title Update test packages to have _test suffix / ensure ginkgo isn't imported for non test packages Move test utilities to test package fromt utils folder to move ginkgo v1 import Mar 27, 2024
Copy link
Member

@tmjd tmjd left a comment

Choose a reason for hiding this comment

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

LGTM

@Brian-McM Brian-McM merged commit b9cfc07 into tigera:master Mar 28, 2024
5 checks passed
@Brian-McM Brian-McM deleted the bm-update-test-package-names branch March 28, 2024 16:08
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