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

Introduce test isolation and fix missing GCS service account #2935

Merged
merged 1 commit into from
Mar 1, 2025

Conversation

wiktorn
Copy link
Collaborator

@wiktorn wiktorn commented Mar 1, 2025

Fix tests:

  • examples_e2e.test_plan.test_example[terraform:modules/gcs:GCS notifications:1]
  • examples_e2e.test_plan.test_example[terraform:modules/gcs:Cloud KMS:1]

By adding google_storage_project_service_account and google_bigquery_default_service_account to setup_module for E2E tests. This should fix the issue with missing service accounts reported by some of the tests:

Error 400: Service account service-***@gs-project-accounts.iam.gserviceaccount.com does not exist., badRequest

Fix tests using Private Service Access with ABANDON policy, by adding a new tag to tests: isolated.

Isolated tests do not reuse test project, but instead they always get a fresh one, and it is discarded after the test is run. As ABANDON policy to remove results in project in a different state than starting one, this solves the issue we saw with some tests recently.

Tests where looking flaky, as which test failed was depending on execution order and allocation to threads, and the more the threads, the lesser risk that one of the tests fails.

Failure message for PSA was:

google_service_networking_connection.psa_connection...:
Error: Error waiting for Create Service Networking Connection: Error code 9, message: Cannot modify allocated ranges in CreateConnection. Please use UpdateConnection.

Checklist

I applicable, I acknowledge that I have:

  • Read the contributing guide
  • Ran terraform fmt on all modified files
  • Regenerated the relevant README.md files using tools/tfdoc.py
  • Made sure all relevant tests pass

@wiktorn
Copy link
Collaborator Author

wiktorn commented Mar 1, 2025

E2E test run

@wiktorn wiktorn force-pushed the fix_gcs_account_e2e branch from 702eeeb to e90a377 Compare March 1, 2025 12:07
@wiktorn wiktorn merged commit 12979e8 into master Mar 1, 2025
19 checks passed
@wiktorn wiktorn deleted the fix_gcs_account_e2e branch March 1, 2025 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants