From 7f6830df911a38312a50c6816b05b1081474bc6c Mon Sep 17 00:00:00 2001 From: Axay Sagathiya Date: Fri, 21 Jul 2023 10:45:49 +0530 Subject: [PATCH] chore(ci): add `go test -race` ci workflows (#3396) Co-authored-by: Kishan Sagathiya --- .github/workflows/unit-tests.yml | 4 ++-- Makefile | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index cb05bc7175..359c5d3c10 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -86,8 +86,8 @@ jobs: go test -run ^Test_Trie_MemoryUsage$ ./lib/trie sed -i 's/const skip = false/const skip = true/g' ./lib/trie/mem_test.go - - name: Test State - Race - run: make test-state-race + - name: Test - Race + run: make test-using-race-detector - uses: codecov/codecov-action@v3.1.4 with: diff --git a/Makefile b/Makefile index 2c8db01d07..db50eff3b1 100644 --- a/Makefile +++ b/Makefile @@ -60,9 +60,14 @@ it-polkadotjs: build MODE=polkadot go test ./tests/polkadotjs_test/... -timeout=5m -v ## test: Runs `go test -race` on project test files. -test-state-race: +test-using-race-detector: @echo " > \033[32mRunning race tests...\033[0m " go test ./dot/state/... -race -timeout=5m + go test ./dot/sync/... -race -timeout=5m + go test ./internal/log/... -race -timeout=5m + go test ./lib/blocktree/... -race -timeout=5m + go test ./lib/grandpa/... -race -timeout=5m + ## deps: Install missing dependencies. Runs `go mod download` internally. deps: