Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/temporal-sa/temporal-cloud-proxy/llms.txt

Use this file to discover all available pages before exploring further.

The test suite covers authentication (JWT and SPIFFE), the crypto layer (cipher operations, caching materials manager, AWS KMS provider, and GCP KMS provider), proxy routing and workload dispatch, and configuration validation. Tests use the standard Go testing package with testify assertions and are organized by package to mirror the source layout.

Test Commands

The Makefile provides a complete set of test targets. All targets run against the entire module (./...) unless noted otherwise.
make test              # go test ./...
make test-verbose      # go test -v ./...
make test-coverage     # go test -cover ./...
make test-race         # go test -race ./...
make test-short        # go test -short ./...
make test-clean        # go clean -testcache
make benchmark         # go test -bench=. ./...

Package-Specific Tests

Run tests for a single package when you are iterating on a specific component:
make test-auth         # go test ./auth/...
make test-crypto       # go test ./crypto/...
make test-proxy        # go test ./proxy/...
There is also a make test-utils target (go test ./utils/...) for running tests in the utils package.

Coverage

Generate a per-file coverage profile and open it in your browser to identify untested code paths:
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out
The HTML report highlights covered lines in green and uncovered lines in red, making it straightforward to identify gaps in the auth, crypto, and proxy packages where business logic is concentrated.

Race Detection

The -race flag instruments memory accesses at runtime and reports any concurrent read/write conflicts:
make test-race
Always run make test-race before opening a pull request. Race conditions are particularly likely in two places: the sync.RWMutex that guards connectionMux in proxy/proxy.go (read-locked for every Invoke call, write-locked only during startup) and the sync.RWMutex in CachingMaterialsManager in crypto/caching_materials_manager.go (which protects the LRU cache during concurrent encrypt/decrypt operations).

Benchmarks

The crypto package contains dedicated benchmark functions in benchmark_test.go. The benchmarks cover encryption, decryption, and full encrypt-then-decrypt cycles with and without the LRU key cache enabled, allowing you to measure the impact of caching on KMS call latency. Run benchmarks for the crypto package specifically to focus on KMS-related measurements:
go test -bench=. -benchmem ./crypto/...
The crypto benchmarks require a real AWS KMS key. They check for the KMS_KEY_ID and AWS_REGION environment variables at startup and call b.Skip(...) automatically if they are not set — so the standard make test target will skip them safely in environments without AWS credentials.
To run all benchmarks across every package (including any added outside the crypto package):
make benchmark

CI

Use make test-clean to clear the Go test cache before running tests against changed configuration files or environment variables. The test cache keys on source file hashes, not on environment state, so stale cached results can mask failures when only config or env vars have changed.
All tests run automatically on every push and every pull request via the GitHub Actions CI workflow. The test job sets up Go 1.24 and executes go test -v ./..., reporting per-test pass/fail output directly in the pull request checks.

Build docs developers (and LLMs) love