patrol icon indicating copy to clipboard operation
patrol copied to clipboard

coverage report name breaks convention with existing flutter plugins

Open lexxxel opened this issue 1 year ago • 2 comments

Steps to reproduce

  1. run patrol test --coverage --merge-coverage integration_test to generate a code coverage report
  2. open VS Code and install Flutter Coverage
  3. click the Watch button in the bottom bar to activate the code coverage report

Actual results

No Coverage because the file name for patrol reports is NOT lcov.info but patrol_lcov.info instead. That is not compliant with the default behaviour of flutter, meaning it can't be used as a dropin replacement.

Logs

Logs
there are no logs

Patrol version

patrol: 3.11.0

Patrol Doctor output

Patrol Doctor output
Patrol doctor:
Patrol CLI version: 3.2.0
Flutter command: flutter 
  Flutter 3.22.3 • channel stable
Android: 
• Program adb found in /usr/bin/adb
• Env var $ANDROID_HOME set to /home/apit/AndroidSDK/

Flutter Doctor output

Flutter Doctor output
[✓] Flutter (Channel stable, 3.22.3, on Gentoo Linux 6.11.0-gentoo, locale en_US.utf8)
    • Flutter version 3.22.3 on channel stable at /home/apit/tools/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision b0850beeb2 (2 months ago), 2024-07-16 21:43:41 -0700
    • Engine revision 235db911ba
    • Dart version 3.4.4
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0-rc2)
    • Android SDK at /home/apit/AndroidSDK/
    • Platform android-34, build-tools 34.0.0-rc2
    • ANDROID_HOME = /home/apit/AndroidSDK/
    • Java binary at: /home/apit/tools/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • clang version 18.1.8
    • cmake version 3.30.2
    • ninja version 1.11.1
    • pkg-config version 2.2.0

[✓] Android Studio (version 2023.2)
    • Android Studio at /home/apit/tools/android-studio/
    • Flutter plugin version 78.4.1
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • android-studio-dir = /home/apit/tools/android-studio/
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)

[✓] Connected device (3 available)
    • sdk gphone x86 (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
    • Linux (desktop)         • linux         • linux-x64      • Gentoo Linux 6.11.0-gentoo
    • Chrome (web)            • chrome        • web-javascript • Google Chrome 129.0.6668.58

[✓] Network resources
    • All expected network resources are available.

• No issues found!

At the end of the day, it should be a simple string change in: https://github.com/leancodepl/patrol/blob/56426c50fbf13ac5d7059fb892b3048d9aff0b43/packages/patrol_cli/lib/src/coverage/coverage_tool.dart#L207

lexxxel avatar Sep 25 '24 21:09 lexxxel

Hi 👋 , maybe we can add a possibility to configure the name of the output file. We also are not sure if this is good approach, it will overwrite flutter -test --coverage file, right @lexxxel?

Kendru98 avatar Sep 26 '24 16:09 Kendru98

Flutter test has two arguments for that: --merge-coverage and --coverage-path to allow multiple coverage files. However, unit test and integration test override each other by default.

lexxxel avatar Sep 26 '24 16:09 lexxxel

Hi @lexxxel I'm not convinced that we should use the coverage/lcov.info path for patrol's coverage by default, but I will add a flag to allow setting custom path. As for your issue with the Flutter Coverage VS Code extension, it looks like it allows custom coverage filenames - see Extension settings section of the extension's marketplace page.

gogolon avatar Oct 07 '24 07:10 gogolon

@gogolon thank you very much. I honestly didn't know about the extension setting, thank you

lexxxel avatar Oct 07 '24 07:10 lexxxel

This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue.

github-actions[bot] avatar Oct 14 '24 08:10 github-actions[bot]