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(); } }
public void run() { if (this.getBuildToBeInspected().getStatus() != ScannedBuildStatus.PASSING_AND_PASSING_WITH_TEST_CHANGES) { AbstractStep cloneRepo = new CloneRepository(this); cloneRepo .addNextStep(new CheckoutBuggyBuild(this, true)) .addNextStep(new BuildProject(this)) .addNextStep(new ComputePlugins(this, false)) .addNextStep(new Checkstyle(this)); super.setFinalStep(new ComputeSourceDir(this, false, true)); super.getFinalStep(). addNextStep(new WritePropertyFile(this)). addNextStep(new CommitProcessEnd(this)). addNextStep(new PushProcessEnd(this)); cloneRepo.setDataSerializer(this.getSerializers()); cloneRepo.setNotifiers(this.getNotifiers()); this.printPipeline(); try { cloneRepo.execute(); } catch (Exception e) { this.getJobStatus().addStepError("Unknown", e.getMessage()); this.logger.error("Exception catch while executing steps: ", e); } } else { this.logger.debug("Build " + this.getBuggyBuild().getId() + " is not a failing build."); } }
super.getFinalStep() .addNextStep(new CommitProcessEnd(this)) .addNextStep(new PushProcessEnd(this));