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

test: Fabric Connections test sweeper #720

Merged
merged 3 commits into from
Jul 18, 2024

Conversation

thogarty
Copy link
Contributor

@thogarty thogarty commented Jul 3, 2024

  • Add test sweeper for fabric connections
  • Modify internal/sweep package with constants, list var, and methods to support test sweeping for fabric
  • Add config for fabric test client

Copy link
Contributor

@ctreatma ctreatma left a comment

Choose a reason for hiding this comment

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

The sweeper isn't getting called in CI because the GitHub Actions workflow is currently set up to only look for sweepers in the equinix directory. You can update the Fabric acctest workflow to find sweepers in both the old and new locations by copying the command sweeper step of the Metal acctest workflow: https://github.com/equinix/terraform-provider-equinix/blob/main/.github/workflows/acctest.yml#L115-L124

@thogarty thogarty added the area/resources/fabric Issues related to Fabric and ECX APIs label Jul 16, 2024
@thogarty
Copy link
Contributor Author

The sweeper isn't getting called in CI because the GitHub Actions workflow is currently set up to only look for sweepers in the equinix directory. You can update the Fabric acctest workflow to find sweepers in both the old and new locations by copying the command sweeper step of the Metal acctest workflow: https://github.com/equinix/terraform-provider-equinix/blob/main/.github/workflows/acctest.yml#L115-L124

@ctreatma , it's been updated. I also changed the filter from some type of sweeper suffix to all fabric sweepers because they have been made to search for any resource that matches fabric suffixes. We just run it with different users to ensure all our created resources are swept properly.

@thogarty thogarty force-pushed the CXF-93684-connection-test-sweeper branch from e7c6aec to fdc8c22 Compare July 16, 2024 03:25
@@ -25,6 +27,7 @@ func TestMain(m *testing.M) {
func addTestSweepers() {
connection.AddTestSweeper()
device.AddTestSweeper()
fabric_connection.AddTestSweeper()
Copy link
Contributor

Choose a reason for hiding this comment

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

Not relevant for this PR or even for the Fabric team but the existing Metal sweepers in this file should all be renamed to metal_<resource>.

@ctreatma
Copy link
Contributor

I was wondering why CI was still not running the new sweeper for this PR and then I remembered that the acceptance test workflow is configured with the pull_request_target trigger, so GHA will not use the updated workflow file from the PR for security.

I ran the workflow manually and confirmed that the sweeper is now being run in CI: https://github.com/equinix/terraform-provider-equinix/actions/runs/9959400532

Copy link
Contributor

@ctreatma ctreatma left a comment

Choose a reason for hiding this comment

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

Workflow and sweeper wiring looks good to me, but someone on the Fabric team should validate that the sweeper job did what it was expected to do.

@thogarty thogarty force-pushed the CXF-93684-connection-test-sweeper branch from fdc8c22 to b871b6d Compare July 18, 2024 22:02
Copy link
Contributor

@jkallem-equinix jkallem-equinix left a comment

Choose a reason for hiding this comment

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

LGTM

@thogarty thogarty merged commit 2633c91 into main Jul 18, 2024
7 of 11 checks passed
@thogarty thogarty deleted the CXF-93684-connection-test-sweeper branch July 18, 2024 22:11
Copy link

This PR is included in version 2.3.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/resources/fabric Issues related to Fabric and ECX APIs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants