Java
Test Suite Monitoring for JUnit (Java)
Monitor your JUnit test suite health with TestGlance
Get Started in 3 Steps
- 1Maven Surefire outputs JUnit XML by default to `target/surefire-reports/` — no extra configuration needed
- 2For Gradle, JUnit XML reports are at `build/test-results/test/`
- 3Add the TestGlance GitHub Action to your CI workflow pointing to the reports directory
GitHub Actions Workflow
# .github/workflows/test.yml
name: Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- run: mvn install -DskipTests
- name: Run tests
run: mvn test
- name: Report to TestGlance
if: always()
uses: testglance/action@v1
with:
api-key: ${{ secrets.TESTGLANCE_API_KEY }}
report-path: target/surefire-reports/*.xmlWhat You Get
- ✓Flaky test detection — automatically identify tests that pass and fail intermittently
- ✓Duration trends — track which tests are getting slower over time
- ✓Health score — a single metric summarizing your test suite reliability
- ✓CI summary — rich test result summaries directly in your GitHub Actions runs
FAQ
Does Maven Surefire generate JUnit XML automatically?
Yes. Maven Surefire plugin generates JUnit XML reports by default in `target/surefire-reports/`. No additional configuration is required.
How do I set up TestGlance with Gradle?
Gradle generates JUnit XML reports at `build/test-results/test/` by default. Point the TestGlance action report-path to this directory with a glob pattern.
Does TestGlance support JUnit 5 parameterized tests?
Yes. JUnit 5 parameterized tests each appear as individual test cases in the Surefire XML report. TestGlance tracks each parameterized invocation separately.
Start Monitoring Your JUnit (Java) Tests
Free to get started. Set up in under 5 minutes.
Get Started