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: Connections test sweeper #128

Merged
merged 3 commits into from
Sep 25, 2024
Merged

test: Connections test sweeper #128

merged 3 commits into from
Sep 25, 2024

Conversation

thogarty
Copy link
Collaborator

  • Add sweeper package to tests
    • Create config for getting fabric client
    • Add connections test sweeper
    • Add main RunSweeper method for when additional sweepers are added (can allow for synchronization of certain resources being destroyed first)
  • Add TestMain to all Package tests to run test sweepers only once; after the end of all test execution

@srushti-patl
Copy link
Collaborator

Could you please include a screenshot of the Sweeper test cases passing locally?

connectionsSearchRequest := fabricv4.SearchRequest{
Filter: &fabricv4.Expression{
And: []fabricv4.Expression{
{
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks good 👍

@thogarty
Copy link
Collaborator Author

thogarty commented Sep 25, 2024

Could you please include a screenshot of the Sweeper test cases passing locally?

@srushti-patl Yes, test output here:

thogarty ~/workspace/terraform-equinix-fabric/tests/uat [connections_test_sweeper] $ go test ./... -v -run "(sweeperonly)"                                
testing: warning: no tests to run
PASS
2024/09/25 16:06:51 [DEBUG] Sweeping Fabric Connections
2024/09/25 16:06:51 [DEBUG] POST https://uatapi.equinix.com/fabric/v4/connections/search
2024/09/25 16:06:52 [DEBUG] Deleting Connection: fcr_2_wan_PFCR
2024/09/25 16:06:52 [DEBUG] DELETE https://uatapi.equinix.com/fabric/v4/connections/22967fee-66ad-45da-8bf0-52884163b12c
ok  	github.com/equinix/terraform-equinix-fabric/tests/uat	2.221s [no tests to run]

@thogarty thogarty merged commit 230c65f into main Sep 25, 2024
3 checks passed
@thogarty thogarty deleted the connections_test_sweeper branch September 25, 2024 23:44
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.

3 participants