-
Notifications
You must be signed in to change notification settings - Fork 123
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
Support multi-modules project #231
Comments
Are you looking to use |
I'd like to use For example: add Total test coverage need further calculation, so there also should be an option for it. Plugin mechanism may be too complex and unnecessary since Go and Python are different. |
I think this is an interesting idea! It might be good to first see how easy it is to do this with a bash script. That should give us some idea of what logic is necessary to find all the modules. Does this do what you want? for mod in $(find . -name go.mod | xargs -n 1 dirname); do (cd "$mod"; go test ./...); done I think, at least initially, it would be good to make this a separate sub-command (similar to Maybe |
Agree. Keep I have another concern. We may want to ensure the total test coverage of a repo. So the CI will check total coverage and fail if it's lower than a specified value, like However, if a sub module contains no So the bash script may look like this: TOTAL_COVERAGE_FILE=$(pwd)/total_coverage.out
for mod in $(find . -name go.mod | xargs -n 1 dirname); do
cd "$mod"
touch dummy_test.go
go test -cover ./... -coverpkg=./... -coverprofile=coverage.out
tail -n +1 coverage.out >>"$TOTAL_COVERAGE_FILE"
rm dummy_test.go
done
calc_total_coverage "$TOTAL_COVERAGE_FILE" Sub-command |
Not exactly the same request as this issue, but I thought I would mention that #276 adds a new |
For example, my project (a git repo) has several sub folders, each contains a
go.mod
. The project root folder may or may not contain ago.mod
.Is that possible to run
gotestsum
to execute all tests in each modules?The text was updated successfully, but these errors were encountered: