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

Call go test only for directories that contain at least one test #215

Merged
merged 1 commit into from
Jul 7, 2022

Conversation

tpapagian
Copy link
Member

make test-compile iterates all directories with Go code and calls go test to build the executable. In many of the directories there are no tests which introduces delays in the make process.

This commit calls go test only for directories that contain at least one test file (i.e. *_test.go).

Before the fix:

$ rm  -rf go-tests/ && time make test-compile > /dev/null

real	0m41.261s
user	2m10.735s
sys	0m24.337s
$ ls -la go-tests/ | wc -l
36

After the fix:

$ rm  -rf go-tests/ && time make test-compile > /dev/null

real	0m22.878s
user	1m16.238s
sys	0m10.950s
$ ls -la go-tests/ | wc -l
36

Signed-off-by: Anastasios Papagiannis [email protected]

make test-compile iterates all directories with Go code and calls
go test to build the executable. In many of the directories there
are no tests which introduces delays in the make process.

This commit calls go test only for directories that contain at least
one test file (i.e. *_test.go).

Before the fix:
$ rm  -rf go-tests/ && time make test-compile > /dev/null

real	0m41.261s
user	2m10.735s
sys	0m24.337s
$ ls -la go-tests/ | wc -l
36

After the fix:
$ rm  -rf go-tests/ && time make test-compile > /dev/null

real	0m22.878s
user	1m16.238s
sys	0m10.950s
$ ls -la go-tests/ | wc -l
36

Signed-off-by: Anastasios Papagiannis <[email protected]>
@tpapagian tpapagian requested a review from a team as a code owner July 4, 2022 14:15
@tpapagian tpapagian requested a review from kkourt July 4, 2022 14:15
@jrfastab jrfastab merged commit b1031ce into main Jul 7, 2022
@jrfastab jrfastab deleted the pr/apapag/fix_make_gotests branch July 7, 2022 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants