Skip to content

Commit c386ca1

Browse files
test breakdown
1 parent 8242d98 commit c386ca1

File tree

2 files changed

+53
-10
lines changed

2 files changed

+53
-10
lines changed

.github/workflows/build.yaml

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,25 +93,61 @@ jobs:
9393
build:
9494
needs: fetch_merge_commit_sha_from_lsp4ij_PR
9595
runs-on: ${{ matrix.os }}
96+
name: ${{ matrix.runtime }} - ${{ matrix.test-group }}
9697
strategy:
9798
fail-fast: false
9899
matrix:
99100
runtime: [ linux, mac, windows ]
101+
test-group: [ LSP4Jakarta-Unit, MavenSingleModMP, GradleSingleModMP, MavenSingleModCustomWLP, GradleSingleModCustomWLP, MavenSingleModMPCfg, GradleSingleModMPCfg, MavenSingleModMPSID, GradleSingleModMPSID, MavenSingleModNLTRest, GradleSingleModNLTRest, GradleSingleModLS, GradleSingleModMPLS, GradleSingleModJakartaLS, MavenMPMultipleProject ]
102+
exclude:
103+
# Exclude LSP4Jakarta-Unit from mac and windows - only run on linux
104+
- runtime: mac
105+
test-group: LSP4Jakarta-Unit
106+
- runtime: windows
107+
test-group: LSP4Jakarta-Unit
100108
include:
101109
- runtime: linux
102110
os: ubuntu-latest
103-
reportName: linux-test-report
104111
- runtime: mac
105112
os: macOS-14
106-
reportName: mac-test-report
107113
- runtime: windows
108114
os: windows-latest
109-
reportName: windows-test-report
115+
- test-group: MavenSingleModMP
116+
test-class: io.openliberty.tools.intellij.it.MavenSingleModMPProjectTest
117+
- test-group: GradleSingleModMP
118+
test-class: io.openliberty.tools.intellij.it.GradleSingleModMPProjectTest
119+
- test-group: MavenSingleModCustomWLP
120+
test-class: io.openliberty.tools.intellij.it.MavenSingleModCustomWLPInstallProjectTest
121+
- test-group: GradleSingleModCustomWLP
122+
test-class: io.openliberty.tools.intellij.it.GradleSingleModCustomWLPInstallProjectTest
123+
- test-group: MavenSingleModMPCfg
124+
test-class: io.openliberty.tools.intellij.it.MavenSingleModMPCfgProjectTest
125+
- test-group: GradleSingleModMPCfg
126+
test-class: io.openliberty.tools.intellij.it.GradleSingleModMPCfgProjectTest
127+
- test-group: MavenSingleModMPSID
128+
test-class: io.openliberty.tools.intellij.it.MavenSingleModMPSIDProjectTest
129+
- test-group: GradleSingleModMPSID
130+
test-class: io.openliberty.tools.intellij.it.GradleSingleModMPSIDProjectTest
131+
- test-group: MavenSingleModNLTRest
132+
test-class: io.openliberty.tools.intellij.it.MavenSingleModNLTRestProjectTest
133+
- test-group: GradleSingleModNLTRest
134+
test-class: io.openliberty.tools.intellij.it.GradleSingleModNLTRestProjectTest
135+
- test-group: GradleSingleModLS
136+
test-class: io.openliberty.tools.intellij.it.GradleSingleModLSTest
137+
- test-group: GradleSingleModMPLS
138+
test-class: io.openliberty.tools.intellij.it.GradleSingleModMPLSTest
139+
- test-group: GradleSingleModJakartaLS
140+
test-class: io.openliberty.tools.intellij.it.GradleSingleModJakartaLSTest
141+
- test-group: MavenMPMultipleProject
142+
test-class: io.openliberty.tools.intellij.it.MavenMPMultipleProjectTest
143+
- test-group: LSP4Jakarta-Unit
144+
test-class: "io.openliberty.tools.intellij.lsp4jakarta.it.*"
110145
env:
111146
USE_LOCAL_PLUGIN: ${{ inputs.useLocalPlugin || false }}
112147
REF_LSP4IJ: ${{ needs.fetch_merge_commit_sha_from_lsp4ij_PR.outputs.pr_details }}
113148
LSP4IJ_BRANCH: ${{ needs.fetch_merge_commit_sha_from_lsp4ij_PR.outputs.checkout_name }}
114149
REF_LTI_TAG: ${{ inputs.refLTITag }}
150+
TEST_CLASS: ${{ matrix.test-class }}
115151
steps:
116152
- name: Configure pagefile
117153
if: contains(matrix.os, 'windows')
@@ -152,7 +188,7 @@ jobs:
152188
working-directory: ./liberty-tools-intellij
153189
run: bash ./gradlew buildPlugin -PuseLocal=${{ env.USE_LOCAL_PLUGIN }}
154190
- name: 'Archive artifacts'
155-
if: ${{ runner.os == 'Linux' && !failure() }}
191+
if: ${{ runner.os == 'Linux' && matrix.test-group == 'LSP4Jakarta-Unit' && !failure() }}
156192
uses: actions/[email protected]
157193
with:
158194
name: liberty-tools-intellij-LTI-${{ env.REF_LTI_TAG || 'default' }}-LSP4IJ-${{ env.LSP4IJ_BRANCH || 'default' }}
@@ -161,14 +197,14 @@ jobs:
161197
./**/libs/*liberty-tools-intellij*.jar
162198
if-no-files-found: warn
163199
retention-days: 7
164-
- name: 'Run UI integration tests'
200+
- name: 'Run tests'
165201
id: run_tests
166202
working-directory: ./liberty-tools-intellij
167203
run: bash ./src/test/resources/ci/scripts/run.sh
168204
- name: 'Archive Test logs and reports'
169205
if: ${{ failure() && steps.run_tests.conclusion == 'failure' }}
170206
uses: actions/[email protected]
171207
with:
172-
name: ${{ matrix.reportName }}-LTI-${{ env.REF_LTI_TAG || 'default' }}-LSP4IJ-${{ env.LSP4IJ_BRANCH || 'default' }}
208+
name: ${{ matrix.runtime }}-${{ matrix.test-group }}-test-report-LTI-${{ env.REF_LTI_TAG || 'default' }}-LSP4IJ-${{ env.LSP4IJ_BRANCH || 'default' }}
173209
path: |
174210
liberty-tools-intellij/build/reports/

src/test/resources/ci/scripts/run.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,17 @@ main() {
240240
for restartCount in {1..5}; do
241241
startIDE
242242
# Run the tests
243-
echo -e "\n$(${currentTime[@]}): INFO: Running tests..."
244-
set -o pipefail # using tee requires we use this setting to gather the rc of gradlew
245-
./gradlew test -PuseLocal=$USE_LOCAL_PLUGIN | tee "$JUNIT_OUTPUT_TXT"
246-
testRC=$? # gradlew test only returns 0 or 1, not the return code from JUnit
243+
if [ -n "$TEST_CLASS" ]; then
244+
echo -e "\n$(${currentTime[@]}): INFO: Running specific test class: $TEST_CLASS"
245+
set -o pipefail # using tee requires we use this setting to gather the rc of gradlew
246+
./gradlew test --tests "$TEST_CLASS" -PuseLocal=$USE_LOCAL_PLUGIN | tee "$JUNIT_OUTPUT_TXT"
247+
testRC=$? # gradlew test only returns 0 or 1, not the return code from JUnit
248+
else
249+
echo -e "\n$(${currentTime[@]}): INFO: Running all tests..."
250+
set -o pipefail # using tee requires we use this setting to gather the rc of gradlew
251+
./gradlew test -PuseLocal=$USE_LOCAL_PLUGIN | tee "$JUNIT_OUTPUT_TXT"
252+
testRC=$? # gradlew test only returns 0 or 1, not the return code from JUnit
253+
fi
247254
set +o pipefail # reset this option
248255
grep -i "SocketTimeoutException" "$JUNIT_OUTPUT_TXT" && testRC=23
249256
if [ "$testRC" -eq 23 ]; then

0 commit comments

Comments
 (0)