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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations