The Simplest Way to Make Argo Workflows and Cypress Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair argo workflows and cypress to run browser tests inside Kubernetes clusters. Argo starts the test steps, and Cypress checks the web app in a browser. This setup lets engineering teams run hundreds of tests at the same time. Each workflow step starts a clean pod, runs a test suite, and saves results. When the test ends, Kubernetes deletes the pod right away. Teams do not need to keep idle test servers running all day. They get fast feedback on every code change with low cloud costs.

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 argo workflows and cypress to run browser tests inside Kubernetes clusters. Argo starts the test steps, and Cypress checks the web app in a browser.

This setup lets engineering teams run hundreds of tests at the same time. Each workflow step starts a clean pod, runs a test suite, and saves results. When the test ends, Kubernetes deletes the pod right away. Teams do not need to keep idle test servers running all day. They get fast feedback on every code change with low cloud costs.

How argo workflows and cypress share keys and data

Argo runs each workflow step inside its own Kubernetes pod. To start a test, the pod pulls the Cypress container image and test files. The pod also needs keys to log in to the staging web app. Teams often store these keys in Kubernetes secrets and mount them into pods. Cypress reads those values at run time to fill out login forms.

During the run, the browser talks to the web app over the network. If a test fails, Cypress takes a screenshot and records a video file. Before the pod stops, Argo uploads these files to cloud object storage. Developers then check the saved logs and videos to fix broken code. Clear network rules and storage roles keep this whole data flow safe.

Common failure modes and how to scope roles

Many teams reuse one shared service account for every single test workflow. That account often holds broad cluster permissions that test pods do not need. If a test script breaks or leaks, an attacker gains broad cluster control. Teams also pass shared admin logins into browser tests to save setup time. When ten pods use one admin login, nobody knows which run changed data. Even worse, failed test logs might dump raw passwords or user emails in plain text.

To fix this, give the Argo workflow controller a tight Kubernetes role. Create a separate service account just for the Cypress test pods. That account should only have permission to write artifacts to one storage bucket. It must never have permission to read cluster secrets from other namespaces. On the network side, use Kubernetes network policies to lock down pod traffic. Allow the test pod to reach only the staging app and artifact storage. Block all traffic from test pods to production databases and internal admin tools.

Access Request Workflows + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Managing test state and parallel runs in Kubernetes

Running browser tests in parallel creates new problems with shared app state. Two Cypress pods might edit the same test user profile at once. One pod changes a setting while the second pod checks the old value. The second test fails even though the web app code works fine. Teams waste hours chasing these false alarms in their build pipelines.

Solve this by giving each parallel pod its own test user account. Before the browser starts, an early workflow step can seed fresh test data. When the browser tests finish, a final cleanup step deletes that temporary data. Also set clear CPU and memory limits on every Cypress pod in Argo. Headless browsers use a lot of memory and can crash shared cluster nodes. Setting firm resource limits keeps one heavy test run from starving other pods. If a test hangs on a slow page, Argo should stop the pod. Set an active deadline on the workflow so stuck browsers do not run forever.

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 do we pass login secrets to Cypress pods safely?

Mount scoped secrets into the pod only for the single test run. Use unique test accounts with low permissions instead of shared admin logins.

Where should Argo store Cypress screenshots and test videos?

Set up Argo to push output files to a dedicated cloud storage bucket. Scope the pod storage role so it can only write to one path.

How do we stop Cypress pods from reaching production services?

Apply a Kubernetes network policy to the namespace where test workflows run. Allow traffic only to your staging app URL and the artifact storage service.

The query runs. The emails stay hidden.