Skip to content

Commit

Permalink
Restored default 'test' task
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
pawel-gudel-eliatra committed Jun 16, 2023
1 parent 0e1c958 commit 38e7a37
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,15 @@ 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
-x checkstyleTest
-x spotbugsMain
-x spotbugsIntegrationTest
-x checkstyleIntegrationTest
-x test
- name: Coverage
uses: codecov/codecov-action@v1
Expand Down Expand Up @@ -110,6 +111,7 @@ jobs:
-x spotbugsMain
-x spotbugsIntegrationTest
-x checkstyleIntegrationTest
-x citest
-x test
- uses: actions/upload-artifact@v3
Expand Down
36 changes: 34 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 38e7a37

Please sign in to comment.