Skip to content

Commit ebae0eb

Browse files
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 <pawel.gudel@eliatra.com>
1 parent 1dc9f57 commit ebae0eb

File tree

2 files changed

+32
-76
lines changed

2 files changed

+32
-76
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ jobs:
1010
runs-on: ubuntu-latest
1111
outputs:
1212
separateTestsNames: ${{ steps.set-matrix.outputs.separateTestsNames }}
13-
testsNamesExclude: ${{ steps.set-matrix.outputs.testsNamesExclude }}
1413
steps:
1514
- name: Set up JDK for build and test
1615
uses: actions/setup-java@v2
@@ -26,58 +25,15 @@ jobs:
2625
run: |
2726
echo "separateTestsNames=$(./gradlew listTasksAsJSON -q --console=plain | tail -n 1)" >> $GITHUB_OUTPUT
2827
29-
tests:
30-
name: tests
31-
strategy:
32-
fail-fast: false
33-
matrix:
34-
platform: ["windows-latest", "ubuntu-latest"]
35-
jdk: [11, 17]
36-
runs-on: ${{ matrix.platform }}
37-
38-
steps:
39-
- name: Set up JDK for build and test
40-
uses: actions/setup-java@v2
41-
with:
42-
distribution: temurin
43-
java-version: ${{ matrix.jdk }}
44-
45-
- name: Checkout security
46-
uses: actions/checkout@v2
47-
48-
- name: Build and Test
49-
uses: gradle/gradle-build-action@v2
50-
with:
51-
arguments: |
52-
citest -Dbuild.snapshot=false
53-
-x test
54-
55-
- name: Coverage
56-
uses: codecov/codecov-action@v1
57-
with:
58-
token: ${{ secrets.CODECOV_TOKEN }}
59-
files: ./build/reports/jacoco/test/jacocoTestReport.xml
60-
61-
- uses: actions/upload-artifact@v3
62-
if: always()
63-
with:
64-
name: ${{ matrix.platform }}-JDK${{ matrix.jdk }}-reports
65-
path: |
66-
./build/reports/
67-
68-
- name: check archive for debugging
69-
if: always()
70-
run: echo "Check the artifact ${{ matrix.platform }}-JDK${{ matrix.jdk }}-reports for detailed test results"
71-
7228
test:
7329
name: test
7430
needs: generate-test-list
7531
strategy:
7632
fail-fast: false
7733
matrix:
78-
platform: ["windows-latest", "ubuntu-latest"]
79-
jdk: [11, 17]
8034
gradle_task: ${{ fromJson(needs.generate-test-list.outputs.separateTestsNames) }}
35+
platform: [windows-latest, ubuntu-latest]
36+
jdk: [11, 17]
8137
runs-on: ${{ matrix.platform }}
8238

8339
steps:
@@ -120,7 +76,7 @@ jobs:
12076
fail-fast: false
12177
matrix:
12278
jdk: [17]
123-
platform: ["ubuntu-latest", "windows-latest"]
79+
platform: [ubuntu-latest, windows-latest]
12480
runs-on: ${{ matrix.platform }}
12581

12682
steps:
@@ -149,7 +105,7 @@ jobs:
149105
fail-fast: false
150106
matrix:
151107
jdk: [11, 17]
152-
platform: ["ubuntu-latest", "windows-latest"]
108+
platform: [ubuntu-latest, windows-latest]
153109
runs-on: ${{ matrix.platform }}
154110

155111
steps:

build.gradle

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -107,64 +107,64 @@ tasks.whenTaskAdded {task ->
107107
}
108108

109109
def splitTestConfig = [
110-
dlicDlsflsTest: [
111-
description: "Runs Document- and Field-Level Security tests.",
110+
ciSecurityIntegrationTest: [
111+
description: "Runs integration tests from all classes.",
112112
filters: [
113113
includeTestsMatching: [
114-
"org.opensearch.security.dlic.dlsfls.*"
114+
"org.opensearch.security.*Integ*"
115+
],
116+
excludeTestsMatching: [
117+
"org.opensearch.security.sanity.tests.*"
115118
]
116119
]
117120
],
118-
dlicRestApiTest: [
119-
description: "Runs REST Management API tests.",
121+
crossClusterTest: [
122+
description: "Runs cross-cluster tests.",
120123
filters: [
121124
includeTestsMatching: [
122-
"org.opensearch.security.dlic.rest.*"
125+
"org.opensearch.security.ccstest.*"
123126
]
124127
]
125128
],
126-
crossClusterTest: [
127-
description: "Runs cross-cluster tests.",
129+
dlicDlsflsTest: [
130+
description: "Runs Document- and Field-Level Security tests.",
128131
filters: [
129132
includeTestsMatching: [
130-
"org.opensearch.security.ccstest.*"
133+
"org.opensearch.security.dlic.dlsfls.*"
131134
]
132135
]
133136
],
134-
sslTest: [
135-
description: "Runs most of the SSL tests.",
137+
dlicRestApiTest: [
138+
description: "Runs REST Management API tests.",
136139
filters: [
137140
includeTestsMatching: [
138-
"org.opensearch.security.ssl.*"
139-
],
140-
excludeTestsMatching: [
141-
"org.opensearch.security.ssl.OpenSSL*"
141+
"org.opensearch.security.dlic.rest.*"
142142
]
143143
]
144144
],
145-
opensslCiTest: [
146-
description: "Runs portion of SSL tests related to OpenSSL. Explained in https://github.com/opensearch-project/security/pull/2301",
147-
include: '**/OpenSSL*.class'
148-
],
149-
securityIntegrationTest: [
150-
description: "Runs integration tests from all classes.",
145+
indicesTest: [
146+
description: "Runs indices tests from all classes.",
151147
filters: [
152148
includeTestsMatching: [
153-
"org.opensearch.security.*Integ*"
149+
"org.opensearch.security.*indices*"
154150
],
155151
excludeTestsMatching: [
156152
"org.opensearch.security.sanity.tests.*"
157153
]
158154
]
159155
],
160-
indicesTest: [
161-
description: "Runs indices tests from all classes.",
156+
opensslCITest: [
157+
description: "Runs portion of SSL tests related to OpenSSL. Explained in https://github.com/opensearch-project/security/pull/2301",
158+
include: '**/OpenSSL*.class'
159+
],
160+
sslTest: [
161+
description: "Runs most of the SSL tests.",
162162
filters: [
163163
includeTestsMatching: [
164-
"org.opensearch.security.*indices*"
164+
"org.opensearch.security.ssl.*"
165165
],
166166
excludeTestsMatching: [
167-
"org.opensearch.security.sanity.tests.*"
167+
"org.opensearch.security.ssl.OpenSSL*"
168168
]
169169
]
170170
]
@@ -177,7 +177,7 @@ task listTasksAsJSON {
177177
// want this action to be started. Without it the output
178178
// is not shown at all or can be mixed with other outputs.
179179
doLast {
180-
System.out.println(new JsonBuilder(taskNames))
180+
System.out.println(new JsonBuilder(["citest"] + taskNames))
181181
}
182182
}
183183

@@ -269,7 +269,7 @@ task citest(type: Test) {
269269
excludeTestsMatching "org.opensearch.security.sanity.tests.*"
270270
excludeTestsMatching "org.opensearch.security.ssl.OpenSSL*"
271271
splitTestConfig.each { entry ->
272-
entry.value.each{ test ->
272+
entry.value.filters.each{ test ->
273273
if (test.key == "includeTestsMatching") {
274274
test.value.each{
275275
excludeTestsMatching "${it}"

0 commit comments

Comments
 (0)