Skip to content

Commit

Permalink
Include integration tests in windows and macOS workflow (#1375)
Browse files Browse the repository at this point in the history
Signed-off-by: Rupal Mahajan <maharup@amazon.com>
  • Loading branch information
rupal-bq authored Jan 9, 2023
1 parent a659678 commit 84127f6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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' }}
Expand Down
10 changes: 9 additions & 1 deletion build-tools/opensearchplugin-coverage.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 84127f6

Please sign in to comment.