Skip to content
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

fix(ci): Speed up CI, Add t.Parallel and Fix Test Parallelism Issue #2459

Merged
merged 5 commits into from
Feb 1, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions scripts/build/testing.mk
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,16 @@ test-unit: ## run golang unit tests
@go list -f '{{.Dir}}/...' -m | xargs \
go test -race -tags bls12381,test

test-unit-cover: ## run golang unit tests with coverage
@echo "Running unit tests with coverage..."
test-unit-cover: test-unit-norace ## run golang unit tests with coverage
@echo "Running unit tests with coverage and race checks..."
Comment on lines +268 to +269
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unclear to me if there's a better way to separate tests. Its even unclear why we have to run tests with tags bls12381,test in the first place

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to include the test tag in go test for it to include and test the *_test.go files that import the statetransition package, see #2428

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need tags at all? build tags are quite undiscoverable - see. I'm also having trouble filtering tests.

The intention for test-unit-norace was that it only run tests built with norace - but it seems to be running all of them according to run logs.

Still faster than before though

ok  	github.com/berachain/beacon-kit/storage/beacondb	0.038s	coverage: 26.0% of statements
ok  	github.com/berachain/beacon-kit/storage/beacondb/index	0.008s	coverage: 0.0% of statements
ok  	github.com/berachain/beacon-kit/storage/block	0.005s	coverage: 82.8% of statements
ok  	github.com/berachain/beacon-kit/storage/filedb	0.026s	coverage: 77.1% of statements

@go list -f '{{.Dir}}/...' -m | xargs \
go test -race -coverprofile=test-unit-cover.txt -tags bls12381,test

test-unit-norace: ## run golang unit tests with coverage but without race as some tests are too slow with race
@echo "Running unit tests with coverage but no race checks..."
@go list -f '{{.Dir}}/...' -m | xargs \
go test -coverprofile=test-unit-cover-norace -tags bls12381,test,norace

test-unit-bench: ## run golang unit benchmarks
@echo "Running unit tests with benchmarks..."
@go list -f '{{.Dir}}/...' -m | xargs \
Expand Down
2 changes: 2 additions & 0 deletions testing/quick/compare_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build norace

// SPDX-License-Identifier: BUSL-1.1
//
// Copyright (C) 2025, Berachain Foundation. All rights reserved.
Expand Down
Loading