TheThingsArchive / make

Reusable make rules for The Things projects
Other
0 stars 0 forks source link

`make test` returns non-zero code when there is no `*_test.go` files in the project #2

Closed gomezjdaniel closed 6 years ago

gomezjdaniel commented 7 years ago
integration-aws  testing 0 go packages
can't load package: package github.com/TheThingsIndustries/integration-aws: no buildable Go source files in /home/daniel/goprojects/src/github.com/TheThingsIndustries/integration-aws
.make/go/main.make:110: recipe for target 'go.test' failed
make: *** [go.test] Error 1
johanstokking commented 7 years ago

This is the same as saying "make fails if there is no source in the project" ...

I think it's fine that make test exists with non-zero if there are no tests. It's a good warning to add tests

gomezjdaniel commented 7 years ago

I know this is not a "tech critical" thing but rethinking it again..

WIth make build you are targeting a specific file to be build which if it doesn't exist it makes sense that a non-zero code has been returned

WIth make test you are just executing go test in those packages that contains *_test.go files. So if there is no package that contains I dont see why an error code is appropiate to be returned, plus when the makefile itself says integration-aws testing 0 go packages

Also not everything is testable

Any thoughts from your part @htdvisser ?

htdvisser commented 7 years ago

@romeovs wrote this stuff, he'll be the right person to ask