The Simplest Way to Make Junit and Kibana Work Like They Should
Teams use junit and kibana together by sending test run results into a central log store. This setup lets developers view test pass rates, errors, and run times on shared charts. A test runner executes unit checks during every build. That runner outputs structured report files after each run. A log shipper reads those files and sends the data to the search backend. Then the visual dashboard reads that backend to show trends over time. Teams spot flaky tests fast when all test history lives in o
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 junit and kibana together by sending test run results into a central log store. This setup lets developers view test pass rates, errors, and run times on shared charts.
A test runner executes unit checks during every build. That runner outputs structured report files after each run. A log shipper reads those files and sends the data to the search backend. Then the visual dashboard reads that backend to show trends over time. Teams spot flaky tests fast when all test history lives in one place.
How data and roles flow between junit and kibana
Data moves in one clear direction from the build server to the dashboard. First, the Java test framework runs your code checks and writes XML or JSON reports. Next, a build agent or log forwarder picks up those local files. The forwarder parses each test case name, status, and duration into discrete log events. It then sends those events over the network to the indexing engine.
Permissions must match each step of this data flow. The build runner needs a write key that only adds new events to the test index. It should never hold rights to delete old indexes or read other system logs. On the other side, the dashboard app needs a read role for that specific test index. Developers log in to the dashboard through their normal single sign-on provider. Their user role lets them query test charts without changing system settings.
Common failure modes and how to scope access
Many teams make the mistake of using one shared admin token for all build jobs. If a build script leaks that token, anyone can wipe out production log data. Another common problem happens when test output includes raw test data. Failed assertions often print sample user records like emails, phone numbers, or card numbers. Those sensitive values then sit in the log store where any viewer can search them.
You can fix these risks by scoping roles and network paths tightly. Give each build pipeline its own scoped API key with write-only permissions. Set an index pattern rule so test runners only write to test-named indexes. Restrict network routes so only known build servers can reach the log ingestion port. For dashboard users, map team groups to read-only viewer roles. Also, scrub or mask sensitive test fields like national IDs before shipping logs out. Finally, turn on audit logs for the dashboard so you know who runs wide queries.
End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Structuring test fields for faster search
Raw stack traces are hard to search when thousands of tests run each hour. If you send plain text logs, your charts will load slowly and miss key details. You need a consistent set of fields for every single test event. Good fields include the build number, git branch, test class, test method, and run status.
Keep the error message in its own text field separate from the full stack trace. Store the run time as a number so you can chart slow tests over weeks. When every team uses the same field names, one dashboard can track every repo. You can filter by branch to see if a new change broke the build. You can also group by test name to find checks that fail at random.
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 send test reports to the log store?
Use a lightweight log shipper on your build runner to watch the report folder. It parses the XML or JSON files and sends each test result as an event.
What permissions should the build pipeline have?
Give the build agent a write-only key scoped to the test results index. Do not grant cluster admin rights or read permissions to the build runner.
How do we stop sensitive test data from showing up in charts?
Use fake data in your unit tests whenever possible. You can also set up your log shipper to rewrite emails and phone numbers before sending.
Related guides
In this post