This repository was archived by the owner on Feb 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
74 lines (59 loc) · 2.39 KB
/
Copy pathbuild.gradle
File metadata and controls
74 lines (59 loc) · 2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
buildscript {
ext {
serenity_version = '2.1.5'
serenity_cucumber4_version = '2.1.2'
cucumber_version = '4.8.0'
}
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath "net.serenity-bdd:serenity-gradle-plugin:$serenity_version"
}
}
plugins {
id "java"
id "idea"
}
apply plugin: "net.serenity-bdd.aggregator"
repositories.addAll(buildscript.repositories)
description = 'Gradle solution for Serenity-Cucumber4 forking mechanizm'
group 'com.github.scormaq'
version = '1.0-SNAPSHOT'
idea.module {
downloadJavadoc = true
downloadSources = true
}
configurations.all {
resolutionStrategy {
failOnVersionConflict()
preferProjectModules()
force "io.cucumber:cucumber-core:$cucumber_version", "io.cucumber:cucumber-java:$cucumber_version", "io.cucumber:cucumber-junit:$cucumber_version"
}
}
dependencies {
compile "net.serenity-bdd:serenity-core:$serenity_version"
compile "net.serenity-bdd:serenity-cucumber4:$serenity_cucumber4_version"
compile "io.cucumber:cucumber-core:$cucumber_version"
compile "io.cucumber:cucumber-junit:$cucumber_version"
compile "org.apache.logging.log4j:log4j-slf4j-impl:2.11.1"
compile "org.apache.logging.log4j:log4j-core:2.11.1"
}
test {
systemProperty 'log4j.skipJansi', 'false' // fix log4j2 coloring output
// We need to have full list of runners to prevent case when count of cucumber forks > count of runners.
// As result there, runners = ['FeatureSlicedRunner1', 'FeatureSlicedRunner2', 'FeatureSlicedRunner3']
List<String> runners = file('src/test/java/com/github/scormaq').listFiles()
.collect { it.name }
.findAll { it =~ 'FeatureSlicedRunner' }
.collect { it.take(it.lastIndexOf('.')) } // trim '.java' to use file names in gradle test filter
maxParallelForks = System.properties.'serenity.fork.count' as Integer ?: 1
maxParallelForks = [maxParallelForks, runners.size()].min() // set correct maximum number of forks, if value in 'serenity.fork.count' was too big
systemProperty 'serenity.fork.count', maxParallelForks // correct that property as well
maxParallelForks.times { filter.includeTestsMatching runners[it] }
ignoreFailures = true
testLogging.showStandardStreams = true
testLogging.exceptionFormat = 'full'
}
gradle.startParameter.continueOnFailure = true