From 6b5485d245e5d8373bfc01c4a80ef400634ca7d7 Mon Sep 17 00:00:00 2001 From: Damian Szczepanik Date: Wed, 29 May 2019 00:07:49 +0200 Subject: [PATCH] Publish report on https://github.com/damianszczepanik/damianszczepanik.github.io repository --- .travis.yml | 5 ++- src/test/java/HelloCucumberTest.java | 4 ++- src/test/resources/demo-trends.json | 47 ++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 src/test/resources/demo-trends.json diff --git a/.travis.yml b/.travis.yml index 1e6c09516..6fd27cbac 100755 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,8 @@ matrix: - jdk: oraclejdk8 env: - DESC="tests" - script: mvn clean verify + script: + - mvn clean verify - jdk: oraclejdk8 env: @@ -47,6 +48,8 @@ before_deploy: deploy: provider: pages + repo: damianszczepanik/damianszczepanik.github.io + target_branch: master skip-cleanup: true github-token: $GITHUB_TOKEN keep-history: true diff --git a/src/test/java/HelloCucumberTest.java b/src/test/java/HelloCucumberTest.java index ed7895c33..dfbd9efc8 100644 --- a/src/test/java/HelloCucumberTest.java +++ b/src/test/java/HelloCucumberTest.java @@ -13,8 +13,9 @@ public class HelloCucumberTest { // test annotation only to make sure it is generated during "mvn test" + // what is needed to publish generated report via github.com @Test - public void generateReport() throws IOException { + public void generateDemoReport() throws IOException { File reportOutputDirectory = new File("target/demo"); List jsonFiles = new ArrayList<>(); jsonFiles.add("src/test/resources/json/sample.json"); @@ -28,6 +29,7 @@ public void generateReport() throws IOException { configuration.addClassifications("Branch", "release/1.0"); configuration.setSortingMethod(SortingMethod.NATURAL); configuration.addPresentationModes(PresentationMode.EXPAND_ALL_STEPS); + configuration.setTrendsStatsFile(new File("target/test-classes/demo-trends.json")); ReportBuilder reportBuilder = new ReportBuilder(jsonFiles, configuration); reportBuilder.generateReports(); diff --git a/src/test/resources/demo-trends.json b/src/test/resources/demo-trends.json new file mode 100644 index 000000000..7ec4f5689 --- /dev/null +++ b/src/test/resources/demo-trends.json @@ -0,0 +1,47 @@ +{ + "buildNumbers": [ + "01_first", "other build", "05last" + ], + + "passedFeatures": [ + 9, 18, 25 + ], + "failedFeatures": [ + 1, 2, 5 + ], + "totalFeatures": [ + 10, 20, 30 + ], + + "passedScenarios": [ + 10, 20, 20 + ], + "failedScenarios": [ + 10, 20, 20 + ], + "totalScenarios": [ + 10, 2, 5 + ], + + "passedSteps": [ + 1, 3, 5 + ], + "failedSteps": [ + 10, 30, 50 + ], + "skippedSteps": [ + 100, 300, 500 + ], + "pendingSteps": [ + 1000, 3000, 5000 + ], + "undefinedSteps": [ + 10000, 30000, 50000 + ], + "totalSteps": [ + 100000, 300000, 500000 + ], + "durations": [ + 3206126182398, 3206126182399, 3206126182310 + ] +}