Skip to content

Commit

Permalink
ci: use V's builtin way to handle flaky tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Nov 9, 2023
1 parent 8940ba7 commit 65bf26b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 22 deletions.
26 changes: 9 additions & 17 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,7 @@ jobs:
- name: Build
run: v -shared ${{ env.MOD_PATH }}
- name: Run tests
uses: nick-fields/retry@v2
with:
timeout_minutes: 3
max_attempts: 3
command: v ${{ env.VFLAGS }} test ${{ env.MOD_PATH }}
run: v ${{ env.VFLAGS }} test ${{ env.MOD_PATH }}

test-sanitzed:
needs: test
Expand Down Expand Up @@ -108,15 +104,11 @@ jobs:
packages: libcurl4-openssl-dev
version: 1.0
- name: Run tests
uses: nick-fields/retry@v2
with:
timeout_minutes: 3
max_attempts: 3
command: |
if [[ ${{ matrix.cc }} == "gcc" && ${{ matrix.sanitizer }} == "address" ]]; then
cmd="v ${{ env.VFLAGS }} -cflags -fsanitize=address -cflags -fsanitize-address-use-after-scope -cflags -fsanitize=pointer-compare -cflags -fsanitize=pointer-subtract test ${{ env.MOD_PATH }}"
else
cmd="v ${{ env.VFLAGS }} -cflags -fsanitize=${{ matrix.sanitizer }} test ${{ env.MOD_PATH }}"
fi
echo "$cmd"
eval "$cmd"
run: |
if [[ ${{ matrix.cc }} == "gcc" && ${{ matrix.sanitizer }} == "address" ]]; then
cmd="v ${{ env.VFLAGS }} -cflags -fsanitize=address -cflags -fsanitize-address-use-after-scope -cflags -fsanitize=pointer-compare -cflags -fsanitize=pointer-subtract test ${{ env.MOD_PATH }}"
else
cmd="v ${{ env.VFLAGS }} -cflags -fsanitize=${{ matrix.sanitizer }} test ${{ env.MOD_PATH }}"
fi
echo "$cmd"
eval "$cmd"
6 changes: 1 addition & 5 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,4 @@ jobs:
- name: Build
run: v -shared ${{ env.MOD_PATH }}
- name: Run tests
uses: nick-fields/retry@v2
with:
timeout_minutes: 3
max_attempts: 3
command: v ${{ env.VFLAGS }} test ${{ env.MOD_PATH }}
run: v ${{ env.VFLAGS }} test ${{ env.MOD_PATH }}
2 changes: 2 additions & 0 deletions src/_tests_get_slice_test.v
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// vtest flaky: true
// vtest retry: 3
module vibe

import net.html
Expand Down
2 changes: 2 additions & 0 deletions src/_tests_get_test.v
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// vtest flaky: true
// vtest retry: 3
module vibe

fn test_get() {
Expand Down
2 changes: 2 additions & 0 deletions src/_tests_post_test.v
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// vtest flaky: true
// vtest retry: 3
module vibe

import time
Expand Down

0 comments on commit 65bf26b

Please sign in to comment.