From 9002220dfacf0cfcb49f22abff4a835452d869ed Mon Sep 17 00:00:00 2001 From: Pawel Gudel Date: Fri, 16 Jun 2023 14:46:53 +0200 Subject: [PATCH] Restored default 'test' task 1. Default 'test' task will run full test suite. 2. For CI builds (run on Github Actions) we've copied existing configuration to task 'citest' which will be run only from CI. 3. We've moved all dependencies to 'citest' 4. 'opensslTest' is still removed and incorporated into both 'test' (as a part of full suite) and 'citest' (as a separate 'sslTest' task) Signed-off-by: Pawel Gudel --- .github/workflows/ci.yml | 4 +++- build.gradle | 36 ++++++++++++++++++++++++++++++++++-- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73842da870..6b46e8f829 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,7 @@ jobs: uses: gradle/gradle-build-action@v2 with: arguments: | - build test ${{ needs.generate-test-list.outputs.testsNamesExclude }} -Dbuild.snapshot=false + build citest ${{ needs.generate-test-list.outputs.testsNamesExclude }} -Dbuild.snapshot=false -x integrationTest -x spotlessCheck -x checkstyleMain @@ -59,6 +59,7 @@ jobs: -x spotbugsMain -x spotbugsIntegrationTest -x checkstyleIntegrationTest + -x test - name: Coverage uses: codecov/codecov-action@v1 @@ -110,6 +111,7 @@ jobs: -x spotbugsMain -x spotbugsIntegrationTest -x checkstyleIntegrationTest + -x citest -x test - uses: actions/upload-artifact@v3 diff --git a/build.gradle b/build.gradle index b873c35f8a..714c20bd9d 100644 --- a/build.gradle +++ b/build.gradle @@ -210,7 +210,38 @@ test { include '**/*.class' filter { excludeTestsMatching "org.opensearch.security.sanity.tests.*" - excludeTestsMatching "org.opensearch.security.ssl.OpenSSL*" + } + maxParallelForks = 8 + jvmArgs += "-Xmx3072m" + if (JavaVersion.current() > JavaVersion.VERSION_1_8) { + jvmArgs += "--add-opens=java.base/java.io=ALL-UNNAMED" + } + retry { + failOnPassedAfterRetry = false + maxRetries = 5 + } + jacoco { + excludes = [ + "com.sun.jndi.dns.*", + "com.sun.security.sasl.gsskerb.*", + "java.sql.*", + "javax.script.*", + "org.jcp.xml.dsig.internal.dom.*", + "sun.nio.cs.ext.*", + "sun.security.ec.*", + "sun.security.jgss.*", + "sun.security.pkcs11.*", + "sun.security.smartcardio.*", + "sun.util.resources.provider.*" + ] + } +} + +task citest(type: Test) { +// onlyIf { !project.gradle.taskGraph.hasTask(':test') } + include '**/*.class' + filter { + excludeTestsMatching "org.opensearch.security.sanity.tests.*" splitTestConfig.each { entry -> entry.value.each{ test -> if (test.key == "includeTestsMatching") { @@ -294,7 +325,8 @@ task copyExtraTestResources(dependsOn: testClasses) { into 'build/testrun/test/src/test/resources' } } -tasks.test.dependsOn(copyExtraTestResources, taskNames) +tasks.test.dependsOn(copyExtraTestResources) +tasks.citest.dependsOn(copyExtraTestResources, taskNames) jacoco { reportsDirectory = file("$buildDir/reports/jacoco")