Skip to content

Commit 48b9781

Browse files
committed
fix the headless run during integration test
1 parent 4967161 commit 48b9781

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,42 +46,48 @@ jobs:
4646

4747
- name: Run Qt5 application and C test
4848
run: |
49-
./build_qt5/qCommTest -p 6666 &
49+
QT_QPA_PLATFORM=offscreen ./build_qt5/qCommTest -p 6666 &
5050
sleep 2 # Give the server time to start
5151
./test/test_tcp
52+
killall qCommTest || true # Kill the application, '|| true' to prevent failure if not found
5253
working-directory: ${{ github.workspace }}
5354

5455
- name: Run Qt5 application and C++ test
5556
run: |
56-
./build_qt5/qCommTest -p 6666 &
57+
QT_QPA_PLATFORM=offscreen ./build_qt5/qCommTest -p 6666 &
5758
sleep 2 # Give the server time to start
5859
./test/test_tcp_cpp
60+
killall qCommTest || true
5961
working-directory: ${{ github.workspace }}
6062

6163
- name: Run Qt5 application and Python test
6264
run: |
63-
./build_qt5/qCommTest -p 6666 &
65+
QT_QPA_PLATFORM=offscreen ./build_qt5/qCommTest -p 6666 &
6466
sleep 2 # Give the server time to start
6567
python3 test/test_tcp.py
68+
killall qCommTest || true
6669
working-directory: ${{ github.workspace }}
6770

6871
- name: Run Qt6 application and C test
6972
run: |
70-
./build_qt6/qCommTest -p 6666 &
73+
QT_QPA_PLATFORM=offscreen ./build_qt6/qCommTest -p 6666 &
7174
sleep 2 # Give the server time to start
7275
./test/test_tcp
76+
killall qCommTest || true
7377
working-directory: ${{ github.workspace }}
7478

7579
- name: Run Qt6 application and C++ test
7680
run: |
77-
./build_qt6/qCommTest -p 6666 &
81+
QT_QPA_PLATFORM=offscreen ./build_qt6/qCommTest -p 6666 &
7882
sleep 2 # Give the server time to start
7983
./test/test_tcp_cpp
84+
killall qCommTest || true
8085
working-directory: ${{ github.workspace }}
8186

8287
- name: Run Qt6 application and Python test
8388
run: |
84-
./build_qt6/qCommTest -p 6666 &
89+
QT_QPA_PLATFORM=offscreen ./build_qt6/qCommTest -p 6666 &
8590
sleep 2 # Give the server time to start
8691
python3 test/test_tcp.py
92+
killall qCommTest || true
8793
working-directory: ${{ github.workspace }}

0 commit comments

Comments
 (0)