Skip to content

Commit e83d828

Browse files
Run the UI tests as groups to prevent timeout error. (#1456)
* test breakdown * clearer names * Update build.yaml * Update run.sh Update run.sh
1 parent d7ada7e commit e83d828

File tree

2 files changed

+50
-8
lines changed

2 files changed

+50
-8
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, Maven-MicroProfile, Gradle-MicroProfile, Maven-Custom-Liberty-Install, Gradle-Custom-Liberty-Install, Maven-MP-Config, Gradle-MP-Config, Maven-MP-SID, Gradle-MP-SID, Maven-NLT-REST, Gradle-NLT-REST, Gradle-Language-Server, Gradle-MP-Language-Server, Gradle-Jakarta-Language-Server, Maven-Multi-Module-MP ]
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: Maven-MicroProfile
116+
test-class: io.openliberty.tools.intellij.it.MavenSingleModMPProjectTest
117+
- test-group: Gradle-MicroProfile
118+
test-class: io.openliberty.tools.intellij.it.GradleSingleModMPProjectTest
119+
- test-group: Maven-Custom-Liberty-Install
120+
test-class: io.openliberty.tools.intellij.it.MavenSingleModCustomWLPInstallProjectTest
121+
- test-group: Gradle-Custom-Liberty-Install
122+
test-class: io.openliberty.tools.intellij.it.GradleSingleModCustomWLPInstallProjectTest
123+
- test-group: Maven-MP-Config
124+
test-class: io.openliberty.tools.intellij.it.MavenSingleModMPCfgProjectTest
125+
- test-group: Gradle-MP-Config
126+
test-class: io.openliberty.tools.intellij.it.GradleSingleModMPCfgProjectTest
127+
- test-group: Maven-MP-SID
128+
test-class: io.openliberty.tools.intellij.it.MavenSingleModMPSIDProjectTest
129+
- test-group: Gradle-MP-SID
130+
test-class: io.openliberty.tools.intellij.it.GradleSingleModMPSIDProjectTest
131+
- test-group: Maven-NLT-REST
132+
test-class: io.openliberty.tools.intellij.it.MavenSingleModNLTRestProjectTest
133+
- test-group: Gradle-NLT-REST
134+
test-class: io.openliberty.tools.intellij.it.GradleSingleModNLTRestProjectTest
135+
- test-group: Gradle-Language-Server
136+
test-class: io.openliberty.tools.intellij.it.GradleSingleModLSTest
137+
- test-group: Gradle-MP-Language-Server
138+
test-class: io.openliberty.tools.intellij.it.GradleSingleModMPLSTest
139+
- test-group: Gradle-Jakarta-Language-Server
140+
test-class: io.openliberty.tools.intellij.it.GradleSingleModJakartaLSTest
141+
- test-group: Maven-Multi-Module-MP
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: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,15 @@ main() {
240240
for restartCount in {1..5}; do
241241
startIDE
242242
# Run the tests
243-
echo -e "\n$(${currentTime[@]}): INFO: Running tests..."
244243
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"
244+
if [ -n "$TEST_CLASS" ]; then
245+
echo -e "\n$(${currentTime[@]}): INFO: Running specific test class: $TEST_CLASS"
246+
test_args=(--tests "$TEST_CLASS")
247+
else
248+
echo -e "\n$(${currentTime[@]}): INFO: Running all tests..."
249+
test_args=()
250+
fi
251+
./gradlew test "${test_args[@]}" -PuseLocal="$USE_LOCAL_PLUGIN" | tee "$JUNIT_OUTPUT_TXT"
246252
testRC=$? # gradlew test only returns 0 or 1, not the return code from JUnit
247253
set +o pipefail # reset this option
248254
grep -i "SocketTimeoutException" "$JUNIT_OUTPUT_TXT" && testRC=23

0 commit comments

Comments
 (0)