Skip to content

Commit 886d2e6

Browse files
committed
ci: add flaky test catching workflow
Add new ci workflow running all files changed in the PR commits multiple times in parallel by default. Can be disabled by setting the noflaky PR label. Co-authored-by: Nikita Zheleztsov <n.zheleztsov@proton.me> Fixes #531 NO_DOC=ci NO_TEST=ci
1 parent f63baa9 commit 886d2e6

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

.github/workflows/catch_flaky.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: catch_flaky
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'test/*/*.lua'
7+
8+
jobs:
9+
catch_flaky:
10+
if: github.event_name == 'pull_request' &&
11+
!contains(github.event.pull_request.labels.*.name, 'noflaky') &&
12+
!contains(github.event.pull_request.labels.*.name, 'notest')
13+
14+
env:
15+
TNT_RELEASE_PATH: /home/runner/tnt-release
16+
17+
runs-on: ubuntu-22.04
18+
timeout-minutes: 180
19+
steps:
20+
- name: Install tarantool
21+
uses: tarantool/setup-tarantool@v3
22+
with:
23+
tarantool-version: '3.5'
24+
25+
- name: Clone the module
26+
uses: actions/checkout@v3
27+
with:
28+
# Fetch the entire history for all branches and tags. It is needed for
29+
# upgrade testing.
30+
fetch-depth: 0
31+
# Enable recursive submodules checkout as test-run git module is used
32+
# for running tests.
33+
submodules: recursive
34+
ref: ${{ github.event.pull_request.head.sha }}
35+
36+
- name: Install test requirements
37+
run: pip3 install --user -r test-run/requirements.txt
38+
39+
- name: Setup tt
40+
run: |
41+
curl -L https://tarantool.io/release/2/installer.sh | sudo bash
42+
sudo apt install -y tt
43+
tt version
44+
45+
- name: Setup luatest
46+
run: tt rocks install luatest 1.2.1
47+
48+
- run: cmake .
49+
- run: make test-flaky
50+
env:
51+
RANGE: HEAD~${{ github.event.pull_request.commits }}..HEAD

test/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,13 @@ add_custom_target(test-force
88
--builddir=${PROJECT_BINARY_DIR}
99
--vardir=${PROJECT_BINARY_DIR}/test/var
1010
--force)
11+
12+
add_custom_target(test-flaky
13+
COMMAND git diff --relative=test/ --name-only
14+
$$\{RANGE:-master..HEAD\}
15+
-- "./*/*test.lua" |
16+
xargs -L 128 -r ${PROJECT_SOURCE_DIR}/test/test-run.py -j -1
17+
--force --retries=0
18+
--repeat=$$\{N_TRIALS:-32\}
19+
--builddir=${PROJECT_BINARY_DIR}
20+
--vardir=${PROJECT_BINARY_DIR}/test/var)

0 commit comments

Comments
 (0)