Kilimanjaro91
4 years agoNew Contributor
Zephyr scale Jira & Circleci integration
Hi all,
I'm trying to update test results executed from CircleCi build to Jira test cycle but don't know how to config. Please help!
This is my CircleCi config.yml
version: 2.1
jobs:
build-and-test:
docker:
- image: cimg/openjdk:11.0
environment:
dev: https://dev.myapp.com
qa: https://qa.myapp.com
steps:
- checkout
- run:
name: Build and clean
command: mvn -B -DskipTests clean package
- run:
name: run tests
command: mvn test
- run:
name: Save test results
command: |
mkdir -p ~/test-results/cucumber/
find . -type d -name "*cucumber-html-reports*" -exec cp -r {} ~/test-results/cucumber/ \;
when: always
- store_test_results:
path: ~/test-results
- store_artifacts:
path: ~/test-results/cucumber
- run:
name: Zephyr integration
command: |
zip output_results.zip ~/test-results/cucumber/*
curl --basic --user my_jira_email:my_jira_password -F "file=@output_results.zip"
https://mycompany.atlassian.net/rest/atm/1.0/automation/execution/cucumber/FL?autoCreateTestCases=false
workflows:
sample:
jobs:
- build-and-test
This is my test runner (Karate framework + cucumber)
package JSONapi.features;
import com.intuit.karate.junit5.Karate;
import com.intuit.karate.Results;
import com.intuit.karate.Runner;
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import net.masterthought.cucumber.Configuration;
import net.masterthought.cucumber.ReportBuilder;
import org.apache.commons.io.FileUtils;
import static org.junit.Assert.*;
import org.junit.BeforeClass;
import org.junit.Test;
public class TestRunnerParallel {
@BeforeClass
public static void beforeClass(){
System.setProperty("karate.env","local");
}
test
public void testParallel() {
Results results = Runner.path("classpath:JSONapi")
.outputCucumberJson(true)
.tags("~@ignore")
.parallel(5);
generateReport(results.getReportDir());
System.out.println("Report directory: "+results.getReportDir());
assertTrue(results.getErrorMessages(), results.getFailCount() == 0);
}
public static void generateReport(String karateOutputPath) {
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"), "JSONapi");
ReportBuilder reportBuilder = new ReportBuilder(jsonPaths, config);
reportBuilder.generateReports();
}
}
My cucumber feature file
My Test cycle and test case info
Error in circleCi job