From 86a9189d752b7bad44c10c7faf87edcc336ce884 Mon Sep 17 00:00:00 2001 From: Moritz Date: Wed, 27 Sep 2023 15:07:42 +0200 Subject: [PATCH] Add test argument --- pkgs/firehose/bin/health.dart | 2 +- pkgs/firehose/lib/src/health/health.dart | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pkgs/firehose/bin/health.dart b/pkgs/firehose/bin/health.dart index e87270b1..66c860df 100644 --- a/pkgs/firehose/bin/health.dart +++ b/pkgs/firehose/bin/health.dart @@ -22,5 +22,5 @@ void main(List arguments) async { var checks = parsedArgs['checks'] as List; var coverageWeb = parsedArgs['coverage_web'] as bool; - await Health(Directory.current).healthCheck(checks, coverageWeb); + await Health(Directory.current, '').healthCheck(checks, coverageWeb); } diff --git a/pkgs/firehose/lib/src/health/health.dart b/pkgs/firehose/lib/src/health/health.dart index 0633325c..61c005d5 100644 --- a/pkgs/firehose/lib/src/health/health.dart +++ b/pkgs/firehose/lib/src/health/health.dart @@ -4,6 +4,7 @@ // ignore_for_file: always_declare_return_types +import 'dart:convert'; import 'dart:io'; import 'dart:math'; @@ -37,7 +38,10 @@ const String _prHealthTag = '## PR Health'; class Health { final Directory directory; - Health(this.directory); + ///DO_NOT_SUBMIT + final String testArgument; + + Health(this.directory, this.testArgument); Future healthCheck(List args, bool coverageweb) async { var github = Github(); @@ -125,7 +129,9 @@ Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automati ); print('runApiTool: err:${runApiTool.stderr}, out:${runApiTool.stdout}'); final reportFile = File(path.join(currentPath, 'report.json')); - totalOut += reportFile.readAsStringSync(); + var fullReport = reportFile.readAsStringSync(); + var decoded = jsonDecode(fullReport) as Map; + totalOut += decoded['report'].toString(); } return HealthCheckResult( 'breaking',