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()); }
@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; }
public String getSimulationPath() { return simulation.getName(); }