Skip to content

Commit 4bb2b21

Browse files
committed
cc ci: parallelize ctest runs in GitHub CI
commit_hash:ebdbf6a942ab3360d435e90ef2f295270ed1183e
1 parent 008b0a0 commit 4bb2b21

6 files changed

Lines changed: 85 additions & 159 deletions

File tree

.github/workflows/archlinux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,4 @@ jobs:
154154
if: ${{ false }} # Not working yet
155155
run: |-
156156
cd build_debug
157-
ctest -V
157+
ctest -j2 --output-on-failure

.github/workflows/ci.yml

Lines changed: 30 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ jobs:
133133
run: |
134134
sudo apt update
135135
sudo apt purge -y libpq5 libpq-dev postgresql-*
136-
sudo apt install --allow-downgrades -y clickhouse-common-static redis-server postgresql $(cat scripts/docs/en/deps/${{matrix.os}}.md | tr '\n' ' ')
136+
sudo apt install --allow-downgrades -y clickhouse-common-static redis-server postgresql mongodb-mongosh $(cat scripts/docs/en/deps/${{matrix.os}}.md | tr '\n' ' ')
137137
138138
- name: Setup ccache
139139
run: |
@@ -180,91 +180,34 @@ jobs:
180180
du -h -d 1 ${{env.CPM_SOURCE_CACHE}}
181181
ccache -s -v
182182
183-
- name: Run tests (universal)
184-
run: |
183+
- name: Run tests
184+
run: |-
185185
echo "UBSAN_OPTIONS=${UBSAN_OPTIONS} ASAN_OPTIONS=${ASAN_OPTIONS}"
186186
cd build_debug
187-
./universal/userver-universal-unittest ${{matrix.tests-flags}}
188-
189-
- name: Run tests (libraries)
190-
run: |
191-
cd build_debug
192-
mkdir libraries || :
193-
cd libraries
194-
ctest -V
195-
196-
- name: Run tests (core)
197-
run: |
198-
cd build_debug
199-
./core/userver-core-unittest ${{matrix.tests-flags}}
200-
201-
- name: Run tests (kafka)
202-
run: |
203-
cd build_debug
204-
mkdir kafka || :
205-
cd kafka
206-
ctest -V
207-
208-
- name: Run tests (clickhouse)
209-
run: |
210-
cd build_debug
211-
mkdir clickhouse || :
212-
cd clickhouse
213-
ctest -V
214-
215-
- name: Run tests (rabbitmq)
216-
run: |
217-
cd build_debug
218-
mkdir rabbitmq || :
219-
cd rabbitmq
220-
ctest -V
221-
222-
- name: Run tests (postgresql)
223-
run: |
224-
cd build_debug
225-
mkdir postgresql || :
226-
cd postgresql
227-
${{matrix.tests-env}} ctest -V
228-
229-
- name: Run tests (redis)
230-
run: |
231-
cd build_debug/redis/
232-
ctest -V
233-
234-
- name: Run tests (mongo)
235-
run: |
236-
sudo apt install -y mongodb-mongosh
237-
cd build_debug
238-
mkdir mongo || :
239-
cd mongo
240-
if [ -f ./userver-mongo-unittest ]; then ./userver-mongo-unittest ; fi
241-
# Mongo is not available on Ubuntu 22.04 from default repos
242-
if [ "${{matrix.os}}" != "ubuntu-22.04" ]; then ctest -V -R userver-mongo-mongotest ; fi
243-
244-
- name: Run tests (gRPC)
245-
if: matrix.os != 'ubuntu-24.04'
246-
run: |
247-
cd build_debug
248-
mkdir grpc || :
249-
cd grpc
250-
ulimit -n 4096 && ctest -V
251-
252-
- name: Run tests (mysql)
253-
# MySQL benchmarks do not work on new Ubuntu
254-
if: matrix.os != 'ubuntu-24.04'
255-
run: |
256-
sudo apt install -y mariadb-server
257-
cd build_debug
258-
mkdir mysql || :
259-
cd mysql
260-
ctest -V
261-
262-
- name: Run tests (gdb)
263-
run: |
264-
cd build_debug/scripts/gdb/tests
265-
ctest -V
266-
267-
- name: Run tests (sqlite)
268-
run: |-
269-
cd build_debug/sqlite
270-
ctest -V
187+
ulimit -n 4096
188+
GTEST_FILTER="${{matrix.tests-flags}}"
189+
export GTEST_FILTER="${GTEST_FILTER#--gtest_filter=}"
190+
# Tests not runnable on the GitHub Ubuntu runner:
191+
# * grpc/mysql: skipped on Ubuntu 24.04 (the only matrix OS)
192+
# * mongo (real DB): mongod replica set does not start on the runner
193+
# * samples-mysql_service: needs mariadb-server (not installed)
194+
# * websocket_client: runner curl lacks ws:// support
195+
# * compile-err-msg: compile-fail test unstable under clang-18
196+
# * ydb (gcc-13 only, YDB enabled there): no ydb server on the runner
197+
excluded_tests=(
198+
userver-grpc-unittest
199+
userver-grpc-benchmark
200+
userver-grpc-tests
201+
userver-grpc-handlers
202+
userver-mysql
203+
userver-mongo-dbtest
204+
testsuite-userver-mongo
205+
userver-samples-mongo
206+
samples-mysql_service
207+
testsuite-userver-core-tests-websocket_client
208+
userver-universal-compile-err-msg-test
209+
userver-ydb
210+
userver-samples-ydb
211+
)
212+
${{matrix.tests-env}} ctest -j2 --output-on-failure \
213+
-E "$(IFS='|'; printf '%s' "${excluded_tests[*]}")"

.github/workflows/debian.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,4 @@ jobs:
143143
if: ${{ false }}
144144
run: |-
145145
cd build_debug
146-
ctest -V
146+
ctest -j2 --output-on-failure

.github/workflows/docker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,4 @@ jobs:
150150
docker-compose -f .github/docker-compose.yml
151151
run --rm ${{ matrix.image}} bash -c
152152
'cd /userver/build && ulimit -n 4096 && GTEST_FILTER="${{ matrix.gtest-filter
153-
}}" TESTSUITE_REDIS_HOSTNAME=::1 ctest -V'
153+
}}" TESTSUITE_REDIS_HOSTNAME=::1 ctest -j2 --output-on-failure'

.github/workflows/fedora.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,4 @@ jobs:
134134
if: ${{ false }} # Not working yet
135135
run: |-
136136
cd build_debug
137-
ctest -V
137+
ctest -j2 --output-on-failure

.github/workflows/macos.yml

Lines changed: 51 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -115,72 +115,55 @@ jobs:
115115
du -h -d 1 ${{env.CPM_SOURCE_CACHE}}
116116
ccache -s -v
117117
118-
- name: Run tests (universal)
119-
run: |
120-
cd build_debug/universal
121-
GTEST_FILTER="-UUID.ParseFail" ctest -V
122-
123-
- name: Run tests (samples)
124-
run: |
125-
cd build_debug/samples
126-
ctest -V
127-
128-
- name: Run tests (core)
129-
run: |
130-
cd build_debug/core
131-
ulimit -n 4096 && ctest -V -E "userver-core-unittest|testsuite-userver-core-tests-basic-chaos-tests-deadline|testsuite-userver-core-tests-websocket|testsuite-userver-core-tests-basic-chaos" # ~10 failed tests
132-
133-
- name: Run tests (libraries)
134-
run: |
135-
cd build_debug/libraries
136-
ctest -V
137-
138-
- name: Run tests (clickhouse)
139-
run: |
140-
cd build_debug/clickhouse
141-
ctest -V
142-
143-
- name: Run tests (rocks)
144-
run: |
145-
cd build_debug/rocks
146-
ctest -V
147-
148-
- name: Run tests (kafka)
149-
run: |
150-
cd build_debug/kafka
151-
ctest -V
152-
153-
- name: Run tests (rabbitmq)
154-
run: |
155-
cd build_debug/rabbitmq
156-
ctest -V
157-
158-
- name: Run tests (grpc)
159-
run: |
160-
cd build_debug/grpc
161-
ctest -V
162-
163-
- name: Run tests (mongo)
164-
run: |
165-
cd build_debug/mongo
166-
ctest -V -R "userver-mongo-unittest|userver-mongo-benchmark" # many flaps in integrational tests
167-
168-
- name: Run tests (mysql)
169-
run: |
170-
cd build_debug/mysql
171-
GTEST_FILTER="-*Transaction*" ctest -V
172-
173-
- name: Run tests (redis)
174-
run: |
175-
cd build_debug/redis
176-
ctest -V -E testsuite-userver-redis-tests-basic-chaos
177-
178-
- name: Run tests (postgresql)
179-
run: |
180-
cd build_debug/postgresql
181-
ulimit -n 4096 && GTEST_FILTER="-PostgreCluster.TransactionTimeouts" ctest -V -E testsuite-userver-postgresql-tests-basic-chaos
182-
183-
- name: Run tests (sqlite)
118+
- name: Run tests
184119
run: |-
185-
cd build_debug/sqlite
186-
ctest -V -E "userver-sqlite-unittest" # unittests failed with fs access
120+
cd build_debug
121+
ulimit -n 4096
122+
# gtest cases broken/flaky on macOS (filtered out individually)
123+
broken_gtests=(
124+
UUID.ParseFail
125+
Transaction.Commit
126+
Transaction.Rollback
127+
Transaction.AutoRollback
128+
Transaction.ActuallyTransactional
129+
Transaction.InsertOne
130+
Transaction.InsertMany
131+
TransactionDeathTest.AccessAfterCommit
132+
TransactionDeathTest.AccessAfterRollback
133+
PostgreCluster.TransactionTimeouts
134+
'*ViaChaosProxy'
135+
HttpClient.HttpsWithCrl
136+
HttpClient.HttpsWithNoClientCa
137+
HttpClient.StatsOnTimeout
138+
HttpClientProxy.HttpsTruncatedHeaders
139+
DestinationStatistics.Ok
140+
DestinationStatistics.Multiple
141+
CurlFormTest.MultipartFileWithContentType
142+
CurlFormTest.FilesWithContentType
143+
CurlFormTest.FormMovable
144+
WaitWake.WakeupTriggersPredicateRecheck
145+
AsyncFlatCombiningQueue.StressAsync
146+
Socket.UdpIpMreqIPv6
147+
Socket.UdpIpMreqMultipleReceiversIPv6
148+
Subprocess.EnvironmentVariablesScope
149+
ThreadLocal.SafeThreadLocalWorks
150+
HedgedRequest.Base
151+
HedgedRequest.SuccessfulHedging
152+
HedgedRequest.Timeout
153+
'PeriodicTask.*'
154+
)
155+
# whole tests not run / failing on macOS
156+
excluded_tests=(
157+
testsuite-userver-core-tests-basic-chaos
158+
testsuite-userver-core-tests-websocket
159+
userver-mongo-dbtest
160+
testsuite-userver-mongo
161+
testsuite-userver-redis-tests-basic-chaos
162+
testsuite-userver-postgresql-tests-basic-chaos
163+
userver-sqlite-unittest
164+
userver-testsuite-tests-chaos
165+
userver-odbc-dbtest
166+
testsuite-userver-odbc-tests-basic-chaos
167+
)
168+
export GTEST_FILTER="-$(IFS=:; printf '%s' "${broken_gtests[*]}")"
169+
ctest --output-on-failure -E "$(IFS='|'; printf '%s' "${excluded_tests[*]}")"

0 commit comments

Comments
 (0)