Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Flutter supports coverage and machine in 1.18.0 #19

Closed
kuhnroyal opened this issue May 27, 2020 · 7 comments
Closed

Flutter supports coverage and machine in 1.18.0 #19

kuhnroyal opened this issue May 27, 2020 · 7 comments

Comments

@kuhnroyal
Copy link
Contributor

Starting with 1.18.0/beta Flutter supports running tests with --coverage --machine at the same time. However the test output has somewhat changed. See flutter/flutter#56675

I am not sure if the changes in the output are a problem, I have not used sonar-flutter yet but I want to once Flutter 1.18.0 is stable.

Maybe someone can test this and eventually update the docs.

@stephanecodes
Copy link
Contributor

stephanecodes commented May 27, 2020

Just switched to 1.19.0-0.0.pre branch and made a quick test.

$ flutter test --machine --coverage >tests.output
$ sonar-scanner

throws an Exception

ERROR: Error during SonarScanner execution
java.lang.NullPointerException
	at fr.insideapp.sonarqube.flutter.tests.FlutterTestReportParser.parse(FlutterTestReportParser.java:58)
	at fr.insideapp.sonarqube.flutter.tests.FlutterTestReportParser.parse(FlutterTestReportParser.java:42)
	at fr.insideapp.sonarqube.flutter.tests.FlutterTestSensor.execute(FlutterTestSensor.java:57)

BUT

$ flutter test --machine > tests.output
$ flutter test --coverage
$ sonar-scanner

works as intended (assuming you're not using SonarQube 8.1+)

So you can use the second solution 😉

@kuhnroyal
Copy link
Contributor Author

Thanks for the test, I know the second way works but the goal would be to have the same outcome in one run and reduce build times by several minutes :)

@stephanecodes
Copy link
Contributor

stephanecodes commented May 27, 2020

I know the second way works

You said you have not used sonar-flutter yet, that's why I made the tests 🤔

btw, I'm not sure using both options will reduce the total time. I don't see any difference but maybe my project is not as large as yours.

@kuhnroyal
Copy link
Contributor Author

Yes, the correct way of saying would have been I would have assumed the second way works because it is the one that is promoted in the docs. 🙂

The tests run for a couple minutes so running them twice is twice the time.

@stephanecodes
Copy link
Contributor

I created a PR #22 to fix this issue.

If you want to test it, here is the fixed jar :
sonar-flutter-plugin-0.2-1-fix13.zip

@kuhnroyal
Copy link
Contributor Author

I added #25 which builds up on #22 and further improves test parsing, wrong test counts and duration.

@zippy1978
Copy link
Contributor

Hi,
@kuhnroyal PR's are merged and available in release 0.3.0.
I'm closing the issue.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants