public static String getPrettyPrintState(ProjectInspector inspector) { JobStatus jobStatus = inspector.getJobStatus(); if (inspector instanceof ProjectInspector4Bears) { ProjectInspector4Bears inspector4Bears = (ProjectInspector4Bears) inspector; if (inspector4Bears.isBug()) { return inspector4Bears.getBugType(); } else if (inspector4Bears.getJobStatus().isReproducedAsFail()) { return "BUG REPRODUCED"; } } if (jobStatus.isHasBeenPatched()) { return "PATCHED"; } if (jobStatus.isReproducedAsFail()) { return "test failure"; } List<StepStatus> stepStatuses = jobStatus.getStepStatuses(); for (int i = stepStatuses.size()-1; i >= 0; i--) { StepStatus stepStatus = stepStatuses.get(i); if (stepStatus.getStatus() == StepStatus.StatusKind.FAILURE) { return stepStatus.getDiagnostic(); } } return "UNKNOWN"; }
private void terminatePipeline() { if (!this.inspector.isPipelineEnding()) { this.inspector.setPipelineEnding(true); this.recordMachineInfo(); if (this.inspector.getFinalStep() != null) { if ((!(this.getInspector() instanceof ProjectInspector4Bears) && // Repairnator this.getInspector().getJobStatus().isReproducedAsFail()) // A bug was reproduced || (this.getInspector() instanceof ProjectInspector4Bears && // Bears ((ProjectInspector4Bears) this.getInspector()).isBug())) { // A bug and its patch were reproduced this.inspector.getFinalStep().execute(); } else { if (this.getInspector() instanceof ProjectInspector4Bears) { this.getLogger().debug("FINAL STEPS SKIPPED: The reproduction of the bug and/or the patch failed."); } else { this.getLogger().debug("FINAL STEPS SKIPPED: The reproduction of the bug failed."); } // So the final push state is repo not pushed this.setPushState(PushState.REPO_NOT_PUSHED); } } this.serializeData(); this.cleanMavenArtifactsAndLocalRepo(); this.inspector.printPipelineEnd(); } }