This package contains the test suites and infrastructure for running OS Config end-to-end (E2E) tests against Google Cloud Platform Compute Engine instances using standard Go testing tooling.
Local unit tests do not require GCP credentials or cloud resources:
cd e2e_tests_v2 go test ./...
Ensure you have Application Default Credentials:
gcloud auth application-default login
Run the E2E tests with default settings:
go test -tags=e2e -v -count=1 -parallel=5 -timeout=60m .
Override configuration using command-line flags:
go test -tags=e2e -v -count=1 -parallel=5 -timeout=60m . \ -project=my-test-project \ -zone=us-central1-b \ -max_concurrent_vms=10
Run a specific test case (use -timeout=30m for long-running tests like Windows):
go test -tags=e2e -v -count=1 -timeout=30m -run '^TestOSInventory/windows-2016$' . \ -project=my-test-project \ -zone=us-central1-a
| Flag | Default | Description |
|---|---|---|
-project | gcloud-parity-testing | GCP project ID for test resources |
-zone | us-central1-a | GCP zone for test instances |
-network | global/networks/default | VPC network for test instances |
-subnetwork | "" | VPC subnetwork for test instances |
-service_account | default | Service account for test instances |
-test_timeout | 60m | Execution timeout per test run |
-poll_interval | 10s | Polling interval for instance status and guest attributes |
-cleanup_timeout | 5m | Timeout for VM teardown and resource cleanup |
-max_concurrent_vms | 5 | Maximum number of concurrent test instances |
-artifact_file | ./artifacts/junit.xml | Path to JUnit XML test report (and directory for test artifacts) |