protected void initProperties() { this.getJobStatus().getProperties().setVersion("Checkstyle 0.1"); super.initProperties(); }
protected void initProperties() { this.getJobStatus().getProperties().setVersion("Bears 1.0"); super.initProperties(); }
public CloneRepository(ProjectInspector inspector) { super(inspector, true); this.build = inspector.getBuggyBuild(); }
private void recordMachineInfo() { MachineInfo machineInfo = this.inspector.getJobStatus().getProperties().getReproductionBuggyBuild().getMachineInfo(); machineInfo.setNumberCPU(Runtime.getRuntime().availableProcessors()); machineInfo.setFreeMemory(Runtime.getRuntime().freeMemory()); machineInfo.setTotalMemory(Runtime.getRuntime().totalMemory()); }
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"; }
protected String getPom() { if (!pomLocationTested) { testPomLocation(); this.inspector.getJobStatus().getProperties().getReproductionBuggyBuild() .setProjectRootPomPath(this.inspector.getJobStatus().getPomDirPath() + File.separator + Utils.POM_FILE); } return this.inspector.getJobStatus().getPomDirPath() + File.separator + Utils.POM_FILE; }
public void addStepError(String error) { getLogger().error(error); this.inspector.getJobStatus().addStepError(this.name, error); }
public void initWithJobStatus() { JobStatus jobStatus = this.getInspector().getJobStatus(); this.setClassPath(jobStatus.getRepairClassPath()); this.setSources(jobStatus.getRepairSourceDir()); }
private void initFileWriter() { String filename = "repairnator.maven." + name.toLowerCase() + ".log"; String filePath = inspector.getRepoLocalPath() + "/" + filename; inspector.getJobStatus().addFileToPush(filename); try { this.fileWriter = new FileWriter(filePath); } catch (IOException e) { this.getLogger().error("Cannot create file writer for file " + filePath + ".", e); } }
@Override public void observe(ProjectInspector inspector) { JobStatus status = inspector.getJobStatus(); String subject = "URGENT! Error on buggy build "+inspector.getBuggyBuild().getId()+" on machine "+ Utils.getHostname(); String message = "The following error has been encountered: "; if (status.getFatalError() != null) { message += "\n"+status.getFatalError().toString(); } this.notifyEngines(subject, message); } }
protected StepStatus businessExecute() { this.getLogger().debug("Checking out the test code of the buggy build candidate..."); if (this.getInspector().getJobStatus().getTestDir() == null) { this.addStepError("Test code dir is null: it is therefore impossible to continue."); return StepStatus.buildError(this, PipelineState.TESTDIRNOTCOMPUTED); } super.setCheckoutType(CheckoutType.CHECKOUT_BUGGY_BUILD_TEST_CODE); StepStatus stepStatus = super.businessExecute(); this.getInspector().setCheckoutType(CheckoutType.CHECKOUT_BUGGY_BUILD_TEST_CODE); return stepStatus; }
protected void setPushState(PushState pushState) { if (pushState != null) { this.inspector.getJobStatus().addPushState(pushState); if (this.nextStep != null) { this.nextStep.setPushState(pushState); } } }
protected void recordToolDiagnostic(JsonElement element) { this.getInspector().getJobStatus().addToolDiagnostic(this.getRepairToolName(), element); }
@Override public StepStatus shouldBeStopped(GatherTestInformation gatherTestInformation) { ProjectInspector inspector = gatherTestInformation.getInspector(); if (gatherTestInformation.getNbErroringTests() + gatherTestInformation.getNbFailingTests() > 0) { inspector.getJobStatus().setReproducedAsFail(true); return StepStatus.buildSuccess(gatherTestInformation); } else { return StepStatus.buildError(gatherTestInformation, PipelineState.NOTFAILING); } }
@Override protected StepStatus businessExecute() { this.getLogger().debug("Start to use nopol single repair to repair..."); this.initPatchDir(); this.initWithJobStatus(); if (this.getClassPath() != null && this.getSources() != null) { this.runNopol(this.getInspector().getJobStatus().getFailureLocations(), Collections.EMPTY_LIST, true); return this.recordResults(); } else { this.addStepError("No classpath or sources directory has been given. Nopol can't be launched."); return StepStatus.buildSkipped(this,"No classpath or source directory given."); } }
private void updateProperties() { if (this.properties == null) { this.properties = new Properties(); } // we want to use a dedicated Maven repository this.properties.setProperty("maven.repo.local", this.inspector.getM2LocalPath()); for (String skip : SKIP_LIST) { this.properties.setProperty(skip, "true"); } if (this.skipCheckstyle) { this.properties.setProperty("checkstyle.skip", "true"); } }
public void setProjectInspector(ProjectInspector inspector) { if (inspector != null) { this.inspector = inspector; this.inspector.registerStep(this); this.initStates(); } }
public void addStepError(String error, Throwable exception) { getLogger().error(error, exception); this.inspector.getJobStatus().addStepError(this.name, error + " Original msg: " + exception.getMessage()); }
@Override public void consumeLine(String s) { super.consumeLine(s); this.getLogger().error(s); this.inspector.getJobStatus().addStepError(name, s); } }
@Override public void consumeLine(String s) { super.consumeLine(s); this.getLogger().debug(s); if (s.contains("[ERROR]")) { this.inspector.getJobStatus().addStepError(name, s); } } }