我使用下面的
应用程序具有以下软件包依赖项:
.gitlab-ci.yml
文件运行使用 junit
进行测试,并将报告导出为 XML artifact:image: cirrusci/flutter:stable
before_script:
- flutter pub get
- flutter clean
- flutter --version
stages:
- analyze-and-test
analyze-and-test:
stage: analyze-and-test
script:
- flutter build aot
- flutter analyze
# - flutter test
- flutter test --machine | tojunit -o report.xml
artifacts:
when: always
reports:
junit:
- report.xml
only:
- master
- merge_requests
应用程序具有以下软件包依赖项:
dependencies:
flutter:
sdk: flutter
junitreport: ^1.3.1
当运行此流水线时,我会得到以下错误:
$ flutter test --machine | tojunit -o report.xml
/usr/bin/bash: line 139: tojunit: command not found
Unhandled exception:
FileSystemException: writeFrom failed, path = '' (OS Error: Broken pipe, errno = 32)
我正在试图弄清楚为什么这个命令失败了。在调用analyze-and-test
之前,在before_script
段落中检索到包,因此应该能够找到该命令。我错过了什么吗?
export PATH="$PATH":"$HOME/.pub-cache/bin"
需要这个命令。 - Sunil D S