From 384da152a01595ac2314341e423c9fe738006376 Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez <835733+gaby@users.noreply.github.com> Date: Sun, 30 Jun 2024 13:35:21 -0400 Subject: [PATCH 1/2] Add support for longtests during CI --- .github/workflows/test.yml | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 98b8d6785d..c7b69554f3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ on: name: Test jobs: - Build: + test: strategy: matrix: go-version: [1.21.x, 1.22.x] @@ -30,11 +30,8 @@ jobs: with: go-version: ${{ matrix.go-version }} - - name: Install gotestsum - run: go install gotest.tools/gotestsum@v1.11.0 - - name: Test - run: gotestsum -f testname -- ./... -race -count=1 -coverprofile=coverage.txt -covermode=atomic -shuffle=on + run: go run gotest.tools/gotestsum@latest -f testname -- ./... -race -count=1 -coverprofile=coverage.txt -covermode=atomic -shuffle=on - name: Upload coverage reports to Codecov if: ${{ matrix.platform == 'ubuntu-latest' && matrix.go-version == '1.22.x' }} @@ -44,3 +41,21 @@ jobs: file: ./coverage.txt flags: unittests slug: gofiber/fiber + + LongTest: + needs: test + strategy: + matrix: + go-version: [1.21.x, 1.22.x] + runs-on: ubuntu-latest + steps: + - name: Fetch Repository + uses: actions/checkout@v4 + + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go-version }} + + - name: Test + run: go run gotest.tools/gotestsum@latest -f testname -- ./... -race -count=25 -shuffle=on From a0a51b905093258c1bbf31a8eb1671397fa36b5a Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez <835733+gaby@users.noreply.github.com> Date: Sun, 30 Jun 2024 13:52:36 -0400 Subject: [PATCH 2/2] Reduce count from 25 to 15 --- .github/workflows/test.yml | 11 ++++++----- Makefile | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c7b69554f3..1f17f4092a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,3 +1,5 @@ +name: Test + on: push: branches: @@ -13,9 +15,8 @@ on: - "!docs/**" - "!**.md" -name: Test jobs: - test: + unit: strategy: matrix: go-version: [1.21.x, 1.22.x] @@ -42,8 +43,8 @@ jobs: flags: unittests slug: gofiber/fiber - LongTest: - needs: test + repeated: + needs: unit strategy: matrix: go-version: [1.21.x, 1.22.x] @@ -58,4 +59,4 @@ jobs: go-version: ${{ matrix.go-version }} - name: Test - run: go run gotest.tools/gotestsum@latest -f testname -- ./... -race -count=25 -shuffle=on + run: go run gotest.tools/gotestsum@latest -f testname -- ./... -race -count=15 -shuffle=on diff --git a/Makefile b/Makefile index b4627f960e..0d4be85fa4 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ test: ## longtest: 🚦 Execute all tests 10x .PHONY: longtest longtest: - go run gotest.tools/gotestsum@latest -f testname -- ./... -race -count=10 -shuffle=on + go run gotest.tools/gotestsum@latest -f testname -- ./... -race -count=15 -shuffle=on ## tidy: 📌 Clean and tidy dependencies .PHONY: tidy