-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
tests/provider: Skip unsupported tests with PreChecks #14188
Comments
You do not need access to GovCloud to assist with adding prechecks!When verifying that a precheck works properly, the test should be skipped when preconditions are not met. However, it is also important to ensure that the test is not skipped when preconditions are met. For example, if you add a precheck for a service and do not access to GovCloud, verifying that tests aren't skipped in the standard/AWS partition is sufficient. What a skipped test will look like:
What a test looks like that is not skipped:
Endpoints still failing (e.g., no such host):
|
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you! |
Community Note
Description
We currently use
PreCheck
functions in acceptance tests to ensure that acceptance tests can be executed in the current partition, account, and/or region. If an endpoint does not exist or a sample operation returns certain error values, the test is skipped.These are some examples of what a precheck looks for:
testAccPartitionHasServicePreCheck("codestar", t)
verifies that the CodeStar service is available.In the acceptance test, add a call to an endpoint precheck (e.g.,
testAccPartitionHasServicePreCheck("codestar", t)
below) and/or a custom precheck function that tests for necessary underlying conditions for the test to be run:An example of a custom precheck:
These checks can only run against the default provider configuration. In some cases, a
PreCheck
needs to run against an alternate provider configuration, such as for an alternate region or account.Add functions to the testing suite that will configure AWS API connections using the authentication configuration settings for acceptance tests.
The text was updated successfully, but these errors were encountered: