You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The repository has transitioned to a monorepo structure with multiple submodules, each having their own go.mod files. The current CI setup using ./... pattern in test commands doesn't properly handle these submodules, potentially leading to incomplete test coverage.
Current Setup
The repository contains multiple self-contained modules with separate go.mod files:
- name: Run unit testsrun: go test ./... -race -coverprofile=coverage.txt
Solution 2: Iterative Test Execution
Create a script that:
Discovers all submodules with go.mod files
Runs tests in each module independently
Aggregates coverage reports
Example script structure:
#!/bin/bashfordirin$(find . -name go.mod | xargs dirname);docd$dir
go test ./... -race -coverprofile=coverage-$dir.txt
cd -
done
Solution 3: Root Makefile with Module Targets
Update the root Makefile to handle submodules explicitly
Add targets for each submodule
Create an aggregate test target:
test: test-core test-da test-rollups test-sequencers
test-core:
cd core && go test ./...
test-da:
cd da && go test ./...
test-rollups:
cd rollups/abci/based && go test ./...
cd rollups/abci/centralized && go test ./...
cd rollups/evm/based && go test ./...
cd rollups/evm/single && go test ./...
cd rollups/testapp && go test ./...
test-sequencers:
cd sequencers/based && go test ./...
cd sequencers/single && go test ./...
Problem Description
The repository has transitioned to a monorepo structure with multiple submodules, each having their own
go.modfiles. The current CI setup using./...pattern in test commands doesn't properly handle these submodules, potentially leading to incomplete test coverage.Current Setup
go.modfiles:./go.mod)./core/go.mod)./da/go.mod)./rollups/abci/based/go.mod)./rollups/abci/centralized/go.mod)./rollups/evm/based/go.mod)./rollups/evm/single/go.mod)./rollups/testapp/go.mod)./sequencers/based/go.mod)./sequencers/single/go.mod)make testcommand which may not properly traverse all submodulesImpact
Proposed Solutions
Solution 1: Use Go Workspace
go.workfile in the root directorySolution 2: Iterative Test Execution
go.modfilesSolution 3: Root Makefile with Module Targets
Solution 4: Module-Specific Makefiles (Recommended)
make -C:Benefits of Solution 4
make -C) for better reliability and maintainability$(MAKE)MODULESvariableAdditional Considerations
go.modfilesNext Steps
References