Search in sources :

Example 1 with ErrorNotifier

use of fr.inria.spirals.repairnator.notifier.ErrorNotifier in project repairnator by Spirals-Team.

the class ProjectInspector method run.

public void run() {
    if (this.buildToBeInspected.getStatus() != ScannedBuildStatus.PASSING_AND_PASSING_WITH_TEST_CHANGES) {
        AbstractStep cloneRepo = new CloneRepository(this);
        cloneRepo.setNextStep(new CheckoutBuggyBuild(this)).setNextStep(new ComputeSourceDir(this, true)).setNextStep(new ComputeTestDir(this)).setNextStep(new ResolveDependency(this)).setNextStep(new BuildProject(this)).setNextStep(new TestProject(this)).setNextStep(new GatherTestInformation(this, new BuildShouldFail(), false)).setNextStep(new InitRepoToPush(this)).setNextStep(new PushIncriminatedBuild(this)).setNextStep(new NPERepair(this)).setNextStep(new ComputeClasspath(this)).setNextStep(new ComputeSourceDir(this, false)).setNextStep(new AstorRepair(this)).setNextStep(new NopolRepair(this)).setNextStep(new CommitPatch(this, false)).setNextStep(new CheckoutPatchedBuild(this)).setNextStep(new BuildProject(this)).setNextStep(new TestProject(this)).setNextStep(new GatherTestInformation(this, new BuildShouldPass(), true)).setNextStep(new CommitPatch(this, true));
        cloneRepo.setDataSerializer(this.serializers);
        cloneRepo.setNotifiers(this.notifiers);
        cloneRepo.setPipelineState(PipelineState.INIT);
        try {
            cloneRepo.execute();
        } catch (Exception e) {
            this.jobStatus.addStepError("Unknown", e.getMessage());
            this.logger.error("Exception catch while executing steps: ", e);
            this.jobStatus.setFatalError(e);
            ErrorNotifier errorNotifier = ErrorNotifier.getInstance();
            if (errorNotifier != null) {
                errorNotifier.observe(this);
            }
            for (AbstractDataSerializer serializer : this.serializers) {
                serializer.serializeData(this);
            }
        }
    } else {
        this.logger.debug("Scanned build is not a failing build.");
    }
}
Also used : ErrorNotifier(fr.inria.spirals.repairnator.notifier.ErrorNotifier) CheckoutBuggyBuild(fr.inria.spirals.repairnator.process.step.checkoutrepository.CheckoutBuggyBuild) BuildShouldFail(fr.inria.spirals.repairnator.process.step.gatherinfo.BuildShouldFail) InitRepoToPush(fr.inria.spirals.repairnator.process.step.push.InitRepoToPush) AbstractDataSerializer(fr.inria.spirals.repairnator.serializer.AbstractDataSerializer) 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

ErrorNotifier (fr.inria.spirals.repairnator.notifier.ErrorNotifier)1 CheckoutBuggyBuild (fr.inria.spirals.repairnator.process.step.checkoutrepository.CheckoutBuggyBuild)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 AbstractDataSerializer (fr.inria.spirals.repairnator.serializer.AbstractDataSerializer)1