jenkinsci / cucumber-reports-plugin

Jenkins plugin to generate cucumber-jvm reports
https://plugins.jenkins.io/cucumber-reports/
GNU Lesser General Public License v2.1
209 stars 231 forks source link

Classification can not be added on cucumber features report in Jenkins build #380

Open durubayram opened 3 years ago

durubayram commented 3 years ago

Hi, this problem occurs when i build code on Jenkins. I can not see additional classifications which are added from code. I can not see any problem on local build.

Local build: local-cucumber

Jenkins build: jenkins-cucumber

Omega Release can not be added on Jenkins build. Is there any problem on Jenkins cucumber-reports-plugin? Cucumber Report Version : 5.3.1

code for adding classification and generating report below:

public void testParallel() {
    Results results = Runner.path(TESTS_DIR_PATH).tags(tagsList).parallel(THREAD_COUNT);
    JSONObject version = new JSONObject(Runner.runFeature("classpath:test/omega/version.feature", null, true));
    String releaseVersion = version.getJSONObject("response").get("data").toString();
    generateReport(results.getReportDir(), releaseVersion);
    assertEquals(0, results.getFailCount(), results.getErrorMessages());

}

public static void generateReport(String karateOutputPath, String version) {
    Collection<File> jsonFiles = FileUtils.listFiles(new File(karateOutputPath), new String[]{"json"}, true);
    List<String> jsonPaths = new ArrayList<>(jsonFiles.size());
    jsonFiles.forEach(file -> jsonPaths.add(file.getAbsolutePath()));
    Configuration config = new Configuration(new File("target"), "OMEGA & TALISMAN");
    config.addClassifications("Omega Release", version);
    ReportBuilder reportBuilder = new ReportBuilder(jsonPaths, config);
    reportBuilder.generateReports();
}
damianszczepanik commented 3 years ago

Verify configuration

durubayram commented 3 years ago

what do you mean 'verify configuration' ? What's wrong with config.addClassification() function usage?