Search in sources :

Example 56 with Build

use of fr.inria.jtravis.entities.Build in project repairnator by Spirals-Team.

the class ScannerDetailedDataSerializer method serializeAsJson.

private JsonElement serializeAsJson(BuildToBeInspected buildToBeInspected) {
    JsonObject result = new JsonObject();
    Build build = buildToBeInspected.getPatchedBuild();
    Build previousBuild = buildToBeInspected.getBuggyBuild();
    int previousBuildId = (previousBuild != null) ? previousBuild.getId() : -1;
    String committerEmail = (build.getCommit().getCommitterEmail() != null) ? build.getCommit().getCommitterEmail() : "-";
    Date date = new Date();
    result.addProperty("buildId", build.getId());
    result.addProperty("previousBuildId", previousBuildId);
    result.addProperty("scannedStatus", buildToBeInspected.getStatus().name());
    result.addProperty("repositoryName", build.getRepository().getSlug());
    result.addProperty("dateScannedStr", Utils.formatCompleteDate(date));
    this.addDate(result, "dateScanned", date);
    result.addProperty("dayScanned", Utils.formatOnlyDay(date));
    result.addProperty("hostname", Utils.getHostname());
    result.addProperty("travisBuildUrl", Utils.getTravisUrl(build.getId(), build.getRepository().getSlug()));
    result.addProperty("travisPreviousBuildUrl", Utils.getTravisUrl(previousBuildId, build.getRepository().getSlug()));
    result.addProperty("committerEmail", committerEmail);
    result.addProperty("runId", buildToBeInspected.getRunId());
    return result;
}
Also used : Build(fr.inria.jtravis.entities.Build) JsonObject(com.google.gson.JsonObject) Date(java.util.Date)

Example 57 with Build

use of fr.inria.jtravis.entities.Build in project repairnator by Spirals-Team.

the class InspectorSerializer method serializeAsList.

private List<Object> serializeAsList(ProjectInspector inspector) {
    JobStatus jobStatus = inspector.getJobStatus();
    BuildToBeInspected buildToBeInspected = inspector.getBuildToBeInspected();
    Build build = inspector.getBuggyBuild();
    String state = this.getPrettyPrintState(inspector);
    String realState = (jobStatus.getPipelineState() != null) ? jobStatus.getPipelineState().name() : "null";
    String typeOfFailures = StringUtils.join(jobStatus.getMetrics().getFailureNames(), ",") + "";
    List<Object> dataCol = new ArrayList<Object>();
    dataCol.add(build.getId() + "");
    dataCol.add(build.getRepository().getSlug());
    dataCol.add(state);
    dataCol.add(build.getPullRequestNumber() + "");
    dataCol.add(Utils.formatCompleteDate(build.getFinishedAt()));
    dataCol.add(Utils.formatOnlyDay(build.getFinishedAt()));
    dataCol.add(realState);
    dataCol.add(Utils.getHostname());
    dataCol.add(Utils.formatCompleteDate(new Date()));
    dataCol.add(Utils.getTravisUrl(build.getId(), build.getRepository().getSlug()));
    dataCol.add(typeOfFailures);
    dataCol.add(buildToBeInspected.getRunId());
    return dataCol;
}
Also used : JobStatus(fr.inria.spirals.repairnator.process.inspectors.JobStatus) Build(fr.inria.jtravis.entities.Build) ArrayList(java.util.ArrayList) JsonObject(com.google.gson.JsonObject) BuildToBeInspected(fr.inria.spirals.repairnator.BuildToBeInspected) Date(java.util.Date)

Example 58 with Build

use of fr.inria.jtravis.entities.Build in project repairnator by Spirals-Team.

the class InspectorSerializer method serializeAsJson.

private JsonElement serializeAsJson(ProjectInspector inspector) {
    JobStatus jobStatus = inspector.getJobStatus();
    BuildToBeInspected buildToBeInspected = inspector.getBuildToBeInspected();
    Build build = inspector.getBuggyBuild();
    String state = this.getPrettyPrintState(inspector);
    String realState = (jobStatus.getPipelineState() != null) ? jobStatus.getPipelineState().name() : "null";
    String typeOfFailures = StringUtils.join(jobStatus.getMetrics().getFailureNames(), ",");
    JsonObject result = new JsonObject();
    result.addProperty("buildId", build.getId());
    result.addProperty("repositoryName", build.getRepository().getSlug());
    result.addProperty("status", state);
    result.addProperty("prNumber", build.getPullRequestNumber());
    result.addProperty("buildFinishedDateStr", Utils.formatCompleteDate(build.getFinishedAt()));
    this.addDate(result, "buildFinishedDate", build.getFinishedAt());
    result.addProperty("buildFinishedDay", Utils.formatOnlyDay(build.getFinishedAt()));
    result.addProperty("realStatus", realState);
    result.addProperty("hostname", Utils.getHostname());
    result.addProperty("buildReproductionDateStr", Utils.formatCompleteDate(new Date()));
    this.addDate(result, "buildReproductionDate", new Date());
    result.addProperty("travisURL", Utils.getTravisUrl(build.getId(), build.getRepository().getSlug()));
    result.addProperty("typeOfFailures", typeOfFailures);
    result.addProperty("runId", buildToBeInspected.getRunId());
    result.addProperty("branchURL", jobStatus.getGitBranchUrl());
    return result;
}
Also used : JobStatus(fr.inria.spirals.repairnator.process.inspectors.JobStatus) Build(fr.inria.jtravis.entities.Build) JsonObject(com.google.gson.JsonObject) BuildToBeInspected(fr.inria.spirals.repairnator.BuildToBeInspected) Date(java.util.Date)

Example 59 with Build

use of fr.inria.jtravis.entities.Build in project repairnator by Spirals-Team.

the class InspectorTimeSerializer method serializeAsJson.

private JsonElement serializeAsJson(ProjectInspector inspector) {
    Map<String, Integer> durations = inspector.getJobStatus().getMetrics().getStepsDurationsInSeconds();
    int clonage = durations.getOrDefault(CloneRepository.class.getSimpleName(), 0);
    int checkoutBuild = durations.getOrDefault(CheckoutBuggyBuild.class.getSimpleName(), 0);
    int buildtime = durations.getOrDefault(BuildProject.class.getSimpleName(), 0);
    int test = durations.getOrDefault(TestProject.class.getSimpleName(), 0);
    int gatherTestInfo = durations.getOrDefault(GatherTestInformation.class.getSimpleName(), 0);
    int push = durations.getOrDefault(PushIncriminatedBuild.class.getSimpleName(), 0);
    int computeClasspath = durations.getOrDefault(ComputeClasspath.class.getSimpleName(), 0);
    int computeSourceDir = durations.getOrDefault(ComputeSourceDir.class.getSimpleName(), 0);
    int repair = durations.getOrDefault(NopolRepair.class.getSimpleName(), 0);
    int dependencyResolution = durations.getOrDefault(ResolveDependency.class.getSimpleName(), 0);
    int totalDuration = clonage + checkoutBuild + buildtime + test + gatherTestInfo + push + computeClasspath + computeSourceDir + repair + dependencyResolution;
    Build build = inspector.getBuggyBuild();
    JsonObject result = new JsonObject();
    result.addProperty("buildId", build.getId());
    result.addProperty("repositoryName", build.getRepository().getSlug());
    result.addProperty("buildReproductionDateStr", Utils.formatCompleteDate(new Date()));
    this.addDate(result, "buildReproductionDate", new Date());
    result.addProperty("hostname", Utils.getHostname());
    result.addProperty("totalDuration", totalDuration);
    result.addProperty("clonage", clonage);
    result.addProperty("checkoutBuild", checkoutBuild);
    result.addProperty("build", buildtime);
    result.addProperty("test", test);
    result.addProperty("gatherTestInfo", gatherTestInfo);
    result.addProperty("push", push);
    result.addProperty("computeClasspath", computeClasspath);
    result.addProperty("computeSourceDir", computeSourceDir);
    result.addProperty("repair", repair);
    result.addProperty("dependendencyResolution", dependencyResolution);
    result.addProperty("runId", inspector.getBuildToBeInspected().getRunId());
    return result;
}
Also used : CheckoutBuggyBuild(fr.inria.spirals.repairnator.process.step.checkoutrepository.CheckoutBuggyBuild) ComputeClasspath(fr.inria.spirals.repairnator.process.step.ComputeClasspath) ResolveDependency(fr.inria.spirals.repairnator.process.step.ResolveDependency) BuildProject(fr.inria.spirals.repairnator.process.step.BuildProject) ComputeSourceDir(fr.inria.spirals.repairnator.process.step.ComputeSourceDir) JsonObject(com.google.gson.JsonObject) Date(java.util.Date) CloneRepository(fr.inria.spirals.repairnator.process.step.CloneRepository) NopolRepair(fr.inria.spirals.repairnator.process.step.NopolRepair) TestProject(fr.inria.spirals.repairnator.process.step.TestProject) GatherTestInformation(fr.inria.spirals.repairnator.process.step.gatherinfo.GatherTestInformation) PushIncriminatedBuild(fr.inria.spirals.repairnator.process.step.push.PushIncriminatedBuild) Build(fr.inria.jtravis.entities.Build) CheckoutBuggyBuild(fr.inria.spirals.repairnator.process.step.checkoutrepository.CheckoutBuggyBuild) PushIncriminatedBuild(fr.inria.spirals.repairnator.process.step.push.PushIncriminatedBuild)

Example 60 with Build

use of fr.inria.jtravis.entities.Build in project repairnator by Spirals-Team.

the class InspectorTimeSerializer method serializeAsList.

private List<Object> serializeAsList(ProjectInspector inspector) {
    Map<String, Integer> durations = inspector.getJobStatus().getMetrics().getStepsDurationsInSeconds();
    int clonage = durations.getOrDefault(CloneRepository.class.getSimpleName(), 0);
    int checkoutBuild = durations.getOrDefault(CheckoutBuggyBuild.class.getSimpleName(), 0);
    int buildtime = durations.getOrDefault(BuildProject.class.getSimpleName(), 0);
    int test = durations.getOrDefault(TestProject.class.getSimpleName(), 0);
    int gatherTestInfo = durations.getOrDefault(GatherTestInformation.class.getSimpleName(), 0);
    int push = durations.getOrDefault(PushIncriminatedBuild.class.getSimpleName(), 0);
    int computeClasspath = durations.getOrDefault(ComputeClasspath.class.getSimpleName(), 0);
    int computeSourceDir = durations.getOrDefault(ComputeSourceDir.class.getSimpleName(), 0);
    int repair = durations.getOrDefault(NopolRepair.class.getSimpleName(), 0);
    int dependencyResolution = durations.getOrDefault(ResolveDependency.class.getSimpleName(), 0);
    int totalDuration = clonage + checkoutBuild + buildtime + test + gatherTestInfo + push + computeClasspath + computeSourceDir + repair + dependencyResolution;
    Build build = inspector.getBuggyBuild();
    List<Object> dataCol = new ArrayList<Object>();
    dataCol.add(build.getId() + "");
    dataCol.add(build.getRepository().getSlug());
    dataCol.add(Utils.formatCompleteDate(new Date()));
    dataCol.add(Utils.getHostname());
    dataCol.add(totalDuration);
    dataCol.add(clonage);
    dataCol.add(checkoutBuild);
    dataCol.add(buildtime);
    dataCol.add(test);
    dataCol.add(gatherTestInfo);
    dataCol.add(push);
    dataCol.add(computeClasspath);
    dataCol.add(computeSourceDir);
    dataCol.add(repair);
    dataCol.add(inspector.getBuildToBeInspected().getRunId());
    dataCol.add(dependencyResolution);
    return dataCol;
}
Also used : CheckoutBuggyBuild(fr.inria.spirals.repairnator.process.step.checkoutrepository.CheckoutBuggyBuild) ComputeClasspath(fr.inria.spirals.repairnator.process.step.ComputeClasspath) ResolveDependency(fr.inria.spirals.repairnator.process.step.ResolveDependency) BuildProject(fr.inria.spirals.repairnator.process.step.BuildProject) ComputeSourceDir(fr.inria.spirals.repairnator.process.step.ComputeSourceDir) ArrayList(java.util.ArrayList) Date(java.util.Date) CloneRepository(fr.inria.spirals.repairnator.process.step.CloneRepository) NopolRepair(fr.inria.spirals.repairnator.process.step.NopolRepair) TestProject(fr.inria.spirals.repairnator.process.step.TestProject) GatherTestInformation(fr.inria.spirals.repairnator.process.step.gatherinfo.GatherTestInformation) PushIncriminatedBuild(fr.inria.spirals.repairnator.process.step.push.PushIncriminatedBuild) Build(fr.inria.jtravis.entities.Build) CheckoutBuggyBuild(fr.inria.spirals.repairnator.process.step.checkoutrepository.CheckoutBuggyBuild) PushIncriminatedBuild(fr.inria.spirals.repairnator.process.step.push.PushIncriminatedBuild) JsonObject(com.google.gson.JsonObject)

Aggregations

Build (fr.inria.jtravis.entities.Build)60 BuildToBeInspected (fr.inria.spirals.repairnator.BuildToBeInspected)44 File (java.io.File)41 Path (java.nio.file.Path)40 Test (org.junit.Test)40 JobStatus (fr.inria.spirals.repairnator.process.inspectors.JobStatus)37 ProjectInspector (fr.inria.spirals.repairnator.process.inspectors.ProjectInspector)33 GitHelper (fr.inria.spirals.repairnator.process.git.GitHelper)31 CheckoutBuggyBuild (fr.inria.spirals.repairnator.process.step.checkoutrepository.CheckoutBuggyBuild)28 ArrayList (java.util.ArrayList)15 Git (org.eclipse.jgit.api.Git)13 JsonObject (com.google.gson.JsonObject)12 CloneRepository (fr.inria.spirals.repairnator.process.step.CloneRepository)12 RepairnatorConfig (fr.inria.spirals.repairnator.config.RepairnatorConfig)11 Date (java.util.Date)11 RevCommit (org.eclipse.jgit.revwalk.RevCommit)11 CheckoutPatchedBuild (fr.inria.spirals.repairnator.process.step.checkoutrepository.CheckoutPatchedBuild)10 GatherTestInformation (fr.inria.spirals.repairnator.process.step.gatherinfo.GatherTestInformation)9 AbstractNotifier (fr.inria.spirals.repairnator.notifier.AbstractNotifier)7 AbstractDataSerializer (fr.inria.spirals.repairnator.serializer.AbstractDataSerializer)7