The Simplest Way to Make Cypress and Teamcity Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

You pair cypress and teamcity by running browser tests inside your build agents. This setup checks every code change before your team ships it to users. TeamCity builds your app and starts the test runner on a clean machine. Cypress then opens a real browser and clicks through your app like a user. If a test fails, the build stops right away and alerts your team. How cypress and teamcity share keys and data TeamCity controls the build steps and holds the secret keys for your tests. When a bu

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.

You pair cypress and teamcity by running browser tests inside your build agents. This setup checks every code change before your team ships it to users.

TeamCity builds your app and starts the test runner on a clean machine. Cypress then opens a real browser and clicks through your app like a user. If a test fails, the build stops right away and alerts your team.

How cypress and teamcity share keys and data

TeamCity controls the build steps and holds the secret keys for your tests. When a build starts, the server sends these keys to a build agent. The agent sets up the test app and starts the browser runner.

Your tests need a way to log in to the test app. Teams pass user names, passwords, and API keys from the build server to the runner. The runner reads these values from memory and uses them during the test run.

Data flows back to the build server when the browser tests finish. The runner writes test results, screen shots, and videos to the agent disk. The build server reads these files and shows them on the build page. Developers check these logs to find and fix broken code fast.

If your tests use cloud recording features, the agent also talks to outside servers. It sends test logs and videos over the web using a record key. You must guard this key so outsiders cannot read your test results.

Common failure modes in test builds

Many teams use one shared admin account for all their browser tests. This choice creates big risks if a build log prints the password by mistake. Anyone who reads the build log can then use that admin account. If multiple agents use the same user at once, tests also break each other.

Broad API keys are another common trap in build pipelines. Teams often give the build agent a key that can change any project setting. If bad code runs during a test, it can steal that broad key. The attacker can then read source code or change other build jobs.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Unlogged database queries during test runs also cause headaches for teams. Tests often seed data or reset tables before the browser opens the app. When agents use a shared database login, you cannot tell which build broke a table. Sensitive test data like emails or card numbers can also leak into build logs.

How to scope roles and network paths

Start by giving each build project its own small set of keys. Never share secret keys across every project on your build server. Mark all passwords and tokens as hidden values so they never print in logs.

Create test users with the smallest role needed for each browser test. If a test checks a buyer page, use a buyer role, not an admin role. Reset or delete these test users after the build job ends.

Lock down the network path between your build agents and your test apps. Put your build agents in a private network segment with strict firewall rules. Allow agents to reach only the test app and the database ports they need. Block agents from reaching production servers or internal admin tools.

Clean up the build agent disk after every single test run. Delete saved videos, screen shots, and browser caches once the server saves them. This step stops the next build job from reading leftover files and keys.

Govern statements and responses across databases and APIs

Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.

First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

How do we stop flaky tests from blocking our build queue?

Set a hard time limit on every browser test step in your build job. Turn on test retries for network blips, and split big test suites across multiple agents.

Where should we store test passwords and API keys?

Store all secrets inside the password store on your build server, never in code files. Scope those secrets to the single project that runs the browser tests.

How can we keep test runs fast as our app grows?

Cache your node files and browser binaries on the build agent disk between runs. Run independent test files at the same time across several build agents.

The query runs. The emails stay hidden.