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

Add acceptance and internal tests for gcs backend, add some test helper functions #35026

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

SarahFrench
Copy link
Member

@SarahFrench SarahFrench commented Apr 18, 2024

Historically the gcs backend hasn't been touched much. In the past I've added a few features but largely left the existing codebase as it was previously. Recently the gcs backend was refactored in #34989 to avoid using the old SDK.

As part of reviewing that PR I started adding a few acceptance tests in this PR. There's a lot more work to be done but I want to avoid this PR getting too big.

This PR:

  • Separates acceptance tests and 'internal' tests into separate _test.go files
  • Implements some pre-check functions to test for TF_ACC being set and credentials being supplied by the test environment
    • When this info is missing the tests are skipped, to enable checks passing in this repo. This repo has no automated testing of the gcs backend set up (//TODO!)
  • Adds internal tests that assert:
    • TestBackendConfig_encryptionKey - how the config and ENVs for customer-supplied encryption keys are used
    • TestBackendConfig_kmsKey - how the config and ENVs for customer-managed (KMS) encryption keys are used
  • Adds acc tests the assert:
    • TestAccBackendConfig_credentials - empty strings in the backend config don't interrupt use of ENVs for creds.
    • Note: we cannot have tests where we assert a failure, due to legacy reasons.

Target Release

1.8.x

Draft CHANGELOG entry

NEW FEATURES | UPGRADE NOTES | ENHANCEMENTS | BUG FIXES | EXPERIMENTS

@SarahFrench
Copy link
Member Author

Just rebased to include the latest gcs PR

Move `TestBackendEncryptionKeyEmptyConflict` test to internal test file
@SarahFrench SarahFrench marked this pull request as ready for review April 26, 2024 11:25
@SarahFrench SarahFrench requested a review from a team as a code owner April 26, 2024 11:25
@SarahFrench SarahFrench changed the title Add tests for gcs backend Add acceptance and internal tests for gcs backend, add some test helper functions Apr 26, 2024
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.

None yet

1 participant