Skip to content

Commit

Permalink
Migrate bookkeepr-server:test to gradle run unit tests excepts org.ap…
Browse files Browse the repository at this point in the history
…ache.bookkeeper.bookie. org.apache.bookkeeper.client org.apache.bookkeeper.replication org.apache.bookkeeper.tls. (apache#2812)

Co-authored-by: Prashant Kumar <[email protected]>
  • Loading branch information
pkumar-singh and Prashant Kumar authored Oct 20, 2021
1 parent f6903b8 commit 3dd671c
Show file tree
Hide file tree
Showing 54 changed files with 489 additions and 168 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/compatibility-check-java11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ on:
- 'site/**'
workflow_dispatch:

env:
MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3

jobs:
check:

Expand All @@ -48,5 +45,7 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 1.11
- name: Build with Maven
run: mvn clean package -B -nsu -DskipBookKeeperServerTests -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO
- name: Build with gradle
run: ./gradlew test -x bookkeeper-server:test -x tests:integration:cluster:test -x tests:integration:smoke:test -x tests:integration:standalone:test -Dtestlogger.theme=plain
-PexcludeTests="*.apache.distributedlog.*, *.apache.bookkeeper.statelib.*, *.apache.bookkeeper.clients.*, *.apache.bookkeeper.common.*, *.apache.bookkeeper.stream.*"

11 changes: 6 additions & 5 deletions .github/workflows/compatibility-check-java8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ on:
- 'site/**'
workflow_dispatch:

env:
MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3

jobs:
check:

Expand All @@ -48,5 +45,9 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Maven
run: mvn clean package -B -nsu spotbugs:check -DskipBookKeeperServerTests -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO
- name: Build with gradle
run: ./gradlew test -x bookkeeper-server:test
-x tests:integration:cluster:test
-x tests:integration:smoke:test
-x tests:integration:standalone:test -Dtestlogger.theme=plain
-PexcludeTests="*.apache.distributedlog.*, *.apache.bookkeeper.statelib.*, *.apache.bookkeeper.clients.*, *.apache.bookkeeper.common.*, *.apache.bookkeeper.stream.*"
15 changes: 8 additions & 7 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,12 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Maven
run: mvn -B -nsu clean install -Pdocker -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO

- name: Run metadata driver tests
run: mvn -B -nsu -f metadata-drivers/pom.xml test -DintegrationTests -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO

- name: Run all integration tests
run: mvn -B -nsu -f tests/pom.xml test -DintegrationTests -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO
- name: Build tar
run: ./gradlew stream:server:build -x test
- name: run cluster integration test
run: ./gradlew :tests:integration:cluster:test -Dtestlogger.theme=plain
- name: run smoke test
run: ./gradlew tests:integration:smoke:test -Dtestlogger.theme=plain
- name: run standalone test
run: ./gradlew tests:integration:standalone:test -Dtestlogger.theme=plain
8 changes: 3 additions & 5 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ on:
- 'site/**'
workflow_dispatch:

env:
MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3

jobs:
check:
Expand All @@ -48,7 +46,7 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Validate pull request style
run: mvn clean -B -nsu apache-rat:check checkstyle:check package -Ddistributedlog -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO
- name: Validate pull request
run: ./gradlew build -x microbenchmarks:checkstyleMain -x spotbugsTest -x signDistTar -x test
- name: Check license files
run: dev/check-all-licenses
run: dev/check-all-licenses-gradle
5 changes: 1 addition & 4 deletions .github/workflows/remaining-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ on:
- 'site/**'
workflow_dispatch:

env:
MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3

jobs:
test:

Expand All @@ -49,4 +46,4 @@ jobs:
with:
java-version: 1.8
- name: Run remaining tests
run: mvn -B -nsu -am -pl bookkeeper-server clean install test -Dtest="!org.apache.bookkeeper.client.**,!org.apache.bookkeeper.bookie.**,!org.apache.bookkeeper.replication.**,!org.apache.bookkeeper.tls.**" -DfailIfNoTests=false -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO
run: ./gradlew bookkeeper-server:test -PexcludeTests="*org.apache.bookkeeper.bookie.*, *org.apache.bookkeeper.client.*, *org.apache.bookkeeper.replication.*, *org.apache.bookkeeper.tls.*" -Dtestlogger.theme=plain
2 changes: 1 addition & 1 deletion .github/workflows/replication-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ jobs:
with:
java-version: 1.8
- name: Run replication tests
run: mvn -B -nsu -am -pl bookkeeper-server clean install test -Dtest="org.apache.bookkeeper.replication.**" -DfailIfNoTests=false -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO
run: ./gradlew bookkeeper-server:test --tests="org.apache.bookkeeper.replication.*" -Dtestlogger.theme=plain
24 changes: 17 additions & 7 deletions .github/workflows/stream-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ on:
- 'site/**'
workflow_dispatch:

env:
MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3

jobs:
test:

Expand All @@ -47,7 +44,20 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Maven
run: mvn -B -nsu clean install -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO
- name: Run StreamStorage tests
run: mvn -B -nsu -f stream/pom.xml verify -DstreamTests -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO
- name: Run stream:distributedlog:core tests
run: ./gradlew stream:distributedlog:core:test -Dtestlogger.theme=plain
- name: Run stream:distributedlog:common tests
run: ./gradlew stream:distributedlog:common:test -Dtestlogger.theme=plain
- name: Run stream:distributedlog:protocol tests
run: ./gradlew stream:distributedlog:protocol:test -Dtestlogger.theme=plain
- name: Run stream:proto tests
run: ./gradlew stream:proto:test -Dtestlogger.theme=plain
- name: Run stream:serve tests
run: ./gradlew stream:server:test -Dtestlogger.theme=plain
- name: Run stream:statelib tests
run: ./gradlew stream:statelib:test -Dtestlogger.theme=plain
- name: Run stream:storage:api:test tests
run: ./gradlew stream:storage:api:test -Dtestlogger.theme=plain
- name: Run stream:storage:impl tests
run: ./gradlew stream:storage:impl:test -Dtestlogger.theme=plain

5 changes: 1 addition & 4 deletions .github/workflows/tls-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ on:
- 'site/**'
workflow_dispatch:

env:
MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3

jobs:
test:

Expand All @@ -49,4 +46,4 @@ jobs:
with:
java-version: 1.8
- name: Run tls tests
run: mvn -B -am -nsu -pl bookkeeper-server clean install test -Dtest="org.apache.bookkeeper.tls.**" -DfailIfNoTests=false -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO
run: ./gradlew bookkeeper-server:test --tests="org.apache.bookkeeper.tls.*" -Dtestlogger.theme=plain
9 changes: 8 additions & 1 deletion bookkeeper-benchmark/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
*/
plugins {
id 'java-library'
id 'com.adarshr.test-logger'
id 'org.gradle.test-retry'
}

description = 'Apache BookKeeper :: Benchmark'
Expand All @@ -39,7 +41,7 @@ dependencies {
implementation depLibs.nettyBuffer
implementation depLibs.nettyTransportNativeEpoll
implementation depLibs.zookeeper

implementation depLibs.log4j12api

testImplementation project(':bookkeeper-server')
testImplementation project(path: ':bookkeeper-common', configuration: 'testArtifacts')
Expand All @@ -57,6 +59,11 @@ dependencies {
}

test {
retry {
maxFailures = 10
maxRetries = 3
}

maxHeapSize = '4G'
forkEvery = 1
jvmArgs("-Djunit.timeout.test=600000",
Expand Down
1 change: 1 addition & 0 deletions bookkeeper-common-allocator/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
plugins {
id 'java-library'
id 'com.adarshr.test-logger'
}

dependencies {
Expand Down
13 changes: 12 additions & 1 deletion bookkeeper-common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@
plugins {
id 'java-library'
id "java-test-fixtures"
id 'com.adarshr.test-logger'
id 'org.gradle.test-retry'
}

dependencies {
implementation project(":bookkeeper-stats")
implementation project(":cpu-affinity")

compileOnly depLibs.errorprone
implementation depLibs.errorprone
compileOnly depLibs.jsr305
compileOnly depLibs.lombok
compileOnly depLibs.spotbugsAnnotations
Expand All @@ -50,3 +52,12 @@ dependencies {
testAnnotationProcessor depLibs.lombok
}

test {
retry {
maxFailures = 20
maxRetries = 3
}

maxHeapSize = '3G'
forkEvery = 1
}
26 changes: 12 additions & 14 deletions bookkeeper-dist/all/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ plugins {
description = 'Apache BookKeeper :: Dist (All)'

dependencies {

implementation project(':bookkeeper-benchmark')
implementation project(':bookkeeper-http:http-server')
implementation project(':bookkeeper-http:vertx-http-server')
Expand All @@ -36,18 +35,13 @@ dependencies {
implementation project(':stream:distributedlog:core')
implementation project(':stream:server')
implementation project(':bookkeeper-tools')

compileOnly depLibs.lombok
compileOnly depLibs.spotbugsAnnotations

implementation depLibs.log4j12api


testCompileOnly depLibs.lombok


annotationProcessor depLibs.lombok
testAnnotationProcessor depLibs.lombok
implementation depLibs.jsr305
runtimeOnly depLibs.log4j12api
implementation (depLibs.zookeeperTest) {
exclude group: "io.netty", module: "netty-transport-native-epoll"
exclude group: 'log4j', module: 'log4j'
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
}
}

jar {
Expand Down Expand Up @@ -116,7 +110,11 @@ distributions {
} else {
// External dependencies
def id = dep.moduleVersion.id
archiveName = "${id.group}-${id.name}-${id.version}.jar"
if (dep.classifier != null) {
archiveName = "${id.group}-${id.name}-${id.version}-${dep.classifier}.jar"
} else {
archiveName = "${id.group}-${id.name}-${id.version}.jar"
}
}
rename {archiveName}
}
Expand Down
21 changes: 18 additions & 3 deletions bookkeeper-dist/bkctl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,19 @@ plugins {
}

dependencies {
implementation project(":bookkeeper-tools")
implementation (project(":bookkeeper-tools")) {
exclude group: "org.rocksdb", module: "rocksdbjni"
}
runtimeOnly (depLibs.zookeeperTest) {
exclude group: "io.netty", module: "netty-transport-native-epoll"
exclude group: 'log4j', module: 'log4j'
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
}
runtimeOnly (project(':bookkeeper-stats-providers:codahale-metrics-provider')) {
exclude group: "io.dropwizard.metrics", module: "metrics-graphite"
exclude group: "io.dropwizard.metrics", module: "metrics-jvm"
}
runtimeOnly depLibs.snappy
}

releaseArtifacts {
Expand All @@ -35,7 +47,6 @@ releaseArtifacts {
def depLicences = [
"checker-qual-3.5.0/LICENSE",
"google-auth-library-credentials-0.20.0/LICENSE",
"javax.servlet-api-4.0.0/CDDL+GPL-1.1",
"netty-4.1.68.Final/*",
"bouncycastle-1.0.2/LICENSE.html",
"protobuf-3.14.0/LICENSE",
Expand Down Expand Up @@ -99,7 +110,11 @@ distributions {
} else {
// External dependencies
def id = dep.moduleVersion.id
archiveName = "${id.group}-${id.name}-${id.version}.jar"
if (dep.classifier != null) {
archiveName = "${id.group}-${id.name}-${id.version}-${dep.classifier}.jar"
} else {
archiveName = "${id.group}-${id.name}-${id.version}.jar"
}
}
rename {archiveName}
}
Expand Down
33 changes: 19 additions & 14 deletions bookkeeper-dist/server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,20 @@ releaseArtifacts {
artifact(tasks.named("distTar"))
}

// implementation project(':bookkeeper-http:vertx-http-server')
dependencies {

implementation project(':bookkeeper-http:http-server')
implementation project(':bookkeeper-server')
implementation project(':bookkeeper-stats-providers:prometheus-metrics-provider')
implementation project(':bookkeeper-stats')
implementation project(':stream:distributedlog:core')
implementation project(':stream:server')
implementation project(':bookkeeper-tools')

compileOnly depLibs.lombok
compileOnly depLibs.spotbugsAnnotations

implementation depLibs.log4j12api


testCompileOnly depLibs.lombok


annotationProcessor depLibs.lombok
testAnnotationProcessor depLibs.lombok
runtimeOnly (depLibs.zookeeperTest) {
exclude group: "io.netty", module: "netty-transport-native-epoll"
exclude group: 'log4j', module: 'log4j'
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
}
}

jar {
Expand Down Expand Up @@ -106,7 +98,11 @@ distributions {
} else {
// External dependencies
def id = dep.moduleVersion.id
archiveName = "${id.group}-${id.name}-${id.version}.jar"
if (dep.classifier != null) {
archiveName = "${id.group}-${id.name}-${id.version}-${dep.classifier}.jar"
} else {
archiveName = "${id.group}-${id.name}-${id.version}.jar"
}
}
rename {archiveName}
}
Expand All @@ -116,3 +112,12 @@ distributions {
}
}
}

publishing {
publications {
maven(MavenPublication) {
groupId = 'org.apache.bookkeeper'
artifactId = 'bookkeeper-dist-server'
}
}
}
11 changes: 11 additions & 0 deletions bookkeeper-http/vertx-http-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,24 @@
*/
plugins {
id 'java'
id 'com.adarshr.test-logger'
}

dependencies {
implementation project(':bookkeeper-http:http-server')
implementation depLibs.slf4j
implementation depLibs.vertxCore
implementation depLibs.vertxWeb
implementation depLibs.nettyBuffer
implementation depLibs.nettyCommon
implementation depLibs.nettyHandler
implementation depLibs.nettyTransport
runtimeOnly depLibs.nettyTransportNativeEpoll
implementation depLibs.nettyProxy
implementation depLibs.nettyCodecHTTP
implementation depLibs.nettyCodecHTTP2
implementation depLibs.nettyResolver
implementation depLibs.nettyResolverDNS
testImplementation depLibs.junit
}

Expand Down
Loading

0 comments on commit 3dd671c

Please sign in to comment.