The Simplest Way to Make Gogs and Selenium Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair gogs and selenium to run browser tests when code changes. A commit in your Git server triggers automated checks on your web app. This setup catches user interface bugs before new code reaches real users. Developers push code to a branch and get test feedback right away. Fast test runs keep your main branch stable and ready for release. How gogs and selenium pass data and permissions Gogs is a lightweight Git server that hosts your source code repos. Selenium controls web browsers

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 gogs and selenium to run browser tests when code changes. A commit in your Git server triggers automated checks on your web app.

This setup catches user interface bugs before new code reaches real users. Developers push code to a branch and get test feedback right away. Fast test runs keep your main branch stable and ready for release.

How gogs and selenium pass data and permissions

Gogs is a lightweight Git server that hosts your source code repos. Selenium controls web browsers to test how your app works for users. These two tools do not talk to each other on their own. You need a build server in the middle to link them together.

First, a developer pushes a new commit to the Git repo. The Git server sends a webhook event to your build runner. That webhook payload holds the branch name, commit hash, and author name. You should sign this payload with a shared secret key for safety.

Next, the build runner checks the signature and pulls the latest code. It uses a read-only deploy key or a scoped token to log in. Once the code is on the runner, it starts a test app. Then the runner sends browser commands to the Selenium grid over the network.

The browser nodes open the test app and run your check scripts. They click buttons, fill out forms, and read text on the page. When the checks finish, the runner sends the status back to Gogs. The team sees a green check or a red mark on the commit.

Common failure modes and how to scope roles

Many teams make mistakes when they set up this test pipeline. A common mistake is using a personal admin token on the build runner. If that runner gets hacked, attackers gain full control over all repos. Shared service accounts also make it hard to track who did what.

You can fix this by creating a bot user with read-only permissions. Give the build runner a deploy key that only reads one repo. If the runner must post status updates, scope its token to status only. Rotate these keys often so old secrets do not stay active forever.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Network paths between your tools also create big security risks for teams. An open browser grid lets anyone on the network run browser sessions. Attackers can use those browsers to scan your internal apps and databases. They can also read test logs that hold emails or card numbers.

Lock down your network so only the build runner reaches the browser grid. Put the browser nodes in an isolated network zone with strict firewall rules. Block the browser nodes from reaching production databases or internal admin tools. When tests use fake data, masking rewrites matched fields in results like phone numbers.

Managing test state and browser node cleanup

Long-running browser nodes often fail because old state builds up over time. Cached files, leftover cookies, and hung processes make new test runs flaky. A test might pass on a clean machine but fail on Monday morning. Teams then waste hours trying to fix bugs that are not real.

Set up your test grid to start a fresh browser for every run. Tear down the browser container right after the test script finishes its job. Clear out local storage and temporary folders before the next job starts. This simple habit keeps test runs fast, clean, and easy to trust.

You also need clear logs for every step of the test pipeline. Log when the webhook arrives, when code pulls, and when browsers start. Keep these logs in a central place so your team can check errors. Good logs help you spot slow tests and broken network links fast.

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

Can Gogs trigger Selenium tests without a build server?

No, Gogs only sends webhook messages when code events happen in a repo. You need a build runner to receive that webhook and start the test scripts.

What permissions does the build server need in Gogs?

The build server only needs read permissions to pull the repo code. If it posts test results back, grant it permission to write commit statuses.

How do we keep sensitive data out of browser test logs?

Use fake test accounts in your staging app instead of real user records. For remaining data, masking rewrites matched fields in results like emails or national IDs.

The query runs. The emails stay hidden.