Search in sources :

Example 1 with CheckoutBuggyBuildSourceCode

use of fr.inria.spirals.repairnator.process.step.checkoutrepository.CheckoutBuggyBuildSourceCode in project repairnator by Spirals-Team.

the class ProjectInspector4Bears method run.

public void run() {
    AbstractStep firstStep;
    AbstractStep cloneRepo = new CloneRepository(this);
    if (this.getBuildToBeInspected().getStatus() == ScannedBuildStatus.FAILING_AND_PASSING) {
        cloneRepo.setNextStep(new CheckoutBuggyBuild(this)).setNextStep(new ComputeSourceDir(this, true)).setNextStep(new ComputeTestDir(this)).setNextStep(new ResolveDependency(this)).setNextStep(new BuildProject(this, BuildProject.class.getSimpleName() + "PreviousBuild")).setNextStep(new TestProject(this, TestProject.class.getSimpleName() + "PreviousBuild")).setNextStep(new GatherTestInformation(this, new BuildShouldFail(), false, GatherTestInformation.class.getSimpleName() + "PreviousBuild")).setNextStep(new InitRepoToPush(this)).setNextStep(new ComputeClasspath(this)).setNextStep(new NopolRepair(this)).setNextStep(new CommitPatch(this, false)).setNextStep(new CheckoutPatchedBuild(this)).setNextStep(new BuildProject(this, BuildProject.class.getSimpleName() + "Build")).setNextStep(new TestProject(this, TestProject.class.getSimpleName() + "Build")).setNextStep(new GatherTestInformation(this, new BuildShouldPass(), true, GatherTestInformation.class.getSimpleName() + "Build")).setNextStep(new PushIncriminatedBuild(this)).setNextStep(new CommitPatch(this, true));
    } else {
        if (this.getBuildToBeInspected().getStatus() == ScannedBuildStatus.PASSING_AND_PASSING_WITH_TEST_CHANGES) {
            cloneRepo.setNextStep(new CheckoutPatchedBuild(this)).setNextStep(new ComputeSourceDir(this, true)).setNextStep(new ComputeTestDir(this)).setNextStep(new CheckoutBuggyBuildSourceCode(this)).setNextStep(new ResolveDependency(this)).setNextStep(new BuildProject(this, BuildProject.class.getSimpleName() + "PreviousBuildSourceCode")).setNextStep(new TestProject(this, TestProject.class.getSimpleName() + "PreviousBuildSourceCode")).setNextStep(new GatherTestInformation(this, new BuildShouldFail(), false, GatherTestInformation.class.getSimpleName() + "PreviousBuildSourceCode")).setNextStep(new InitRepoToPush(this)).setNextStep(new ComputeClasspath(this)).setNextStep(new NopolRepair(this)).setNextStep(new CommitPatch(this, false)).setNextStep(new CheckoutPatchedBuild(this)).setNextStep(new BuildProject(this, BuildProject.class.getSimpleName() + "Build")).setNextStep(new TestProject(this, TestProject.class.getSimpleName() + "Build")).setNextStep(new GatherTestInformation(this, new BuildShouldPass(), true, GatherTestInformation.class.getSimpleName() + "Build")).setNextStep(new PushIncriminatedBuild(this)).setNextStep(new CommitPatch(this, true));
        } else {
            this.logger.debug("The pair of scanned builds is not interesting.");
            return;
        }
    }
    firstStep = cloneRepo;
    firstStep.setDataSerializer(this.getSerializers());
    firstStep.setNotifiers(this.getNotifiers());
    firstStep.setPipelineState(PipelineState.INIT);
    try {
        firstStep.execute();
    } catch (Exception e) {
        this.getJobStatus().addStepError("Unknown", e.getMessage());
        this.logger.debug("Exception catch while executing steps: ", e);
    }
}
Also used : CheckoutBuggyBuild(fr.inria.spirals.repairnator.process.step.checkoutrepository.CheckoutBuggyBuild) CheckoutBuggyBuildSourceCode(fr.inria.spirals.repairnator.process.step.checkoutrepository.CheckoutBuggyBuildSourceCode) BuildShouldFail(fr.inria.spirals.repairnator.process.step.gatherinfo.BuildShouldFail) InitRepoToPush(fr.inria.spirals.repairnator.process.step.push.InitRepoToPush) BuildShouldPass(fr.inria.spirals.repairnator.process.step.gatherinfo.BuildShouldPass) CheckoutPatchedBuild(fr.inria.spirals.repairnator.process.step.checkoutrepository.CheckoutPatchedBuild) GatherTestInformation(fr.inria.spirals.repairnator.process.step.gatherinfo.GatherTestInformation) PushIncriminatedBuild(fr.inria.spirals.repairnator.process.step.push.PushIncriminatedBuild) CommitPatch(fr.inria.spirals.repairnator.process.step.push.CommitPatch)

Aggregations

CheckoutBuggyBuild (fr.inria.spirals.repairnator.process.step.checkoutrepository.CheckoutBuggyBuild)1 CheckoutBuggyBuildSourceCode (fr.inria.spirals.repairnator.process.step.checkoutrepository.CheckoutBuggyBuildSourceCode)1 CheckoutPatchedBuild (fr.inria.spirals.repairnator.process.step.checkoutrepository.CheckoutPatchedBuild)1 BuildShouldFail (fr.inria.spirals.repairnator.process.step.gatherinfo.BuildShouldFail)1 BuildShouldPass (fr.inria.spirals.repairnator.process.step.gatherinfo.BuildShouldPass)1 GatherTestInformation (fr.inria.spirals.repairnator.process.step.gatherinfo.GatherTestInformation)1 CommitPatch (fr.inria.spirals.repairnator.process.step.push.CommitPatch)1 InitRepoToPush (fr.inria.spirals.repairnator.process.step.push.InitRepoToPush)1 PushIncriminatedBuild (fr.inria.spirals.repairnator.process.step.push.PushIncriminatedBuild)1