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

Include integration tests in windows and macOS workflow #1375

Merged
merged 2 commits into from
Jan 9, 2023
Merged
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
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