如何在GitLab中查看GitLab CI定时运行的JUnit测试报告?
Great question! Even if you’re only running tests via scheduled pipelines (no MRs, pushes, or commits triggering them), GitLab still gives you a few handy places to access your JUnit test reports:
Pipeline Details Page: After your scheduled pipeline finishes, navigate to its specific page (found under CI/CD > Pipelines). Look for the "Tests" tab here—it’ll show a high-level summary of pass/fail counts, and you can click into individual test cases to view detailed logs or failure reasons.
Job Details Page: If your JUnit tests run in a dedicated job (like
run-junit-tests), go to that job’s page (from the pipeline’s job list). There’s a "Tests" section here too, displaying results exclusive to that job—perfect for focusing on the output of a single test run.Project-Wide Test Reports Dashboard: Head to your project’s CI/CD > Test Reports section. This page aggregates test results across all recent pipelines (including your scheduled ones), so you can track trends over time, see historical pass rates, and filter results by pipeline or test status.
The artifacts:reports:junit directive works no matter how the pipeline is triggered—GitLab collects the XML reports as long as the artifacts are saved (even if the job fails). All these UI locations will automatically pick up and display those reports for you.
内容的提问来源于stack exchange,提问作者Grumbunks

