Search in sources :

Example 1 with PerfMonS3ObjectDataReader

use of uk.co.automatictester.lightning.lambda.readers.PerfMonS3ObjectDataReader in project lightning by automatictester.

the class LightningHandler method runTests.

private void runTests() {
    long testSetExecStart = System.currentTimeMillis();
    LightningXMLS3ObjectReader xmlFileReader = new LightningXMLS3ObjectReader(region, bucket);
    xmlFileReader.readTests(xml);
    List<ClientSideTest> clientSideTests = xmlFileReader.getClientSideTests();
    List<ServerSideTest> serverSideTests = xmlFileReader.getServerSideTests();
    testSet = new TestSet(clientSideTests, serverSideTests);
    jmeterTransactions = new JMeterCSVS3ObjectReader(region, bucket).getTransactions(jmeterCsv);
    if (perfmonCsv != null) {
        PerfMonDataEntries perfMonDataEntries = new PerfMonS3ObjectDataReader(region, bucket).getDataEntires(perfmonCsv);
        testSet.executeServerSideTests(perfMonDataEntries);
    }
    testSet.executeClientSideTests(jmeterTransactions);
    String testExecutionReport = testSet.getTestExecutionReport();
    String testSetExecutionSummaryReport = new TestSetReporter(testSet).getTestSetExecutionSummaryReport();
    String combinedTestReport = String.format("\n%s%s\n", testExecutionReport, testSetExecutionSummaryReport);
    String combinedTestReportS3Path = s3Client.putS3Object("output/verify.log", combinedTestReport);
    response.setCombinedTestReport(combinedTestReportS3Path);
    log.info(combinedTestReport);
    long testSetExecEnd = System.currentTimeMillis();
    long testExecTime = testSetExecEnd - testSetExecStart;
    log.info("Total verify stage execution time:    {}ms", testExecTime);
    if (testSet.getFailCount() + testSet.getErrorCount() != 0) {
        response.setExitCode(1);
    } else {
        response.setExitCode(0);
    }
}
Also used : ClientSideTest(uk.co.automatictester.lightning.tests.ClientSideTest) ServerSideTest(uk.co.automatictester.lightning.tests.ServerSideTest) TestSetReporter(uk.co.automatictester.lightning.reporters.TestSetReporter) JMeterCSVS3ObjectReader(uk.co.automatictester.lightning.lambda.readers.JMeterCSVS3ObjectReader) LightningXMLS3ObjectReader(uk.co.automatictester.lightning.lambda.readers.LightningXMLS3ObjectReader) PerfMonS3ObjectDataReader(uk.co.automatictester.lightning.lambda.readers.PerfMonS3ObjectDataReader) PerfMonDataEntries(uk.co.automatictester.lightning.data.PerfMonDataEntries) TestSet(uk.co.automatictester.lightning.TestSet)

Aggregations

TestSet (uk.co.automatictester.lightning.TestSet)1 PerfMonDataEntries (uk.co.automatictester.lightning.data.PerfMonDataEntries)1 JMeterCSVS3ObjectReader (uk.co.automatictester.lightning.lambda.readers.JMeterCSVS3ObjectReader)1 LightningXMLS3ObjectReader (uk.co.automatictester.lightning.lambda.readers.LightningXMLS3ObjectReader)1 PerfMonS3ObjectDataReader (uk.co.automatictester.lightning.lambda.readers.PerfMonS3ObjectDataReader)1 TestSetReporter (uk.co.automatictester.lightning.reporters.TestSetReporter)1 ClientSideTest (uk.co.automatictester.lightning.tests.ClientSideTest)1 ServerSideTest (uk.co.automatictester.lightning.tests.ServerSideTest)1