Jenkins / Editorial solution guide
JUnit publication finds no current test report
Trace producer execution, workspace, patterns, transfer, and failure handling without accepting empty evidence.
Read-only knowledge base · No public comments
Recognize the symptoms
The test command appears in the Pipeline, but JUnit publication reports no matching result files or the expected cases are absent. Exact messages vary with plugin version and configuration.
A local developer has a report, while the allocated agent or later publishing stage does not. Another symptom is a successful-looking report copied from an earlier run, which can be more misleading than a clear missing-file failure.
Understand the likely causes
- The command may not have run, may have failed before writing reports, or may write another path or format. A relative pattern is evaluated in the current workspace context, which may differ after dir or agent changes.
- The publisher may run on another node without explicit transfer, or post handling may lack the required file context after agent loss. Broad patterns and reused workspaces can select stale evidence instead of the current producer output.
Establish whether the intended suite executed
Record run, source revision, stage, command, exit status, working directory, and expected report path from retained evidence. Separate a test assertion failure from failure to start the test program. A report publisher cannot invent missing observations. If the command returned a captured status, confirm that the Pipeline evaluated it rather than continuing as if success. Preserve the first failure before changing patterns.
Resolve the pattern from the publishing workspace
Draw the producer and consumer directories, including dir scopes and different agent allocations. The following synthetic layout makes the relative relationship explicit. A pattern reports/unit.xml is correct only from the declared root, while publishing inside fixture changes its meaning. Do not broaden the pattern to the whole filesystem just to find something XML-shaped.
workspace-root/
fixture/
check_fixture.py
reports/
unit.xml
Publisher context: workspace-root
Expected pattern: reports/unit.xml
This tree is teaching input, not an observed agent listing. The guide performs no filesystem discovery, Jenkins file operation, or report publication.
Review cross-node and interruption boundaries
A later stage on another agent does not share files automatically. Use an explicit same-run transfer or appropriate retained artifact contract, with the producer revision and paths intact. If an agent disappeared, identify which evidence was actually saved before loss. post always can select a handler without guaranteeing its workspace exists. Distinguish absent report, inaccessible context, and invalid XML; they require different evidence and remedies.
Restore meaningful report production and selection
Correct the suite’s report output or the publisher’s narrow relative pattern. Keep allowEmptyResults policy aligned with whether the suite is mandatory; do not use it as a general path-error workaround. Ensure the current run cannot accidentally reuse a stale successful report. If the suite fails but writes useful XML, publish through an appropriate reviewed path while preserving the failing test status. A report channel should explain the test outcome rather than replace it.
Verify the fix
In an authorized lab or retained run evidence, verify the intended source produced the expected current cases and that the publisher selected exactly those files. Include a deliberately failing synthetic case and a no-report case so the gate cannot pass by absence. Confirm report publication and test result remain separate. No suite, publisher, agent, or Jenkins job is executed by this guide.
Keep it from recurring
- Version command, output path, format, and publication policy together. Use unique per-branch report paths, explicit transfers between agents, scoped file selection, and retained producer identity. Review missing and stale report cases when restructuring stages or adding parallelism.