From 0e80c679c2f7fabd5e5ec7ee2eba256cfc1b364f Mon Sep 17 00:00:00 2001 From: Rupal Mahajan Date: Mon, 9 Jan 2023 23:53:34 +0000 Subject: [PATCH] Include integration tests in windows and macOS workflow (#1375) Signed-off-by: Rupal Mahajan (cherry picked from commit 84127f6b22c71e62bce36e570b79dc1e2e48f6c0) --- ...pensearch-observability-test-and-build-workflow.yml | 9 +-------- build-tools/opensearchplugin-coverage.gradle | 10 +++++++++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/opensearch-observability-test-and-build-workflow.yml b/.github/workflows/opensearch-observability-test-and-build-workflow.yml index 521d3b2ea..f21ee5b34 100644 --- a/.github/workflows/opensearch-observability-test-and-build-workflow.yml +++ b/.github/workflows/opensearch-observability-test-and-build-workflow.yml @@ -4,17 +4,10 @@ on: [pull_request, push] jobs: build: - env: - BUILD_ARGS: ${{ matrix.os_build_args }} strategy: matrix: java: [11, 17] os: [ubuntu-latest, windows-latest, macos-latest] - include: - - os: windows-latest - os_build_args: -x integTest -x jacocoTestReport - - os: macos-latest - os_build_args: -x integTest -x jacocoTestReport runs-on: ${{ matrix.os }} steps: @@ -34,7 +27,7 @@ jobs: - name: Build with Gradle run: | - ./gradlew build ${{ env.BUILD_ARGS }} + ./gradlew build - name: Upload coverage if: ${{ matrix.os == 'ubuntu-latest' }} diff --git a/build-tools/opensearchplugin-coverage.gradle b/build-tools/opensearchplugin-coverage.gradle index b6d1d825d..de94a5375 100644 --- a/build-tools/opensearchplugin-coverage.gradle +++ b/build-tools/opensearchplugin-coverage.gradle @@ -17,6 +17,9 @@ * break if there are multiple nodes in the integTestCluster. But for now... it sorta works. */ +import org.apache.tools.ant.taskdefs.condition.Os +apply plugin: 'jacoco' + // Get gradle to generate the required jvm agent arg for us using a dummy tasks of type Test. Unfortunately Elastic's // testing tasks don't derive from Test so the jacoco plugin can't do this automatically. def jacocoDir = "${buildDir}/jacoco" @@ -61,7 +64,12 @@ allprojects{ jacocoTestReport.dependsOn integTest testClusters.integTest { - jvmArgs " ${dummyIntegTest.jacoco.getAsJvmArg()}".replace('javaagent:','javaagent:/') + if (Os.isFamily(Os.FAMILY_WINDOWS)) { + // Replacing build with absolute path to fix the error "error opening zip file or JAR manifest missing : /build/tmp/expandedArchives/..../jacocoagent.jar" + jvmArgs " ${dummyIntegTest.jacoco.getAsJvmArg()}".replace('build',"${buildDir}") + } else { + jvmArgs " ${dummyIntegTest.jacoco.getAsJvmArg()}".replace('javaagent:','javaagent:/') + } systemProperty 'com.sun.management.jmxremote', "true" systemProperty 'com.sun.management.jmxremote.authenticate', "false" systemProperty 'com.sun.management.jmxremote.port', "7777"