Skip to content

chore(core): Add gradle unitTest target to fast test execution #402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,33 @@ allprojects {
}
}

test {
dependsOn spotlessApply // Automatically fix code formatting if possible

useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
exceptionFormat = 'full'
}
}

tasks.register('unitTest', Test) {
enabled = !it.project.name.contains("-example") // Examples do not contain unit tests and would fail otherwise
dependsOn spotlessApply // Automatically fix code formatting if possible

description = 'Run only unit tests (excludes **IntegrationTest)'
group = 'verification'

useJUnitPlatform()
filter {
excludePatterns = ['*IntegrationTest']
}
testLogging {
events "passed", "skipped", "failed"
exceptionFormat = 'full'
}
}

var publishingEnabled = (
project.name == 'springwolf-core' ||
project.name == 'springwolf-amqp' ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ java {
withSourcesJar()
}

test {
dependsOn spotlessApply // Automatically fix code formatting if possible

useJUnitPlatform()
}

publishing {
publications {
mavenJava(MavenPublication) {
Expand Down
6 changes: 0 additions & 6 deletions springwolf-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ java {
withSourcesJar()
}

test {
dependsOn spotlessApply // Automatically fix code formatting if possible

useJUnitPlatform()
}

publishing {
publications {
mavenJava(MavenPublication) {
Expand Down
7 changes: 0 additions & 7 deletions springwolf-examples/springwolf-amqp-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,4 @@ docker {

test {
dependsOn dockerBuildImage
dependsOn spotlessApply // Automatically fix code formatting if possible

useJUnitPlatform()

testLogging {
exceptionFormat = 'full'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,4 @@ test {
maxHeapSize = "1024m" // maximum heap size

dependsOn dockerBuildImage
dependsOn spotlessApply // Automatically fix code formatting if possible

useJUnitPlatform()

testLogging {
exceptionFormat = 'full'
}
}
7 changes: 0 additions & 7 deletions springwolf-examples/springwolf-kafka-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,6 @@ docker {

test {
dependsOn dockerBuildImage
dependsOn spotlessApply // Automatically fix code formatting if possible

useJUnitPlatform()

testLogging {
exceptionFormat = 'full'
}
}

openApi {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"port=9092",
})
@DirtiesContext
public class ApiIntegrationWithActuatorTest {
public class ApiIntegrationWithActuatorIntegrationTest {

@Autowired
private TestRestTemplate restTemplate;
Expand Down
7 changes: 0 additions & 7 deletions springwolf-examples/springwolf-sqs-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,4 @@ docker {

test {
dependsOn dockerBuildImage
dependsOn spotlessApply // Automatically fix code formatting if possible

useJUnitPlatform()

testLogging {
exceptionFormat = 'full'
}
}
6 changes: 0 additions & 6 deletions springwolf-plugins/springwolf-amqp-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ java {
withSourcesJar()
}

test {
dependsOn spotlessApply // Automatically fix code formatting if possible

useJUnitPlatform()
}

publishing {
publications {
mavenJava(MavenPublication) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ java {
withSourcesJar()
}

test {
dependsOn spotlessApply // Automatically fix code formatting if possible

useJUnitPlatform()
}

publishing {
publications {
mavenJava(MavenPublication) {
Expand Down
6 changes: 0 additions & 6 deletions springwolf-plugins/springwolf-kafka-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ java {
withSourcesJar()
}

test {
dependsOn spotlessApply // Automatically fix code formatting if possible

useJUnitPlatform()
}

publishing {
publications {
mavenJava(MavenPublication) {
Expand Down
6 changes: 0 additions & 6 deletions springwolf-plugins/springwolf-sns-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ java {
withSourcesJar()
}

test {
dependsOn spotlessApply // Automatically fix code formatting if possible

useJUnitPlatform()
}

publishing {
publications {
mavenJava(MavenPublication) {
Expand Down
6 changes: 0 additions & 6 deletions springwolf-plugins/springwolf-sqs-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ java {
withSourcesJar()
}

test {
dependsOn spotlessApply // Automatically fix code formatting if possible

useJUnitPlatform()
}

publishing {
publications {
mavenJava(MavenPublication) {
Expand Down