diff --git a/.github/workflows/gauntlet-tests-workflow.yml b/.github/workflows/gauntlet-tests-workflow.yml index 552b0ae85..bfea1e9d1 100644 --- a/.github/workflows/gauntlet-tests-workflow.yml +++ b/.github/workflows/gauntlet-tests-workflow.yml @@ -13,11 +13,15 @@ jobs: build_rca_pkg: runs-on: [ubuntu-latest] name: Build and Run Gauntlet tests + strategy: + matrix: + java: + - 17 steps: - name: Set up JDK uses: actions/setup-java@v1 with: - java-version: 14 + java-version: ${{matrix.java}} # RCA in ./tmp/performance-analyzer-rca - name: Checkout RCA uses: actions/checkout@v2 diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 383a384e5..24848b888 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -14,7 +14,6 @@ jobs: strategy: matrix: java: - - 11 - 17 fail-fast: false runs-on: [ubuntu-latest] diff --git a/build.gradle b/build.gradle index 10d307872..5c63a9c61 100644 --- a/build.gradle +++ b/build.gradle @@ -46,13 +46,14 @@ plugins { id 'java' id 'application' id 'maven-publish' - id 'com.google.protobuf' version '0.8.18' + id 'com.google.protobuf' version '0.9.4' id 'jacoco' id 'idea' - id 'com.github.spotbugs' version '5.0.13' - id "de.undercouch.download" version "4.0.4" - id 'com.adarshr.test-logger' version '2.1.0' - id 'org.gradle.test-retry' version '1.5.2' + id 'eclipse' + id 'com.github.spotbugs' version '6.0.7' + id "de.undercouch.download" version "5.5.0" + id 'com.adarshr.test-logger' version '4.0.0' + id 'org.gradle.test-retry' version '1.5.8' id 'com.diffplug.spotless' version '5.11.0' } @@ -126,7 +127,8 @@ testlogger { spotbugsMain { excludeFilter = file("checkstyle/findbugs-exclude.xml") - effort = 'max' + + effort = com.github.spotbugs.snom.Effort.MAX ignoreFailures = true // TODO: Set this to false later as they are too many warnings to be fixed. reports { @@ -145,14 +147,14 @@ check { } jacoco { - toolVersion = "0.8.7" + toolVersion = "0.8.11" } jacocoTestReport { reports { - xml.enabled true - html.enabled true - csv.enabled false + xml.required = true + html.required = true + csv.required = false } afterEvaluate { @@ -208,7 +210,7 @@ check.dependsOn jacocoTestCoverageVerification version = opensearch_build distZip { - archiveName "performance-analyzer-rca-${version}.zip" + archiveFileName = "performance-analyzer-rca-${version}.zip" } publishing { @@ -260,6 +262,9 @@ tasks.withType(Test) { jvmArgs('--add-opens=java.base/java.nio.file=ALL-UNNAMED') jvmArgs('--add-opens=java.base/java.lang=ALL-UNNAMED') jvmArgs('--add-opens=java.base/java.util=ALL-UNNAMED') + if (JavaVersion.current().compareTo(JavaVersion.VERSION_17) > 0) { + jvmArgs += ["-Djava.security.manager=allow"] + } } task rcaTest(type: Test) { @@ -367,19 +372,15 @@ dependencies { implementation group: 'com.google.protobuf', name: 'protobuf-java', version: "${protobufVersion}" implementation 'io.grpc:grpc-netty:1.56.1' implementation 'io.grpc:grpc-protobuf:1.56.1' - implementation("io.netty:netty-codec-http2:${nettyVersion}") { - force = 'true' - } - implementation("io.netty:netty-handler-proxy:${nettyVersion}") { - force = 'true' - } + implementation("io.netty:netty-codec-http2:${nettyVersion}") + implementation("io.netty:netty-handler-proxy:${nettyVersion}") implementation 'io.grpc:grpc-stub:1.52.1' implementation "jakarta.annotation:jakarta.annotation-api:${jakartaVersion}" // JDK9+ has to run powermock 2+. https://github.com/powermock/powermock/issues/888 testImplementation group: 'org.powermock', name: 'powermock-api-mockito2', version: '2.0.0' testImplementation group: 'org.powermock', name: 'powermock-module-junit4', version: '2.0.0' - implementation("org.mockito:mockito-core") { + testImplementation("org.mockito:mockito-core") { version { strictly "2.23.0" } @@ -387,10 +388,10 @@ dependencies { testImplementation group: 'org.powermock', name: 'powermock-core', version: '2.0.2' testImplementation group: 'org.powermock', name: 'powermock-api-support', version: '2.0.2' testImplementation group: 'org.powermock', name: 'powermock-module-junit4-common', version: '2.0.2' - testImplementation group: 'org.javassist', name: 'javassist', version: '3.28.0-GA' testImplementation group: 'org.powermock', name: 'powermock-reflect', version: '2.0.2' - testImplementation group: 'net.bytebuddy', name: 'byte-buddy', version: '1.9.3' - testImplementation group: 'org.objenesis', name: 'objenesis', version: '3.0.1' + testImplementation group: 'org.javassist', name: 'javassist', version: '3.28.0-GA' + testImplementation group: 'net.bytebuddy', name: 'byte-buddy', version: '1.14.7' + testImplementation group: 'org.objenesis', name: 'objenesis', version: '3.2' testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1' testImplementation group: 'org.hamcrest', name: 'hamcrest', version: '2.1' testImplementation group: 'junit', name: 'junit', version: "${junitVersion}" diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 943f0cbfa..d64cd4917 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 508322917..3499ded5c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 65dcd68d6..1aa94a426 100755 --- a/gradlew +++ b/gradlew @@ -83,10 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,10 +131,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \