-1

プロジェクト内のすべてのパッケージでテスト カバレッジを取得しようとしています。

テストが正常に実行され、次のコマンドを実行するとカバレッジが報告されます。

go test -cover ./...

しかし、パラメーターを指定して実行するgo testと、すべてのテストが失敗しますcoverpkg=./...

go test -cover -coverpkg=./... ./...

これはコマンドのサンプル出力です

srimal@srimal-pc:~/projects/myproject$ go test -v -cover -coverpkg=./... ./...
go build a.abc.com/path/to/module/e2e: no non-test Go files in /home/srimal/projects/driver-selection-handler/e2e
?       a.abc.com/path/to/module      [no test files]
?       a.abc.com/path/to/module/app  [no test files]
?       a.abc.com/path/to/module/constrain    [no test files]
FAIL    a.abc.com/path/to/module/directionalhire [build failed]
?       a.abc.com/path/to/module/domain       [no test files]
FAIL    a.abc.com/path/to/module/durationmatrix [build failed]
FAIL    a.abc.com/path/to/module/durationmatrix/etaservice [build failed]
FAIL    a.abc.com/path/to/module/durationmatrix/roadmatrix [build failed]
2021/04/22 17:23:07 go-util/log: Cannot open config file  open config/logger.yaml: no such file or directory
testing: warning: no tests to run
PASS
coverage: 0.0% of statements in ./...
ok      a.abc.com/path/to/module/e2e  (cached)        coverage: 0.0% of statements in ./... [no tests to run]
?       a.abc.com/path/to/module/events       [no test files]
FAIL    a.abc.com/path/to/module/finance [build failed]
?       a.abc.com/path/to/module/internal     [no test files]
?       a.abc.com/path/to/module/internal/config      [no test files]
?       a.abc.com/path/to/module/internal/logger      [no test files]
?       a.abc.com/path/to/module/internal/metrics     [no test files]
?       a.abc.com/path/to/module/internal/profiling   [no test files]
?       a.abc.com/path/to/module/internal/schema      [no test files]
?       a.abc.com/path/to/module/internal/stream      [no test files]
FAIL    a.abc.com/path/to/module/location [build failed]
?       a.abc.com/path/to/module/logger       [no test files]
?       a.abc.com/path/to/module/metrics      [no test files]
FAIL    a.abc.com/path/to/module/selection [build failed]
FAIL    a.abc.com/path/to/module/store [build failed]
FAIL    a.abc.com/path/to/module/stream [build failed]
?       a.abc.com/path/to/module/stream/reg   [no test files]
FAIL    a.abc.com/path/to/module/weighted [build failed]

私はgoバージョン1.15.6を使用しています

ビルドが失敗した理由を見つける方法はありますか?

4

1 に答える 1