刚开始使用gitlab的单元测试覆盖率,测试的代码是golang的,经过摸索如下
total:\s+\(statements\)\s+(\d+.\d+)%
.gitlab-ci.yml 配置文件如下
script:
- go test -coverprofile=coverage.out && go tool cover -func=coverage.out
就是从输出的内容里面用正则匹配,能成功就OK了
刚开始使用gitlab的单元测试覆盖率,测试的代码是golang的,经过摸索如下
total:\s+\(statements\)\s+(\d+.\d+)%
.gitlab-ci.yml 配置文件如下
script:
- go test -coverprofile=coverage.out && go tool cover -func=coverage.out
就是从输出的内容里面用正则匹配,能成功就OK了