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

do not fail acceptance test when provider returns a warning #448

Merged
merged 2 commits into from
Feb 2, 2023

Conversation

bcmdarroch
Copy link
Contributor

🛠️ Description

Quick fix. During the Preconfig step (prior to plan or apply), the HCP provider checks the HCP status page and returns a warning if there is any degraded performance or outage. The acceptance tests were exiting on any error during the preconfig step, so it was failing on the status page warnings. This PR checks the Severity of the returned error (type Diagnostic) and allows tests to proceed despite any warnings.

Output from acceptance testing:

$ make testacc TESTARGS='-run=Packer'

--- PASS: TestAcc_dataSourcePacker (7.36s)
--- PASS: TestAcc_dataSourcePacker_revokedIteration (9.72s)
--- PASS: TestAcc_dataSourcePackerImage (6.20s)
--- PASS: TestAcc_dataSourcePackerImage_revokedIteration (8.97s)
--- PASS: TestAcc_dataSourcePackerImage_channelAndIterationIDReject (2.35s)
--- PASS: TestAcc_dataSourcePackerImage_channelAccept (4.64s)
--- PASS: TestAcc_dataSourcePackerIteration (4.27s)
--- PASS: TestAcc_dataSourcePackerIteration_revokedIteration (9.83s)
--- PASS: TestAccPackerChannel (7.19s)
--- PASS: TestAccPackerChannel_AssignedIteration (6.43s)
--- PASS: TestAccPackerChannel_UpdateAssignedIteration (9.97s)
--- PASS: TestAccPackerChannel_UpdateAssignedIterationWithFingerprint (4.83s)
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/provider	82.386s

@bcmdarroch bcmdarroch requested a review from a team February 2, 2023 20:30
@bcmdarroch bcmdarroch changed the title do not fail acceptance test if provider returns a warning do not fail acceptance test when provider returns a warning Feb 2, 2023
Copy link
Contributor

@nywilken nywilken left a comment

Choose a reason for hiding this comment

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

Nice catch! 🚀

@bcmdarroch bcmdarroch merged commit 3294503 into main Feb 2, 2023
@bcmdarroch bcmdarroch deleted the dont-fail-acctest-on-warning branch February 2, 2023 22:09
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.

2 participants