-
Notifications
You must be signed in to change notification settings - Fork 35
ci: add flaky test catching workflow #617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+109
−2
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| name: catch_flaky | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - 'test/*/*_test.lua' | ||
| - 'test/*/*.test.lua' | ||
|
|
||
| jobs: | ||
| catch_flaky: | ||
| if: github.event_name == 'pull_request' && | ||
| !contains(github.event.pull_request.labels.*.name, 'noflaky') | ||
|
|
||
| env: | ||
| TNT_RELEASE_PATH: /home/runner/tnt-release | ||
|
|
||
| runs-on: ubuntu-22.04 | ||
| timeout-minutes: 180 | ||
| steps: | ||
| - name: Create variables for Tarantool | ||
| run: | | ||
| branch=master | ||
| commit_hash=$(git ls-remote \ | ||
| https://github.com/tarantool/tarantool.git \ | ||
| --branch ${branch} | head -c 8) | ||
| echo "TNT_BRANCH=${branch}" >> $GITHUB_ENV | ||
| echo "VERSION_POSTFIX=-${commit_hash}" >> $GITHUB_ENV | ||
| shell: bash | ||
|
|
||
| - name: Cache tarantool build | ||
| id: cache-tnt-release | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: ${{ env.TNT_RELEASE_PATH }} | ||
| key: cache-tnt-release-master${{ env.VERSION_POSTFIX }} | ||
|
|
||
| - name: Clone tarantool | ||
| if: steps.cache-tnt-release.outputs.cache-hit != 'true' | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| repository: tarantool/tarantool | ||
| ref: ${{ env.TNT_BRANCH }} | ||
| path: tarantool | ||
| fetch-depth: 0 | ||
| submodules: true | ||
|
|
||
| - name: Build tarantool | ||
| if: steps.cache-tnt-release.outputs.cache-hit != 'true' | ||
| run: | | ||
| sudo apt-get -y install build-essential cmake make zlib1g-dev \ | ||
| libreadline-dev libncurses5-dev libssl-dev libunwind-dev \ | ||
| libicu-dev python3 python3-yaml python3-six python3-gevent | ||
| cd ${GITHUB_WORKSPACE}/tarantool | ||
| mkdir build && cd build | ||
| cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_DIST=ON | ||
| make && make DESTDIR=${TNT_RELEASE_PATH} install | ||
|
|
||
| - name: Install tarantool | ||
| # Workaround as actions/cache cannot restore data to /usr/local | ||
| run: sudo cp -rvP ${TNT_RELEASE_PATH}/usr/local/* /usr/local/ | ||
|
|
||
| - name: Clone the module | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| # Fetch the entire history for all branches and tags. It is needed for | ||
| # upgrade testing. | ||
| fetch-depth: 0 | ||
| # Enable recursive submodules checkout as test-run git module is used | ||
| # for running tests. | ||
| submodules: recursive | ||
| ref: ${{ github.event.pull_request.head.sha }} | ||
|
|
||
| - name: Install test requirements | ||
| run: pip3 install --user -r test-run/requirements.txt | ||
|
|
||
| - name: Setup tt | ||
| run: | | ||
| curl -L https://tarantool.io/release/2/installer.sh | sudo bash | ||
| sudo apt install -y tt | ||
| tt version | ||
|
|
||
| - name: Setup luatest | ||
| run: tt rocks install luatest | ||
|
|
||
| - run: cmake . | ||
| - run: make test-flaky | ||
| env: | ||
| RANGE: HEAD~${{ github.event.pull_request.commits }}..HEAD | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule test-run
updated
21 files
| +10 −6 | .github/workflows/test.yml | |
| +0 −6 | .gitmodules | |
| +1 −2 | .luacheckrc | |
| +2 −0 | Makefile | |
| +20 −0 | bin/luatest | |
| +11 −18 | dispatcher.py | |
| +2 −8 | lib/__init__.py | |
| +0 −1 | lib/checks | |
| +22 −0 | lib/colorer.py | |
| +0 −1 | lib/luatest | |
| +102 −18 | lib/luatest_server.py | |
| +16 −0 | lib/options.py | |
| +17 −6 | lib/tarantool_server.py | |
| +4 −3 | lib/test.py | |
| +4 −10 | lib/test_suite.py | |
| +41 −3 | lib/utils.py | |
| +13 −2 | lib/worker.py | |
| +5 −1 | listeners.py | |
| +2 −1 | requirements.txt | |
| +19 −16 | test-run.py | |
| +5 −2 | test_run.lua |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.