The Simplest Way to Make Gerrit and Selenium Work Like They Should
Teams use gerrit and selenium together to run browser tests on proposed code changes. This setup blocks bad updates before a human reviewer merges the branch. Gerrit manages code reviews and holds changes in a staging area. Selenium drives web browsers to test how the web app works. When you link them, every new patch triggers a real browser test run. Developers get fast feedback right inside their code review screen. How gerrit and selenium share data and permissions The workflow starts whe
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 use gerrit and selenium together to run browser tests on proposed code changes. This setup blocks bad updates before a human reviewer merges the branch.
Gerrit manages code reviews and holds changes in a staging area. Selenium drives web browsers to test how the web app works. When you link them, every new patch triggers a real browser test run. Developers get fast feedback right inside their code review screen.
How gerrit and selenium share data and permissions
The workflow starts when a developer pushes a new commit to Gerrit. Gerrit sends an event notice to a build runner in your pipeline. The build runner pulls the staged code and starts a temporary test app. Next, the runner starts Selenium to check the user interface in a browser.
Both tools need clear permissions to talk to each other. The build runner needs a read role in Gerrit to pull the patch. It also needs permission to post a review score back to the change. Selenium needs network paths to reach the temporary web app and browser nodes.
Data flows in a clear loop between the two systems. Gerrit sends branch names and commit hashes out to the test runner. Selenium generates test results, screen captures, and browser logs during the run. The runner summarizes those results and writes a vote back to Gerrit. If the browser tests pass, Gerrit marks the patch ready for human review.
Common failure modes and how to scope roles
Many teams fail by using one shared admin account for all test runs. When a shared token leaks, an attacker can merge bad code into production. Shared accounts also make audit logs hard to read during an incident. You cannot tell which pipeline job changed a review score.
Broad network paths create another big risk during browser tests. Selenium nodes often run inside the same network as internal tools. If a test script has a bug, the browser might reach private databases. Unlogged database queries from test apps also hide data leaks from security teams.
End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
You can fix this by giving each bot a narrow role. Create a dedicated service account in Gerrit just for browser test feedback. Limit this account so it can only read staged branches and post scores. Never give your test runner permission to merge code or change repo rules.
Scope the network paths for your browser grid just as tightly. Place the Selenium nodes in an isolated network zone. Allow traffic only between the browser nodes and the temporary test app. Block the browser nodes from talking to production hosts or internal admin pages.
Keeping test data safe during browser runs
Browser tests need realistic data to check forms and user flows. Many teams make the mistake of copying raw production data into test apps. When Selenium fills out forms, sensitive values end up in test screenshots. Those screenshots often go to shared storage where anyone can read them.
Always scrub or mask sensitive fields before your test suite runs. Good masking rewrites matched fields like emails, phone numbers, and card numbers in results. It also rewrites national IDs so real customer records stay safe. Your browser tests still check the page layout, and your logs stay clean.
Rotate the keys for your Gerrit bot account on a regular schedule. Store those keys in a secret store rather than in plain text scripts. Check your Gerrit audit logs each month to spot strange voting patterns. Clean up old browser containers after every test run so state never leaks.
Add runtime guardrails and masking beside your databases and APIs
Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.
Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.
Frequently asked questions
Should every Gerrit patch run the full Selenium suite?
No, full browser suites take too long for every small commit. Run fast smoke tests on every patch and run full suites before merge.
How should Selenium send test results back to Gerrit?
Selenium should not talk to Gerrit directly. Have your build runner read the Selenium report and post the score to Gerrit.
What permissions does the Gerrit test bot need?
The bot only needs permission to read changes and post review labels. Do not grant it admin rights or permission to submit code.
Related guides
In this post