I have just 24h working with Go so I am super new to this.
I'm trying to get a complete test conversion but when I run
go test -cover new-project/anto/... .
in new-project/anto/mon it shows me that I have 51.8% coverage but in reality I have more coverage because there are tests that are tested in new-project/anto/integration where I have a test file that I import the new-project/anto/mon for testing.
The thing is that as I was reading Golang only takes the tests if they are in the same folder but having separate files does not detect it correctly.
I was wondering if there is a way to get the full coverage.
go test -cover new-project/anto/... .
? new-project/anto/ [no test files]
ok new-project/anto/conf 6.060s coverage: 73.1% of statements
ok new-project/anto/integration 43.309s coverage: [no statements]
? new-project/anto/integration/conf [no test files]
? new-project/anto/integration/mocks [no test files]
? new-project/anto/integration/utils [no test files]
ok new-project/anto/logs 0.024s coverage: 70.5% of statements
ok new-project/anto/metric 0.012s coverage: 59.0% of statements
ok new-project/anto/mon 1.612s coverage: 51.8% of statements
? new-project/anto/anotherComponents [no test files]
Doing some research, I found a go-acc plugin that validates all the packages, the curious thing is that mon instead of having 51.8% now has 29.8%.
go-acc new-project/anto/... .
? new-project/anto/ [no test files]
ok new-project/anto//conf 5.030s coverage: 73.1
ok new-project/anto//integration 43.117s coverage: 73.5
? new-project/anto//integration/conf [no test files]
? new-project/anto//integration/mocks [no test files]
? new-project/anto//integration/utils [no test files]
ok new-project/anto//logs 0.008s coverage: 22.3
ok new-project/anto//metric 0.020s coverage: 59.0
ok new-project/anto//mon 1.460s coverage: 29.8
? new-project/anto//anotherComponents [no test files]
? new-project/anto/ [no test files]