theonedev/onedev · error · NotFoundException

Unit test report not found:

Error message

Unit test report not found: 

What it means

Lookup guard in TodResource's build/test-report retrieval: the requested unit test report (by build and report name) does not exist for the given build, so NotFoundException is thrown instead of returning test-suite/case data. Fix: verify the report name and that the build actually published a unit test report.

Source

Thrown at server-core/src/main/java/io/onedev/server/ai/TodResource.java:977

                    testSuites.add(testSuiteData);
                }
                reportData.put("testSuites", testSuites);

                var testCases = new ArrayList<Map<String, Object>>();
                for (var testCase: report.getTestCases()) {
                    var testCaseData = new HashMap<String, Object>();
                    testCaseData.put("testSuite", testCase.getTestSuite().getName());
                    testCaseData.put("name", testCase.getName());
                    testCaseData.put("status", testCase.getStatus().name());
                    testCaseData.put("statusText", testCase.getStatusText());
                    testCaseData.put("duration", testCase.getDuration());
                    testCaseData.putAll(testCase.getDetailData());
                    testCases.add(testCaseData);
                }
                reportData.put("testCases", testCases);
                return Response.ok(reportData).build();
            }
            throw new NotFoundException("Unit test report not found: " + reportName);
        }
    }
    
    @Path("/get-previous-successful-similar-build")
    @GET
    public Map<String, Object> getPreviousSuccessfulSimilarBuild(
                @QueryParam("currentProject") @NotNull String currentProjectPath, 
                @QueryParam("reference") @NotNull String buildReference) {
        if (SecurityUtils.getUser() == null)
            throw new UnauthenticatedException();

        var currentProject = getProject(currentProjectPath);

        var build = getBuild(currentProject, buildReference);
                
        var foundBuild = buildService.findPreviousSuccessfulSimilar(build);
        if (foundBuild != null) 
            return BuildHelper.getDetail(currentProject, foundBuild);

View on GitHub (pinned to d44925c47c)

Solutions

  1. Check the report name against the reports the build actually published.
  2. Ensure the build spec step that publishes the JUnit test report ran successfully.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at server-core/src/main/java/io/onedev/server/ai/TodResource.java:977 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06). Data as JSON: /api/errors/8eb6ac96c256266a. Report an issue: GitHub.