From 978d96fcc8d767a7d53dbccfdbb591c43c698714 Mon Sep 17 00:00:00 2001 From: Pawel Gudel Date: Mon, 12 Jun 2023 15:38:17 +0200 Subject: [PATCH 01/20] Split tests into multiple tasks * Split multiple tests into separate gradle tasks. * Tasks are configured in "splitTestConfig" map in build.gradle file. Map allows to use all patterns from TestFilter like: includeTestsMatching, excludeTestsMatching, includeTest etc. * Tasks are automatically generated from "splitTestConfig" map. * Two new Gradle tasks: listTasksAsJSON and listTasksAsParam to output task names to console. First one outputs them as a JSON and second - in gradlew "-x " format to use in CLI. * Patterns included in tasks are automatically excluded from main "test" task but at the same time generated tasks are dependencies for "test". Running "gradlew test" will run whole suite at once. * CI pipeline has been configured to accomodate all changes. * New 'master' task to generate list of jobs to run in parallel. * Updated matrix strategy to include task name to start. Signed-off-by: Pawel Gudel --- .github/workflows/ci.yml | 73 +++++++++++++++++++++++++- build.gradle | 107 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 177 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c6465c5d4e..73842da870 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,8 +6,30 @@ env: GRADLE_OPTS: -Dhttp.keepAlive=false jobs: + generate-test-list: + runs-on: ubuntu-latest + outputs: + separateTestsNames: ${{ steps.set-matrix.outputs.separateTestsNames }} + testsNamesExclude: ${{ steps.set-matrix.outputs.testsNamesExclude }} + steps: + - name: Set up JDK for build and test + uses: actions/setup-java@v2 + with: + distribution: temurin # Temurin is a distribution of adoptium + java-version: 17 + + - name: Checkout security + uses: actions/checkout@v2 + + - name: Generate list of tasks + id: set-matrix + run: | + echo "separateTestsNames=$(./gradlew listTasksAsJSON -q --console=plain | tail -n 1)" >> $GITHUB_OUTPUT + echo "testsNamesExclude=$(./gradlew listTasksAsParam -q --console=plain | tail -n 1)" >> $GITHUB_OUTPUT + build: name: build + needs: generate-test-list strategy: fail-fast: false matrix: @@ -29,12 +51,14 @@ jobs: uses: gradle/gradle-build-action@v2 with: arguments: | - build test -Dbuild.snapshot=false + build test ${{ needs.generate-test-list.outputs.testsNamesExclude }} -Dbuild.snapshot=false -x integrationTest -x spotlessCheck -x checkstyleMain -x checkstyleTest -x spotbugsMain + -x spotbugsIntegrationTest + -x checkstyleIntegrationTest - name: Coverage uses: codecov/codecov-action@v1 @@ -53,6 +77,52 @@ jobs: if: always() run: echo "Check the artifact ${{ matrix.platform }}-JDK${{ matrix.jdk }}-reports for detailed test results" + build-test: + name: build-test + needs: generate-test-list + strategy: + fail-fast: false + matrix: + jdk: [11, 17] + platform: ["ubuntu-latest", "windows-latest"] + gradle_task: ${{ fromJson(needs.generate-test-list.outputs.separateTestsNames) }} + runs-on: ${{ matrix.platform }} + + steps: + - name: Set up JDK for build and test + uses: actions/setup-java@v2 + with: + distribution: temurin # Temurin is a distribution of adoptium + java-version: ${{ matrix.jdk }} + + - name: Checkout security + uses: actions/checkout@v2 + + - name: Build and Test + uses: gradle/gradle-build-action@v2 + with: + arguments: | + build ${{ matrix.gradle_task }} -Dbuild.snapshot=false + -x integrationTest + -x spotlessCheck + -x checkstyleMain + -x checkstyleTest + -x spotbugsMain + -x spotbugsIntegrationTest + -x checkstyleIntegrationTest + -x test + + - uses: actions/upload-artifact@v3 + if: always() + with: + name: ${{ matrix.platform }}-JDK${{ matrix.jdk }}-reports + path: | + ./build/reports/ + + - name: check archive for debugging + if: always() + run: echo "Check the artifact ${{ matrix.platform }}-JDK${{ matrix.jdk }}-reports for detailed test results" + integration-tests: name: integration-tests strategy: @@ -84,7 +154,6 @@ jobs: -x spotbugsMain backward-compatibility: - strategy: fail-fast: false matrix: diff --git a/build.gradle b/build.gradle index 08e20f81b2..995f78c180 100644 --- a/build.gradle +++ b/build.gradle @@ -12,6 +12,7 @@ import com.diffplug.gradle.spotless.JavaExtension import org.opensearch.gradle.test.RestIntegTestTask +import groovy.json.JsonBuilder buildscript { ext { @@ -105,12 +106,79 @@ tasks.whenTaskAdded {task -> } } +def splitTestConfig = [ + dlicDlsflsTest: [ + includeTestsMatching: [ + "org.opensearch.security.dlic.dlsfls.*" + ] + ], + dlicRestApiTest: [ + includeTestsMatching: [ + "org.opensearch.security.dlic.rest.*" + ] + ], + crossClusterTest: [ + includeTestsMatching: [ + "org.opensearch.security.ccstest.*" + ] + ], + sslTest: [ + includeTestsMatching: [ + "org.opensearch.security.ssl.*" + ] + ], + securityIntegrationTest: [ + includeTestsMatching: [ + "org.opensearch.security.*Integ*" + ], + excludeTestsMatching: [ + "org.opensearch.security.sanity.tests.*", + "org.opensearch.security.ssl.OpenSSL*", + ] + ], + indicesTest: [ + includeTestsMatching: [ + "org.opensearch.security.*indices*" + ], + excludeTestsMatching: [ + "org.opensearch.security.sanity.tests.*", + "org.opensearch.security.ssl.OpenSSL*", + ] + ] +] as ConfigObject + +List taskNames = splitTestConfig.keySet() as List + +task listTasksAsJSON { + doLast { + System.out.println(new JsonBuilder(taskNames)) + } +} + +task listTasksAsParam { + doLast { + System.out.println('-x ' + (taskNames).join(' -x ')) + } +} test { include '**/*.class' filter { excludeTestsMatching "org.opensearch.security.sanity.tests.*" excludeTestsMatching "org.opensearch.security.ssl.OpenSSL*" + splitTestConfig.each { entry -> + entry.value.each{ test -> + if (test.key == "includeTestsMatching") { + test.value.each{ + excludeTestsMatching "${it}" + } + } else if (test.key == "includeTest") { + test.value.each{ + excludeTest "${it}" + } + } + } + } } maxParallelForks = 8 jvmArgs += "-Xmx3072m" @@ -162,13 +230,50 @@ task opensslTest(type: Test) { } } +splitTestConfig.each{ testName, filterCfg -> + task "${testName}"(type: Test) { + include '**/*.class' + filter { + filterCfg.each{ filter, values -> + values.each{ value -> + "${filter}" "${value}" + } + } + } + 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 copyExtraTestResources(dependsOn: testClasses) { copy { from 'src/test/resources' into 'build/testrun/test/src/test/resources' } } -tasks.test.dependsOn(copyExtraTestResources, opensslTest) +tasks.test.dependsOn(copyExtraTestResources, opensslTest, taskNames) jacoco { reportsDirectory = file("$buildDir/reports/jacoco") From 25f464519a1fa788d9fd00ee6b12ea875abdfff1 Mon Sep 17 00:00:00 2001 From: Pawel Gudel Date: Wed, 14 Jun 2023 15:11:09 +0200 Subject: [PATCH 02/20] Applied :spotlessApply changes Signed-off-by: Pawel Gudel --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 995f78c180..7130a39e3d 100644 --- a/build.gradle +++ b/build.gradle @@ -169,7 +169,7 @@ test { splitTestConfig.each { entry -> entry.value.each{ test -> if (test.key == "includeTestsMatching") { - test.value.each{ + test.value.each{ excludeTestsMatching "${it}" } } else if (test.key == "includeTest") { From 0e1c9581dd8902ce5775f1e5f9827446bd1b6900 Mon Sep 17 00:00:00 2001 From: Pawel Gudel Date: Thu, 15 Jun 2023 14:31:22 +0200 Subject: [PATCH 03/20] Minor fixes after PR * Revised excludes for: `sslTest`, `securityIntegrationTest` and `indicesTest` * Removed `opensslTest`, all its test are in `sslTest` Signed-off-by: Pawel Gudel --- build.gradle | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/build.gradle b/build.gradle index 7130a39e3d..5f461683f5 100644 --- a/build.gradle +++ b/build.gradle @@ -132,8 +132,7 @@ def splitTestConfig = [ "org.opensearch.security.*Integ*" ], excludeTestsMatching: [ - "org.opensearch.security.sanity.tests.*", - "org.opensearch.security.ssl.OpenSSL*", + "org.opensearch.security.sanity.tests.*" ] ], indicesTest: [ @@ -141,8 +140,7 @@ def splitTestConfig = [ "org.opensearch.security.*indices*" ], excludeTestsMatching: [ - "org.opensearch.security.sanity.tests.*", - "org.opensearch.security.ssl.OpenSSL*", + "org.opensearch.security.sanity.tests.*" ] ] ] as ConfigObject @@ -206,30 +204,6 @@ test { } } -//add new task that runs OpenSSL tests -task opensslTest(type: Test) { - include '**/OpenSSL*.class' - 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.*" - ] - } -} - splitTestConfig.each{ testName, filterCfg -> task "${testName}"(type: Test) { include '**/*.class' @@ -273,7 +247,7 @@ task copyExtraTestResources(dependsOn: testClasses) { into 'build/testrun/test/src/test/resources' } } -tasks.test.dependsOn(copyExtraTestResources, opensslTest, taskNames) +tasks.test.dependsOn(copyExtraTestResources, taskNames) jacoco { reportsDirectory = file("$buildDir/reports/jacoco") From 38e7a376778c4dcc97f6742e3c6c1fa338e0f622 Mon Sep 17 00:00:00 2001 From: Pawel Gudel Date: Fri, 16 Jun 2023 14:46:53 +0200 Subject: [PATCH 04/20] 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 5f461683f5..8b63fd266a 100644 --- a/build.gradle +++ b/build.gradle @@ -163,7 +163,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") { @@ -247,7 +278,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") From 1f896f8a55b3c5595898156a57b71f7736335cff Mon Sep 17 00:00:00 2001 From: Pawel Gudel Date: Fri, 16 Jun 2023 17:01:55 +0200 Subject: [PATCH 05/20] Removed unneeded task dependencies; Fixed copyExtraTestResources task We've decided to remove dependency between `citest` and new, generated, test tasks. This is not needed for CI runs as they will be always started in separate Github Jobs. This is not significant change - it will only reduce complexity a bit. This also required to change order of tasks in build.gradle file. This commit also fixes issue with copyExtraTestResources task. It's paths were hardcoded which was fine for default test task but did not work for every other, newly created, tasks. We've also added dependencies between all new tasks and copyExtraTestResources Signed-off-by: Pawel Gudel --- .github/workflows/ci.yml | 4 +--- build.gradle | 29 ++++++++++++++++++++++------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b46e8f829..2c21cfc30e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,6 @@ jobs: id: set-matrix run: | echo "separateTestsNames=$(./gradlew listTasksAsJSON -q --console=plain | tail -n 1)" >> $GITHUB_OUTPUT - echo "testsNamesExclude=$(./gradlew listTasksAsParam -q --console=plain | tail -n 1)" >> $GITHUB_OUTPUT build: name: build @@ -51,7 +50,7 @@ jobs: uses: gradle/gradle-build-action@v2 with: arguments: | - build citest ${{ needs.generate-test-list.outputs.testsNamesExclude }} -Dbuild.snapshot=false + build citest -Dbuild.snapshot=false -x integrationTest -x spotlessCheck -x checkstyleMain @@ -111,7 +110,6 @@ 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 8b63fd266a..33c378ff71 100644 --- a/build.gradle +++ b/build.gradle @@ -190,6 +190,26 @@ test { } } +task copyExtraTestResources(dependsOn: testClasses) { + + copy { + from 'src/test/resources' + into 'build/testrun/test/src/test/resources' + } + + taskNames.each { testName -> + copy { + from 'src/test/resources' + into "build/testrun/${testName}/src/test/resources" + } + } + + copy { + from 'src/test/resources' + into 'build/testrun/citest/src/test/resources' + } +} + task citest(type: Test) { // onlyIf { !project.gradle.taskGraph.hasTask(':test') } include '**/*.class' @@ -233,6 +253,7 @@ task citest(type: Test) { "sun.util.resources.provider.*" ] } + dependsOn copyExtraTestResources } splitTestConfig.each{ testName, filterCfg -> @@ -269,17 +290,11 @@ splitTestConfig.each{ testName, filterCfg -> "sun.util.resources.provider.*" ] } + dependsOn copyExtraTestResources } } -task copyExtraTestResources(dependsOn: testClasses) { - copy { - from 'src/test/resources' - into 'build/testrun/test/src/test/resources' - } -} tasks.test.dependsOn(copyExtraTestResources) -tasks.citest.dependsOn(copyExtraTestResources, taskNames) jacoco { reportsDirectory = file("$buildDir/reports/jacoco") From 4db5e47a5a31ef8c05b6dfb93549c3a1d7fb8908 Mon Sep 17 00:00:00 2001 From: Pawel Gudel Date: Mon, 19 Jun 2023 15:58:02 +0200 Subject: [PATCH 06/20] Restored opensslTest Signed-off-by: Pawel Gudel --- build.gradle | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 33c378ff71..5ecd427bc4 100644 --- a/build.gradle +++ b/build.gradle @@ -163,6 +163,7 @@ test { include '**/*.class' filter { excludeTestsMatching "org.opensearch.security.sanity.tests.*" + excludeTestsMatching "org.opensearch.security.ssl.OpenSSL*" } maxParallelForks = 8 jvmArgs += "-Xmx3072m" @@ -190,6 +191,30 @@ test { } } +//add new task that runs OpenSSL tests +task opensslTest(type: Test) { + include '**/OpenSSL*.class' + 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 copyExtraTestResources(dependsOn: testClasses) { copy { @@ -294,7 +319,7 @@ splitTestConfig.each{ testName, filterCfg -> } } -tasks.test.dependsOn(copyExtraTestResources) +tasks.test.dependsOn(copyExtraTestResources, opensslTest) jacoco { reportsDirectory = file("$buildDir/reports/jacoco") From 156675d03e3fbbec57d018252645dc9bfdeec5ff Mon Sep 17 00:00:00 2001 From: Pawel Gudel Date: Tue, 20 Jun 2023 12:10:38 +0200 Subject: [PATCH 07/20] Add more options to splitTestConfig Right now it allows for more sophisticated configuration. Signed-off-by: Pawel Gudel --- build.gradle | 65 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/build.gradle b/build.gradle index 5ecd427bc4..05f7cc1151 100644 --- a/build.gradle +++ b/build.gradle @@ -108,39 +108,57 @@ tasks.whenTaskAdded {task -> def splitTestConfig = [ dlicDlsflsTest: [ - includeTestsMatching: [ - "org.opensearch.security.dlic.dlsfls.*" + description: "Runs Document- and Field-Level Security tests.", + filters: [ + includeTestsMatching: [ + "org.opensearch.security.dlic.dlsfls.*" + ] ] ], dlicRestApiTest: [ - includeTestsMatching: [ - "org.opensearch.security.dlic.rest.*" + description: "Runs REST Management API tests.", + filters: [ + includeTestsMatching: [ + "org.opensearch.security.dlic.rest.*" + ] ] ], crossClusterTest: [ - includeTestsMatching: [ - "org.opensearch.security.ccstest.*" + description: "Runs cross-cluster tests.", + filters: [ + includeTestsMatching: [ + "org.opensearch.security.ccstest.*" + ] ] ], sslTest: [ - includeTestsMatching: [ - "org.opensearch.security.ssl.*" + description: "Runs all SSL tests.", + filters: [ + includeTestsMatching: [ + "org.opensearch.security.ssl.*" + ] ] ], securityIntegrationTest: [ - includeTestsMatching: [ - "org.opensearch.security.*Integ*" - ], - excludeTestsMatching: [ - "org.opensearch.security.sanity.tests.*" + description: "Runs integration tests from all classes.", + filters: [ + includeTestsMatching: [ + "org.opensearch.security.*Integ*" + ], + excludeTestsMatching: [ + "org.opensearch.security.sanity.tests.*" + ] ] ], indicesTest: [ - includeTestsMatching: [ - "org.opensearch.security.*indices*" - ], - excludeTestsMatching: [ - "org.opensearch.security.sanity.tests.*" + description: "Runs indices tests from all classes.", + filters: [ + includeTestsMatching: [ + "org.opensearch.security.*indices*" + ], + excludeTestsMatching: [ + "org.opensearch.security.sanity.tests.*" + ] ] ] ] as ConfigObject @@ -236,7 +254,8 @@ task copyExtraTestResources(dependsOn: testClasses) { } task citest(type: Test) { -// onlyIf { !project.gradle.taskGraph.hasTask(':test') } + group = "Github Actions tests" + description = "Runs the test suite on classes not covered by rest of the task in this group." include '**/*.class' filter { excludeTestsMatching "org.opensearch.security.sanity.tests.*" @@ -281,11 +300,13 @@ task citest(type: Test) { dependsOn copyExtraTestResources } -splitTestConfig.each{ testName, filterCfg -> +splitTestConfig.each{ testName, testCfg -> task "${testName}"(type: Test) { - include '**/*.class' + group = testCfg.group ?: "Github Actions tests" + description = testCfg.description + include testCfg.include ?: '**/*.class' filter { - filterCfg.each{ filter, values -> + testCfg.filters.each{ filter, values -> values.each{ value -> "${filter}" "${value}" } From 5673984ae96c11c639d7c49eca31f6c7d2980c3c Mon Sep 17 00:00:00 2001 From: Pawel Gudel Date: Tue, 20 Jun 2023 21:59:51 +0200 Subject: [PATCH 08/20] Hopefully fix for Code Coverage issues. Signed-off-by: Pawel Gudel --- .github/workflows/ci.yml | 6 ++++++ build.gradle | 3 +++ 2 files changed, 9 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c21cfc30e..e8d8a09632 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -112,6 +112,12 @@ jobs: -x checkstyleIntegrationTest -x test + - name: Coverage + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./build/reports/jacoco/test/jacocoTestReport.xml + - uses: actions/upload-artifact@v3 if: always() with: diff --git a/build.gradle b/build.gradle index 05f7cc1151..257760f7ae 100644 --- a/build.gradle +++ b/build.gradle @@ -298,6 +298,7 @@ task citest(type: Test) { ] } dependsOn copyExtraTestResources + finalizedBy jacocoTestReport } splitTestConfig.each{ testName, testCfg -> @@ -337,6 +338,7 @@ splitTestConfig.each{ testName, testCfg -> ] } dependsOn copyExtraTestResources + finalizedBy jacocoTestReport } } @@ -347,6 +349,7 @@ jacoco { } jacocoTestReport { + getExecutionData().setFrom(fileTree(buildDir).include("/jacoco/*.exec")) reports { xml.required = true } From 33f8318c6d5d9ee58b39028d355f26750ec85417 Mon Sep 17 00:00:00 2001 From: Pawel Gudel Date: Tue, 20 Jun 2023 22:57:57 +0200 Subject: [PATCH 09/20] Restored split of SSL tests. Signed-off-by: Pawel Gudel --- build.gradle | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 257760f7ae..95609cfb49 100644 --- a/build.gradle +++ b/build.gradle @@ -132,13 +132,20 @@ def splitTestConfig = [ ] ], sslTest: [ - description: "Runs all SSL tests.", + description: "Runs most of the SSL tests.", filters: [ includeTestsMatching: [ "org.opensearch.security.ssl.*" + ], + excludeTestsMatching: [ + "org.opensearch.security.ssl.OpenSSL*" ] ] ], + opensslCiTest: [ + description: "Runs portion of SSL tests related to OpenSSL. Explained in https://github.com/opensearch-project/security/pull/2301", + include: '**/OpenSSL*.class' + ], securityIntegrationTest: [ description: "Runs integration tests from all classes.", filters: [ @@ -259,6 +266,7 @@ task citest(type: Test) { include '**/*.class' filter { excludeTestsMatching "org.opensearch.security.sanity.tests.*" + excludeTestsMatching "org.opensearch.security.ssl.OpenSSL*" splitTestConfig.each { entry -> entry.value.each{ test -> if (test.key == "includeTestsMatching") { From 3ebcfe66dd2256857b322f52460ce75b8750e491 Mon Sep 17 00:00:00 2001 From: Pawel Gudel Date: Fri, 23 Jun 2023 16:21:04 +0200 Subject: [PATCH 10/20] Exclude common citest configuration Copy from https://github.com/pawel-gudel-eliatra/security/pull/1 Signed-off-by: Pawel Gudel --- build.gradle | 83 ++++++++++++++++++++-------------------------------- 1 file changed, 31 insertions(+), 52 deletions(-) diff --git a/build.gradle b/build.gradle index 95609cfb49..0240d1a284 100644 --- a/build.gradle +++ b/build.gradle @@ -260,6 +260,35 @@ task copyExtraTestResources(dependsOn: testClasses) { } } +def setCommonTestConfig(Test task) { + task.maxParallelForks = 8 + task.jvmArgs += "-Xmx3072m" + if (JavaVersion.current() > JavaVersion.VERSION_1_8) { + task.jvmArgs += "--add-opens=java.base/java.io=ALL-UNNAMED" + } + task.retry { + failOnPassedAfterRetry = false + maxRetries = 5 + } + task.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.dependsOn copyExtraTestResources + task.finalizedBy jacocoTestReport +} + task citest(type: Test) { group = "Github Actions tests" description = "Runs the test suite on classes not covered by rest of the task in this group." @@ -281,32 +310,7 @@ task citest(type: Test) { } } } - 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.*" - ] - } - dependsOn copyExtraTestResources - finalizedBy jacocoTestReport + setCommonTestConfig(it) } splitTestConfig.each{ testName, testCfg -> @@ -321,32 +325,7 @@ splitTestConfig.each{ testName, testCfg -> } } } - 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.*" - ] - } - dependsOn copyExtraTestResources - finalizedBy jacocoTestReport + setCommonTestConfig(it) } } From 60f51c2fbb969aa2c0ce0dc475d2922f532047ee Mon Sep 17 00:00:00 2001 From: Pawel Gudel Date: Fri, 23 Jun 2023 23:23:27 +0200 Subject: [PATCH 11/20] Removed opensslTest again. Requested by Nils Signed-off-by: Pawel Gudel --- build.gradle | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/build.gradle b/build.gradle index 0240d1a284..b4b93f0bff 100644 --- a/build.gradle +++ b/build.gradle @@ -188,7 +188,6 @@ test { include '**/*.class' filter { excludeTestsMatching "org.opensearch.security.sanity.tests.*" - excludeTestsMatching "org.opensearch.security.ssl.OpenSSL*" } maxParallelForks = 8 jvmArgs += "-Xmx3072m" @@ -216,30 +215,6 @@ test { } } -//add new task that runs OpenSSL tests -task opensslTest(type: Test) { - include '**/OpenSSL*.class' - 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 copyExtraTestResources(dependsOn: testClasses) { copy { @@ -329,7 +304,7 @@ splitTestConfig.each{ testName, testCfg -> } } -tasks.test.dependsOn(copyExtraTestResources, opensslTest) +tasks.test.dependsOn(copyExtraTestResources) jacoco { reportsDirectory = file("$buildDir/reports/jacoco") From 9f99bcf07698f48142311edf3a73d1220b59e40d Mon Sep 17 00:00:00 2001 From: Pawel Gudel Date: Fri, 23 Jun 2023 23:36:24 +0200 Subject: [PATCH 12/20] Removed listTasksAsParam Signed-off-by: Pawel Gudel --- build.gradle | 6 ------ 1 file changed, 6 deletions(-) diff --git a/build.gradle b/build.gradle index b4b93f0bff..2f71fb3564 100644 --- a/build.gradle +++ b/build.gradle @@ -178,12 +178,6 @@ task listTasksAsJSON { } } -task listTasksAsParam { - doLast { - System.out.println('-x ' + (taskNames).join(' -x ')) - } -} - test { include '**/*.class' filter { From 73b6bb908e91dd3ef46a4f2d0cd12bd3afc9b5e3 Mon Sep 17 00:00:00 2001 From: Pawel Gudel Date: Fri, 23 Jun 2023 23:41:25 +0200 Subject: [PATCH 13/20] Changed listTasksAsJSON Signed-off-by: Pawel Gudel --- .github/workflows/ci.yml | 2 +- build.gradle | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8d8a09632..ea42a4dfc9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: - name: Generate list of tasks id: set-matrix run: | - echo "separateTestsNames=$(./gradlew listTasksAsJSON -q --console=plain | tail -n 1)" >> $GITHUB_OUTPUT + echo "separateTestsNames=$(./gradlew listTasksAsJSON -q --console=plain | head -n 1)" >> $GITHUB_OUTPUT build: name: build diff --git a/build.gradle b/build.gradle index 2f71fb3564..e0bd3e310d 100644 --- a/build.gradle +++ b/build.gradle @@ -173,9 +173,7 @@ def splitTestConfig = [ List taskNames = splitTestConfig.keySet() as List task listTasksAsJSON { - doLast { - System.out.println(new JsonBuilder(taskNames)) - } + System.out.println(new JsonBuilder(taskNames)) } test { From ae391e6364cb8228933be0535c49b06fd16b0eb3 Mon Sep 17 00:00:00 2001 From: Pawel Gudel Date: Fri, 23 Jun 2023 23:49:39 +0200 Subject: [PATCH 14/20] Restored listTasksAsJSON Signed-off-by: Pawel Gudel --- .github/workflows/ci.yml | 2 +- build.gradle | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea42a4dfc9..e8d8a09632 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: - name: Generate list of tasks id: set-matrix run: | - echo "separateTestsNames=$(./gradlew listTasksAsJSON -q --console=plain | head -n 1)" >> $GITHUB_OUTPUT + echo "separateTestsNames=$(./gradlew listTasksAsJSON -q --console=plain | tail -n 1)" >> $GITHUB_OUTPUT build: name: build diff --git a/build.gradle b/build.gradle index e0bd3e310d..2f71fb3564 100644 --- a/build.gradle +++ b/build.gradle @@ -173,7 +173,9 @@ def splitTestConfig = [ List taskNames = splitTestConfig.keySet() as List task listTasksAsJSON { - System.out.println(new JsonBuilder(taskNames)) + doLast { + System.out.println(new JsonBuilder(taskNames)) + } } test { From 77cf61686eecef0ff08b571fced9df668dc1f670 Mon Sep 17 00:00:00 2001 From: Pawel Gudel Date: Fri, 23 Jun 2023 23:59:28 +0200 Subject: [PATCH 15/20] Shorten number of excludes; Shorten ci.yml Signed-off-by: Pawel Gudel --- .github/workflows/ci.yml | 60 +--------------------------------------- build.gradle | 2 +- 2 files changed, 2 insertions(+), 60 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8d8a09632..ea11bf84c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,57 +29,6 @@ jobs: build: name: build needs: generate-test-list - strategy: - fail-fast: false - matrix: - jdk: [11, 17] - platform: ["ubuntu-latest", "windows-latest"] - runs-on: ${{ matrix.platform }} - - steps: - - name: Set up JDK for build and test - uses: actions/setup-java@v2 - with: - distribution: temurin # Temurin is a distribution of adoptium - java-version: ${{ matrix.jdk }} - - - name: Checkout security - uses: actions/checkout@v2 - - - name: Build and Test - uses: gradle/gradle-build-action@v2 - with: - arguments: | - build citest -Dbuild.snapshot=false - -x integrationTest - -x spotlessCheck - -x checkstyleMain - -x checkstyleTest - -x spotbugsMain - -x spotbugsIntegrationTest - -x checkstyleIntegrationTest - -x test - - - name: Coverage - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./build/reports/jacoco/test/jacocoTestReport.xml - - - uses: actions/upload-artifact@v3 - if: always() - with: - name: ${{ matrix.platform }}-JDK${{ matrix.jdk }}-reports - path: | - ./build/reports/ - - - name: check archive for debugging - if: always() - run: echo "Check the artifact ${{ matrix.platform }}-JDK${{ matrix.jdk }}-reports for detailed test results" - - build-test: - name: build-test - needs: generate-test-list strategy: fail-fast: false matrix: @@ -102,14 +51,7 @@ jobs: uses: gradle/gradle-build-action@v2 with: arguments: | - build ${{ matrix.gradle_task }} -Dbuild.snapshot=false - -x integrationTest - -x spotlessCheck - -x checkstyleMain - -x checkstyleTest - -x spotbugsMain - -x spotbugsIntegrationTest - -x checkstyleIntegrationTest + ${{ matrix.gradle_task }} -Dbuild.snapshot=false -x test - name: Coverage diff --git a/build.gradle b/build.gradle index 2f71fb3564..7feb00803f 100644 --- a/build.gradle +++ b/build.gradle @@ -174,7 +174,7 @@ List taskNames = splitTestConfig.keySet() as List task listTasksAsJSON { doLast { - System.out.println(new JsonBuilder(taskNames)) + System.out.println(new JsonBuilder(["citest"] + taskNames)) } } From d5085bc939ccf7fb2bf845d65ac97b28867efbd0 Mon Sep 17 00:00:00 2001 From: Pawel Gudel Date: Tue, 27 Jun 2023 23:45:16 +0200 Subject: [PATCH 16/20] Restored split build tasks Unfortunately running them from one list lenghtens time a lot Signed-off-by: Pawel Gudel --- .github/workflows/ci.yml | 43 ++++++++++++++++++++++++++++++++++++++++ build.gradle | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea11bf84c1..8b29711746 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,49 @@ jobs: run: | echo "separateTestsNames=$(./gradlew listTasksAsJSON -q --console=plain | tail -n 1)" >> $GITHUB_OUTPUT + test: + name: citest + strategy: + fail-fast: false + matrix: + jdk: [11, 17] + platform: ["ubuntu-latest", "windows-latest"] + runs-on: ${{ matrix.platform }} + + steps: + - name: Set up JDK for build and test + uses: actions/setup-java@v2 + with: + distribution: temurin + java-version: ${{ matrix.jdk }} + + - name: Checkout security + uses: actions/checkout@v2 + + - name: Build and Test + uses: gradle/gradle-build-action@v2 + with: + arguments: | + citest -Dbuild.snapshot=false + -x test + + - name: Coverage + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./build/reports/jacoco/test/jacocoTestReport.xml + + - uses: actions/upload-artifact@v3 + if: always() + with: + name: ${{ matrix.platform }}-JDK${{ matrix.jdk }}-reports + path: | + ./build/reports/ + + - name: check archive for debugging + if: always() + run: echo "Check the artifact ${{ matrix.platform }}-JDK${{ matrix.jdk }}-reports for detailed test results" + build: name: build needs: generate-test-list diff --git a/build.gradle b/build.gradle index 7feb00803f..2f71fb3564 100644 --- a/build.gradle +++ b/build.gradle @@ -174,7 +174,7 @@ List taskNames = splitTestConfig.keySet() as List task listTasksAsJSON { doLast { - System.out.println(new JsonBuilder(["citest"] + taskNames)) + System.out.println(new JsonBuilder(taskNames)) } } From 57b483eb2e4aa5614d6cd3c083f3df04986b2b32 Mon Sep 17 00:00:00 2001 From: Pawel Gudel Date: Tue, 27 Jun 2023 23:49:49 +0200 Subject: [PATCH 17/20] Added short explanation Signed-off-by: Pawel Gudel --- build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.gradle b/build.gradle index 2f71fb3564..e75cca75e2 100644 --- a/build.gradle +++ b/build.gradle @@ -173,6 +173,9 @@ def splitTestConfig = [ List taskNames = splitTestConfig.keySet() as List task listTasksAsJSON { + // We are using `doLast` to explicitly specify when we + // want this action to be started. Without it the output + // is not shown at all or can be mixed with other outputs. doLast { System.out.println(new JsonBuilder(taskNames)) } From 1dc9f57d50f1c4e48d7f7e359813eedcb38e72fd Mon Sep 17 00:00:00 2001 From: Pawel Gudel Date: Wed, 28 Jun 2023 00:02:23 +0200 Subject: [PATCH 18/20] Reorder matrix strategy. Is it possible to run windows jobs before ubuntu? Signed-off-by: Pawel Gudel --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b29711746..b42442c94d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,13 +26,13 @@ jobs: run: | echo "separateTestsNames=$(./gradlew listTasksAsJSON -q --console=plain | tail -n 1)" >> $GITHUB_OUTPUT - test: - name: citest + tests: + name: tests strategy: fail-fast: false matrix: + platform: ["windows-latest", "ubuntu-latest"] jdk: [11, 17] - platform: ["ubuntu-latest", "windows-latest"] runs-on: ${{ matrix.platform }} steps: @@ -69,14 +69,14 @@ jobs: if: always() run: echo "Check the artifact ${{ matrix.platform }}-JDK${{ matrix.jdk }}-reports for detailed test results" - build: - name: build + test: + name: test needs: generate-test-list strategy: fail-fast: false matrix: + platform: ["windows-latest", "ubuntu-latest"] jdk: [11, 17] - platform: ["ubuntu-latest", "windows-latest"] gradle_task: ${{ fromJson(needs.generate-test-list.outputs.separateTestsNames) }} runs-on: ${{ matrix.platform }} From ebae0eb86a8feaaf7caf9ab7f2c15db88e53ffea Mon Sep 17 00:00:00 2001 From: Pawel Gudel Date: Wed, 28 Jun 2023 00:46:47 +0200 Subject: [PATCH 19/20] Minor optimizations and fixes. * Fix for not excluded tests. * Reordered matrix strategy variables. * Restored unified list of Gradle task.. again! Signed-off-by: Pawel Gudel --- .github/workflows/ci.yml | 52 +++---------------------------------- build.gradle | 56 ++++++++++++++++++++-------------------- 2 files changed, 32 insertions(+), 76 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b42442c94d..594b08c0c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,6 @@ jobs: runs-on: ubuntu-latest outputs: separateTestsNames: ${{ steps.set-matrix.outputs.separateTestsNames }} - testsNamesExclude: ${{ steps.set-matrix.outputs.testsNamesExclude }} steps: - name: Set up JDK for build and test uses: actions/setup-java@v2 @@ -26,58 +25,15 @@ jobs: run: | echo "separateTestsNames=$(./gradlew listTasksAsJSON -q --console=plain | tail -n 1)" >> $GITHUB_OUTPUT - tests: - name: tests - strategy: - fail-fast: false - matrix: - platform: ["windows-latest", "ubuntu-latest"] - jdk: [11, 17] - runs-on: ${{ matrix.platform }} - - steps: - - name: Set up JDK for build and test - uses: actions/setup-java@v2 - with: - distribution: temurin - java-version: ${{ matrix.jdk }} - - - name: Checkout security - uses: actions/checkout@v2 - - - name: Build and Test - uses: gradle/gradle-build-action@v2 - with: - arguments: | - citest -Dbuild.snapshot=false - -x test - - - name: Coverage - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./build/reports/jacoco/test/jacocoTestReport.xml - - - uses: actions/upload-artifact@v3 - if: always() - with: - name: ${{ matrix.platform }}-JDK${{ matrix.jdk }}-reports - path: | - ./build/reports/ - - - name: check archive for debugging - if: always() - run: echo "Check the artifact ${{ matrix.platform }}-JDK${{ matrix.jdk }}-reports for detailed test results" - test: name: test needs: generate-test-list strategy: fail-fast: false matrix: - platform: ["windows-latest", "ubuntu-latest"] - jdk: [11, 17] gradle_task: ${{ fromJson(needs.generate-test-list.outputs.separateTestsNames) }} + platform: [windows-latest, ubuntu-latest] + jdk: [11, 17] runs-on: ${{ matrix.platform }} steps: @@ -120,7 +76,7 @@ jobs: fail-fast: false matrix: jdk: [17] - platform: ["ubuntu-latest", "windows-latest"] + platform: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.platform }} steps: @@ -149,7 +105,7 @@ jobs: fail-fast: false matrix: jdk: [11, 17] - platform: ["ubuntu-latest", "windows-latest"] + platform: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.platform }} steps: diff --git a/build.gradle b/build.gradle index e75cca75e2..18fa47fab8 100644 --- a/build.gradle +++ b/build.gradle @@ -107,64 +107,64 @@ tasks.whenTaskAdded {task -> } def splitTestConfig = [ - dlicDlsflsTest: [ - description: "Runs Document- and Field-Level Security tests.", + ciSecurityIntegrationTest: [ + description: "Runs integration tests from all classes.", filters: [ includeTestsMatching: [ - "org.opensearch.security.dlic.dlsfls.*" + "org.opensearch.security.*Integ*" + ], + excludeTestsMatching: [ + "org.opensearch.security.sanity.tests.*" ] ] ], - dlicRestApiTest: [ - description: "Runs REST Management API tests.", + crossClusterTest: [ + description: "Runs cross-cluster tests.", filters: [ includeTestsMatching: [ - "org.opensearch.security.dlic.rest.*" + "org.opensearch.security.ccstest.*" ] ] ], - crossClusterTest: [ - description: "Runs cross-cluster tests.", + dlicDlsflsTest: [ + description: "Runs Document- and Field-Level Security tests.", filters: [ includeTestsMatching: [ - "org.opensearch.security.ccstest.*" + "org.opensearch.security.dlic.dlsfls.*" ] ] ], - sslTest: [ - description: "Runs most of the SSL tests.", + dlicRestApiTest: [ + description: "Runs REST Management API tests.", filters: [ includeTestsMatching: [ - "org.opensearch.security.ssl.*" - ], - excludeTestsMatching: [ - "org.opensearch.security.ssl.OpenSSL*" + "org.opensearch.security.dlic.rest.*" ] ] ], - opensslCiTest: [ - description: "Runs portion of SSL tests related to OpenSSL. Explained in https://github.com/opensearch-project/security/pull/2301", - include: '**/OpenSSL*.class' - ], - securityIntegrationTest: [ - description: "Runs integration tests from all classes.", + indicesTest: [ + description: "Runs indices tests from all classes.", filters: [ includeTestsMatching: [ - "org.opensearch.security.*Integ*" + "org.opensearch.security.*indices*" ], excludeTestsMatching: [ "org.opensearch.security.sanity.tests.*" ] ] ], - indicesTest: [ - description: "Runs indices tests from all classes.", + opensslCITest: [ + description: "Runs portion of SSL tests related to OpenSSL. Explained in https://github.com/opensearch-project/security/pull/2301", + include: '**/OpenSSL*.class' + ], + sslTest: [ + description: "Runs most of the SSL tests.", filters: [ includeTestsMatching: [ - "org.opensearch.security.*indices*" + "org.opensearch.security.ssl.*" ], excludeTestsMatching: [ - "org.opensearch.security.sanity.tests.*" + "org.opensearch.security.ssl.OpenSSL*" ] ] ] @@ -177,7 +177,7 @@ task listTasksAsJSON { // want this action to be started. Without it the output // is not shown at all or can be mixed with other outputs. doLast { - System.out.println(new JsonBuilder(taskNames)) + System.out.println(new JsonBuilder(["citest"] + taskNames)) } } @@ -269,7 +269,7 @@ task citest(type: Test) { excludeTestsMatching "org.opensearch.security.sanity.tests.*" excludeTestsMatching "org.opensearch.security.ssl.OpenSSL*" splitTestConfig.each { entry -> - entry.value.each{ test -> + entry.value.filters.each{ test -> if (test.key == "includeTestsMatching") { test.value.each{ excludeTestsMatching "${it}" From e48b74e547954e9ff40190daf53a71e0064c9773 Mon Sep 17 00:00:00 2001 From: Pawel Gudel Date: Wed, 28 Jun 2023 11:31:24 +0200 Subject: [PATCH 20/20] Removed unnecessary args from intergrationTest GHA job Signed-off-by: Pawel Gudel --- .github/workflows/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 594b08c0c2..0a6cd5b141 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,10 +95,6 @@ jobs: with: arguments: | integrationTest -Dbuild.snapshot=false - -x spotlessCheck - -x checkstyleMain - -x checkstyleTest - -x spotbugsMain backward-compatibility: strategy: