Skip to content
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

ISSUE-2640: BP-43: github actions: Run bookie-tests using gradle #2685

Closed
wants to merge 1 commit into from
Closed
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
26 changes: 20 additions & 6 deletions .github/workflows/bookie-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ on:
- 'site/**'
workflow_dispatch:


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

Expand All @@ -49,14 +48,29 @@ jobs:
with:
java-version: 1.8

- name: Maven build bookkeeper-server
run: mvn -B -nsu -am -pl bookkeeper-server clean install -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: gradle build bookkeeper-server
run: ./gradlew -PskipSigning=true :bookkeeper-server:clean :bookkeeper-server:publishToMavenLocal :bookkeeper-server:cleanTest

- name: Run EntryLogTests
run: mvn -B -nsu -pl bookkeeper-server test -Dtest="org.apache.bookkeeper.bookie.TestEntryLog" -DfailIfNoTests=false -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO
run: ./gradlew -PskipSigning=true :bookkeeper-server:test --tests=org.apache.bookkeeper.bookie.TestEntryLog

- name: Run InterleavedLedgerStorageTest
run: mvn -B -nsu -pl bookkeeper-server test -Dtest="org.apache.bookkeeper.bookie.TestInterleavedLederStorage" -DfailIfNoTests=false -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO
run: ./gradlew -PskipSigning=true :bookkeeper-server:test --tests=org.apache.bookkeeper.bookie.TestInterleavedLedgerStorage

- name: Run bookie tests
run: mvn -B -nsu -pl bookkeeper-server test -Dtest="org.apache.bookkeeper.bookie.*Test" -DfailIfNoTests=false -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO
run: ./gradlew -PskipSigning=true :bookkeeper-server:test --tests="org.apache.bookkeeper.bookie.*Test"

- name: Cleanup Gradle Cache
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties
13 changes: 12 additions & 1 deletion bookkeeper-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ dependencies {
implementation depLibs.commonsConfiguration
implementation depLibs.commonsIO
implementation depLibs.commonsLang3
implementation depLibs.commonsLang3
implementation depLibs.guava
implementation depLibs.httpclient
implementation depLibs.jacksonAnnotations
Expand All @@ -53,9 +52,12 @@ dependencies {
implementation depLibs.nettyTransportNativeEpoll
implementation depLibs.protobuf
implementation depLibs.rocksDb
implementation depLibs.slf4j
implementation depLibs.slf4jLog4j
implementation depLibs.zookeeper

testImplementation project(':bookkeeper-stats-providers:prometheus-metrics-provider')
testImplementation project(':bookkeeper-http:vertx-http-server')
testImplementation project(path: ':bookkeeper-common', configuration: 'testArtifacts')

testCompileOnly depLibs.lombok
Expand All @@ -64,9 +66,13 @@ dependencies {
testImplementation depLibs.junit
testImplementation depLibs.junitFoundation
testImplementation depLibs.kerbySimpleKdc
testImplementation depLibs.metricsCore
testImplementation depLibs.mockito
testImplementation depLibs.powermockJunit
testImplementation depLibs.powermockMockito
testImplementation depLibs.slf4j
testImplementation depLibs.slf4jLog4j
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If its already implementation dependency it does not have to be testImplementation dependency.

testImplementation depLibs.snappy
testImplementation depLibs.zookeeperTest

annotationProcessor depLibs.lombok
Expand All @@ -76,6 +82,11 @@ dependencies {
test {
maxHeapSize = '2G'
forkEvery = 1

retry {
maxRetries = 2
maxFailures = 20
}
}

test.doFirst {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public EnableZkSecurityBasicTest() {
@BeforeClass
public static void setupJAAS() throws IOException {
System.setProperty("zookeeper.authProvider.1", "org.apache.zookeeper.server.auth.SASLAuthenticationProvider");
File tmpJaasDir = new File("target").getAbsoluteFile();
File tmpJaasDir = Files.createTempDirectory("jassTmpDir").toFile();
File tmpJaasFile = new File(tmpJaasDir, "jaas.conf");
String jassFileContent = "Server {\n"
+ " org.apache.zookeeper.server.auth.DigestLoginModule required\n"
Expand Down
21 changes: 21 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ plugins {
id "com.github.vlsi.stage-vote-release" version "1.73"
id 'checkstyle'
id 'org.nosphere.apache.rat'
id "org.gradle.test-retry" version "1.2.1"
}

subprojects {
Expand Down Expand Up @@ -68,6 +69,8 @@ allprojects {
apply plugin: 'signing'
apply plugin: 'org.nosphere.apache.rat'
apply plugin: "checkstyle"
apply plugin: 'org.gradle.test-retry'

checkstyle {
toolVersion "${checkStyleVersion}"
configFile file("$rootDir/buildtools/src/main/resources/bookkeeper/checkstyle.xml")
Expand Down Expand Up @@ -191,6 +194,24 @@ allprojects {
// Signing task is added by the release plugin
}
}
test {
testLogging {
events "skipped", "failed", "standardError"
}

String testGroup = System.properties['testGroup']
if (testGroup == 'client') {
include '**/client/*'
} else if (testGroup == 'bookie') {
include '**/bookie/*'
} else if (testGroup == 'other') {
exclude '**/client/*'
exclude '**/bookie/*'
}
if (project.hasProperty('excludeTests')) {
exclude project.property('excludeTests')
}
}
}

repositories {
Expand Down
19 changes: 16 additions & 3 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ depLibs = [
jna: "net.java.dev.jna:jna:${depVersions.jna}",
jsr305: "com.google.code.findbugs:jsr305:${depVersions.jsr305}",
junit: "junit:junit:${depVersions.junit}",
junitFoundation: "com.nordstrom.tools:junit-foundation:${depVersions.junitFoundation}",
junitFoundation: dependencies.create("com.nordstrom.tools:junit-foundation:${depVersions.junitFoundation}") {
exclude group: 'ch.qos.logback', module: 'logback-classic'
},
kerbySimpleKdc: "org.apache.kerby:kerb-simplekdc:${depVersions.kerby}",
log4j: "log4j:log4j:${depVersions.log4j}",
lombok: "org.projectlombok:lombok:${depVersions.lombok}",
Expand Down Expand Up @@ -160,6 +162,17 @@ depLibs = [
vertxCore: "io.vertx:vertx-core:${depVersions.vertx}",
vertxWeb: "io.vertx:vertx-web:${depVersions.vertx}",
yahooDatasketches: "com.yahoo.datasketches:sketches-core:${depVersions.yahooDatasketches}",
zookeeper: "org.apache.zookeeper:zookeeper:${depVersions.zookeeper}",
zookeeperTest: "org.apache.zookeeper:zookeeper:${depVersions.zookeeper}:tests"
zookeeper: dependencies.create("org.apache.zookeeper:zookeeper:${depVersions.zookeeper}"){
exclude group: "net.java.dev.javacc", module: "javacc"
exclude group: "org.slf4j", module: "slf4j-log4j12"
exclude group: "org.slf4j", module: "slf4j-api"
exclude group: "log4j", module: "log4j"
exclude group: "io.netty", module: "*"
},
zookeeperTest: dependencies.create("org.apache.zookeeper:zookeeper:${depVersions.zookeeper}:tests"){
exclude group: "org.slf4j", module: "slf4j-log4j12"
exclude group: "org.slf4j", module: "slf4j-api"
exclude group: "log4j", module: "log4j"
exclude group: "io.netty", module: "*"
}
]