Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Customizable flutter test command #2915

Closed
bencehornak opened this issue Oct 30, 2020 · 0 comments · Fixed by #2916
Closed

Customizable flutter test command #2915

bencehornak opened this issue Oct 30, 2020 · 0 comments · Fixed by #2916
Labels
in testing Relates to test execution of Dart/Flutter tests for end users is enhancement
Milestone

Comments

@bencehornak
Copy link
Contributor

Is your feature request related to a problem? Please describe.
I want to customize the execution of some flutter tests on my development machine. For example, there are some tests I don't want to run locally, only in a CI environment. I could achieve this by adding --exclude-tags my-tag args to the flutter test command of the extension. Another example is, that I would love to add --coverage flag to the flutter test command, to generate test coverage report.

Describe the solution you'd like
The existing list of ...AdditionalArgs configuration properties (flutterAdditionalArgs, pubAdditionalArgs, analyzerAdditionalArgs, vmAdditionalArgs, buildRunnerAdditionalArgs) could be extended by the proposed flutterTestAdditionalArgs, whose value would be added to the args of the flutter test command.

Describe alternatives you've considered

  • I tried to add --coverage to flutterAdditionalArgs, which worked for the tests, but made the regular debug sessions fail
  • I tried to use dart_test.yaml, though currently flutter test doesn't support profiles, so I cannot create distinct environment for the development and the CI
  • I created the following launch configuration and added the extra args there, but it did not have impact on other ways I can launch tests (e.g. using the Dart: Run all Tests command or clicking the Debug button above the declaration of the test group)
{
    "name": "Run tests",
    "type": "dart",
    "request": "launch",
    "program": "./test/",
    "args": ["--coverage", "exclude_tags", "my-tag"]
},
@DanTup DanTup added the in testing Relates to test execution of Dart/Flutter tests for end users label Nov 3, 2020
@DanTup DanTup added this to the v3.17.0 milestone Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in testing Relates to test execution of Dart/Flutter tests for end users is enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants