If you have a pipeline job you might want to run a single cucumber file in jenkins in headless mode you can configure your pipeline to run a single file rather than running parallel of all tests.
You can simply create a method that calls the run tests method below which determines which set of tests to run based on the build variables.
// run feature/features that are provided into the build
def runfeaturefile(){
echo "Running feature file"
def features = env.FEATURE
List<String> items = Arrays.asList(features.split("\s*,\s*"));
try{
for (int i = 0; i < items.size(); i++) {
runner.runfeature('testfeature${i}',items[i]);
}
} finally {
cleanup.dockerCleanup("docker.endpoint/ruby-autotest:${env.BUILD_NUMBER}");
}
currentBuild.description="Tested ${env.AUTO_BRANCH}"
}
0 Comments