tree: fa1c0bab2dfd0e0b7fecc505287edca0e42b1091
  1. internal/
  2. .gitignore
  3. doc.go
  4. e2e_test.go
  5. go.mod
  6. go.sum
  7. inventory_test.go
  8. README.md
e2e_tests_v2/README.md

OS Config E2E Tests (v2)

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.

Running Local Unit Tests

Local unit tests do not require GCP credentials or cloud resources:

cd e2e_tests_v2
go test ./...

Running E2E Cloud Tests

  1. Ensure you have Application Default Credentials:

    gcloud auth application-default login
    
  2. Run the E2E tests with default settings:

    go test -tags=e2e -v -count=1 -parallel=5 -timeout=60m .
    
  3. 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
    
  4. 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
    

Available Configuration Flags

FlagDefaultDescription
-projectgcloud-parity-testingGCP project ID for test resources
-zoneus-central1-aGCP zone for test instances
-networkglobal/networks/defaultVPC network for test instances
-subnetwork""VPC subnetwork for test instances
-service_accountdefaultService account for test instances
-test_timeout60mExecution timeout per test run
-poll_interval10sPolling interval for instance status and guest attributes
-cleanup_timeout5mTimeout for VM teardown and resource cleanup
-max_concurrent_vms5Maximum number of concurrent test instances
-artifact_file./artifacts/junit.xmlPath to JUnit XML test report (and directory for test artifacts)