The Simplest Way to Make Cloud Run and Testcomplete Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair cloud run and testcomplete to run automated checks against serverless web apps. Cloud Run hosts the web app containers, and TestComplete drives browser tests against those endpoints. This setup lets engineering teams test every new build before users see it. Each code push spins up a fresh container revision for the test runner to check. When the checks pass, the team shifts live traffic to the new revision. How cloud run and testcomplete share roles and data Cloud Run runs statel

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Teams pair cloud run and testcomplete to run automated checks against serverless web apps. Cloud Run hosts the web app containers, and TestComplete drives browser tests against those endpoints.

This setup lets engineering teams test every new build before users see it. Each code push spins up a fresh container revision for the test runner to check. When the checks pass, the team shifts live traffic to the new revision.

How cloud run and testcomplete share roles and data

Cloud Run runs stateless containers on demand and scales them up or down. TestComplete runs UI and API checks from a dedicated test machine or build agent. To work together, the test runner must reach the container URL and log in.

Most teams protect test revisions with cloud identity rules instead of public links. The test agent uses a dedicated service account to request an identity token. It sends that token in the request header when it calls the container URL.

Inside the app, the test script also needs an app user login. Teams store these test user keys in a central secret store. The build pipeline reads the secret and passes it to the test runner at runtime. After the run finishes, the agent writes test logs and screenshots to cloud storage.

Common failure modes and how to scope access

Many teams make the mistake of using one shared admin account for all tests. When a test fails or changes data, nobody knows which job caused the problem. Shared long-lived keys also create a big risk if a build log leaks them.

Broad network rules cause another common failure in serverless testing. Teams often open the test container to the whole internet to make tests work fast. Anyone who guesses the URL can hit the test app and read staging data.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

To fix this, give each test suite its own narrow service role. That role should only have permission to invoke the specific test service under check. Set up the container ingress rules so only your build network can reach it. Rotate the app login keys often and purge old test tokens after every build.

Managing test databases and sensitive fields

UI tests need realistic data in the backend database to check every screen. Copying real user records into a test database creates a major privacy risk. Test logs and failure screenshots can capture real emails, phone numbers, or card numbers.

Teams should seed test databases with fake records before the test suite starts. If a test must query a shared staging database, apply data masking to the query results. Masking rewrites matched fields like emails and national IDs in results before the app displays them. This keeps sensitive values out of test reports while keeping the app layout intact.

You should also log every database query that the test container runs. Clear logs help developers spot slow queries and broken data states right away. When a UI check fails, the team can link the test step to the exact query.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

How does TestComplete reach a private Cloud Run service?

The build agent requests a short-lived identity token from the cloud provider using a service account. TestComplete attaches this token to its web requests, or the agent routes traffic through a private network tunnel.

How do we stop cold starts from breaking UI timeouts?

Set a minimum instance count of one on the test revision during the test window. You can also send a simple warmup ping to the health endpoint before the main test suite starts.

Where should we store login keys for TestComplete scripts?

Never save passwords inside the project files or source code repo. Store them in a cloud secret manager and inject them into the test runner as temporary variables during the build.

The query runs. The emails stay hidden.