コード例 #1
0
 public boolean isBuildUnstable() {
   for (Condition condition : simulation.getUnstableConditions()) {
     if (!condition.isFulfilledBy(globalReport)) {
       return true;
     }
   }
   return false;
 }
コード例 #2
0
  private File locateStatsFile() throws IOException, InterruptedException {
    FilePath[] files = reportDirectory.list(STATS_FILE_PATTERN);

    if (files.length == 0)
      throw new FileNotFoundException(
          "Unable to locate the simulation results for " + simulation.getName());

    return new File(files[0].getRemote());
  }
コード例 #3
0
  @Override
  public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener)
      throws InterruptedException, IOException {
    GatlingBuildAction action = new GatlingBuildAction(build);

    FilePath reportDirectory =
        saveFullReport(build.getWorkspace(), build.getRootDir(), simulation.getName());

    build.addAction(new GatlingReportAction(build, simulation.getName(), reportDirectory));

    SimulationReport report = new SimulationReport(reportDirectory, simulation);
    report.readStatsFile();

    if (report.isBuildFailed()) {
      build.setResult(Result.FAILURE);
    }
    if (report.isBuildUnstable()) {
      build.setResult(Result.UNSTABLE);
    }

    action.getRequestsReports().put(simulation.getName(), report.getGlobalReport());
    build.addAction(action);
    return true;
  }
コード例 #4
0
 public List<Condition> getUnstableConditions() {
   return simulation.getUnstableConditions();
 }
コード例 #5
0
 public List<Condition> getFailConditions() {
   return simulation.getFailConditions();
 }
コード例 #6
0
 public String getSimulationPath() {
   return simulation.getName();
 }
コード例 #7
0
 public boolean hasUnstableConditions() {
   return !simulation.getUnstableConditions().isEmpty();
 }
コード例 #8
0
 public boolean hasFailConditions() {
   return !simulation.getFailConditions().isEmpty();
 }