Repository: flutter
Issue: flutter test integration_test -r json includes Gradle ouput
Labels: platform-android,tool,t: gradle,f: integration_test,has reproducible steps,P2,workaround available,found in release: 3.7,found in release: 3.9,team-android,triaged-android

# Description
`flutter test integration_test -r json` includes Gradle output in the JSON file.

# Examples
## To get a JSON test report for Flutter unit tests, we run the following:
```
flutter test --coverage -r json > unit-test-results.json
```
## Example:
```
{"protocolVersion":"0.1.1","runnerVersion":"1.22.0","pid":28845,"type":"start","time":0}
{"suite":{"id":0,"platform":"vm","path":"/Users/<>/repo/flutter-app-template/test/widget_test.dart"},"type":"suite","time":0}
{"test":{"id":1,"name":"loading /Users/<>/repo/flutter-app-template/test/widget_test.dart","suiteID":0,"groupIDs":[],"metadata":{"skip":false,"skipReason":null},"line":null,"column":null,"url":null},"type":"testStart","time":0}
{"count":1,"time":2,"type":"allSuites"}
{"testID":1,"result":"success","skipped":false,"hidden":true,"type":"testDone","time":3875}
{"group":{"id":2,"suiteID":0,"parentID":null,"name":"","metadata":{"skip":false,"skipReason":null},"testCount":1,"line":null,"column":null,"url":null},"type":"group","time":3876}
{"test":{"id":3,"name":"Counter increments smoke test","suiteID":0,"groupIDs":[2],"metadata":{"skip":false,"skipReason":null},"line":154,"column":5,"url":"package:flutter_test/src/widget_tester.dart","root_line":6,"root_column":3,"root_url":"file:///Users/<>/repo/flutter-app-template/test/widget_test.dart"},"type":"testStart","time":3876}
{"testID":3,"result":"success","skipped":false,"hidden":false,"type":"testDone","time":4161}
{"success":true,"type":"done","time":4198}
```


## To get a JSON report for integration tests, we run the following:
```
flutter test integration_test --coverage -r json > integration-test-results.json
```
## Example (bad):
```
{"protocolVersion":"0.1.1","runnerVersion":"1.22.0","pid":28447,"type":"start","time":0}
{"suite":{"id":0,"platform":"vm","path":"/Users/<>/repo/flutter-app-template/integration_test/app_test.dart"},"type":"suite","time":0}
{"test":{"id":1,"name":"loading /Users/<>/repo/flutter-app-template/integration_test/app_test.dart","suiteID":0,"groupIDs":[],"metadata":{"skip":false,"skipReason":null},"line":null,"column":null,"url":null},"type":"testStart","time":0}
{"count":1,"time":2,"type":"allSuites"}
Running Gradle task 'assembleDebug'...                              6.8s
✓  Built build/app/outputs/flutter-apk/app-debug.apk.
Installing build/app/outputs/flutter-apk/app-debug.apk...          386ms
{"testID":1,"result":"success","skipped":false,"hidden":true,"type":"testDone","time":8901}
{"group":{"id":2,"suiteID":0,"parentID":null,"name":"","metadata":{"skip":false,"skipReason":null},"testCount":3,"line":null,"column":null,"url":null},"type":"group","time":8903}
{"group":{"id":3,"suiteID":0,"parentID":2,"name":"Flutter Example","metadata":{"skip":false,"skipReason":null},"testCount":3,"line":19,"column":3,"url":"file:///Users/<>/repo/flutter-app-template/Users/<>/repo/flutter-app-template/integration_test/app_test.dart"},"type":"group","time":8903}
{"test":{"id":4,"name":"Flutter Example starts at 0","suiteID":0,"groupIDs":[2,3],"metadata":{"skip":false,"skipReason":null},"line":154,"column":5,"url":"package:flutter_test/src/widget_tester.dart"},"type":"testStart","time":8904}
{"testID":4,"result":"success","skipped":false,"hidden":false,"type":"testDone","time":9475}
{"test":{"id":5,"name":"Flutter Example increments the counter","suiteID":0,"groupIDs":[2,3],"metadata":{"skip":false,"skipReason":null},"line":154,"column":5,"url":"package:flutter_test/src/widget_tester.dart"},"type":"testStart","time":9475}
{"testID":5,"result":"success","skipped":false,"hidden":false,"type":"testDone","time":9995}
{"test":{"id":6,"name":"Flutter Example increments the counter during animation","suiteID":0,"groupIDs":[2,3],"metadata":{"skip":false,"skipReason":null},"line":154,"column":5,"url":"package:flutter_test/src/widget_tester.dart"},"type":"testStart","time":9996}
{"testID":6,"result":"success","skipped":false,"hidden":false,"type":"testDone","time":10272}
{"test":{"id":7,"name":"(tearDownAll)","suiteID":0,"groupIDs":[2],"metadata":{"skip":false,"skipReason":null},"line":42,"column":5,"url":"package:integration_test/integration_test.dart"},"type":"testStart","time":10273}
{"testID":7,"result":"success","skipped":false,"hidden":true,"type":"testDone","time":10281}
{"success":true,"type":"done","time":10567}
```
## Example (fixed):
```
{"protocolVersion":"0.1.1","runnerVersion":"1.22.0","pid":28447,"type":"start","time":0}
{"suite":{"id":0,"platform":"vm","path":"/Users/<>/repo/flutter-app-template/integration_test/app_test.dart"},"type":"suite","time":0}
{"test":{"id":1,"name":"loading /Users/<>/repo/flutter-app-template/integration_test/app_test.dart","suiteID":0,"groupIDs":[],"metadata":{"skip":false,"skipReason":null},"line":null,"column":null,"url":null},"type":"testStart","time":0}
{"count":1,"time":2,"type":"allSuites"}
{"testID":1,"result":"success","skipped":false,"hidden":true,"type":"testDone","time":8901}
{"group":{"id":2,"suiteID":0,"parentID":null,"name":"","metadata":{"skip":false,"skipReason":null},"testCount":3,"line":null,"column":null,"url":null},"type":"group","time":8903}
{"group":{"id":3,"suiteID":0,"parentID":2,"name":"Flutter Example","metadata":{"skip":false,"skipReason":null},"testCount":3,"line":19,"column":3,"url":"file:///Users/<>/repo/flutter-app-template/Users/<>/repo/flutter-app-template/integration_test/app_test.dart"},"type":"group","time":8903}
{"test":{"id":4,"name":"Flutter Example starts at 0","suiteID":0,"groupIDs":[2,3],"metadata":{"skip":false,"skipReason":null},"line":154,"column":5,"url":"package:flutter_test/src/widget_tester.dart"},"type":"testStart","time":8904}
{"testID":4,"result":"success","skipped":false,"hidden":false,"type":"testDone","time":9475}
{"test":{"id":5,"name":"Flutter Example increments the counter","suiteID":0,"groupIDs":[2,3],"metadata":{"skip":false,"skipReason":null},"line":154,"column":5,"url":"package:flutter_test/src/widget_tester.dart"},"type":"testStart","time":9475}
{"testID":5,"result":"success","skipped":false,"hidden":false,"type":"testDone","time":9995}
{"test":{"id":6,"name":"Flutter Example increments the counter during animation","suiteID":0,"groupIDs":[2,3],"metadata":{"skip":false,"skipReason":null},"line":154,"column":5,"url":"package:flutter_test/src/widget_tester.dart"},"type":"testStart","time":9996}
{"testID":6,"result":"success","skipped":false,"hidden":false,"type":"testDone","time":10272}
{"test":{"id":7,"name":"(tearDownAll)","suiteID":0,"groupIDs":[2],"metadata":{"skip":false,"skipReason":null},"line":42,"column":5,"url":"package:integration_test/integration_test.dart"},"type":"testStart","time":10273}
{"testID":7,"result":"success","skipped":false,"hidden":true,"type":"testDone","time":10281}
{"success":true,"type":"done","time":10567}
```