I'm using the following .gitlab-ci.yml
file to run tests using junit
and export the report as an 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
The application has the following package dependencies:
dependencies:
flutter:
sdk: flutter
junitreport: ^1.3.1
When this pipeline is ran, I get the following error:
$ 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)
I'm trying to figure out why this is failing. The command should be found since the package is retrieved in before_script
stanza before the analyze-and-test
is called. What am I missing?
question from:
https://stackoverflow.com/questions/66046443/gitlab-flutter-ci-fails-with-tojunit-command-not-found 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…