我在coverage
中有一个GitLab
任务已设置为某个阈值,这意味着每个不满足阈值条件的构建都应设置为失败。
此处是我的coverage
运行中的输出
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18:00 min
[INFO] Finished at: 2019-03-21T15:23:37+00:00
[INFO] Final Memory: 65M/876M
[INFO] ------------------------------------------------------------------------
coverage line-rate="43.76%"
coverage
中的.gitlab-ci.yml
任务按原样配置
coverage:
coverage: '/coverage line-rate="(\d+(?:\.\d+)?%)"/'
variables:
min_coverage: 50
coverage_result: ${coverage}
coverage_test: '/coverage line-rate="(\d+(?:\.\d+)?%)"'
stage: test
script:
- make coverage
- echo coverage
- echo "${coverage}"
- echo "${coverage_result}"
- echo "${min_coverage}"
- echo "${coverage_test}"
- if [ "${min_coverage}" -gt "${coverage}" ]; then exit 1 fi
我无法提取用于43.76
比较的if
值