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

Support for --machine in very_good test #331

Open
davidmartos96 opened this issue Mar 21, 2022 · 14 comments
Open

Support for --machine in very_good test #331

davidmartos96 opened this issue Mar 21, 2022 · 14 comments
Labels
bug Something isn't working as expected feature A new feature or request

Comments

@davidmartos96
Copy link

davidmartos96 commented Mar 21, 2022

Description
Support for the --machine option from flutter test. It provides a way to output a summary of the tests that were executed. How many failed, how long they took, etc... This output is useful to then convert it to popular formats such as an XML JUnit report, which can be interpreted by different other tools, like CI/CD platforms or IDEs. One tool to convert this output is https://pub.dev/packages/junitreport

On a dart test, the report output is obtained with --reporter json, not with --machine

@davidmartos96 davidmartos96 added the bug Something isn't working as expected label Mar 21, 2022
@nilsreichardt
Copy link

nilsreichardt commented Apr 7, 2022

Are there any reasons why very_good does not support passing arguments with the -- operator, like very_good test -- --machine? npm uses the -- operator as well (npm/npm#5518).

cc: @marcossevilla

@felangel
Copy link
Contributor

felangel commented Apr 7, 2022

Are there any reasons why very_good does not support passing arguments with the -- operator, like very_good test -- --machine? npm uses the -- operator as well (npm/npm#5518).

cc: @marcossevilla

The goal is not to expose an API that mirrors the underlying flutter/dart tool APIs. We wanted the CLI to serve as an abstraction above existing tooling so we didn't want to tightly couple them by proxying commands/options directly. Also, the CLI is using package:args which has a standard way of defining CLI flags and options. If we accepted -- and proxied them then they wouldn't be properly documented in the CLI usage (via --help).

Hope that helps 👍

@nilsreichardt
Copy link

Ah, thanks for the detailed answer!

@davidmartos96
Copy link
Author

Isn't the requested feature valid?
I agree that mirroring with -- would not be ideal, but maybe some equivalent option for the test command would help for this use case?

@felangel felangel reopened this Apr 7, 2022
@felangel
Copy link
Contributor

felangel commented Apr 7, 2022

Yup reopening this to track the lack of support for --machine

@agacemi
Copy link
Contributor

agacemi commented Jul 5, 2022

Hi @felangel

any update for this feature. We need to generate also a json file for sonar or other tools. We tried to open a PR to add this option or an equivalent option. We discovered that --reporter=json is already added to flutter test command but the output is mapped to a list of objects.

thanks for your help

@justinschier
Copy link

Big +1! It would really help us out to have machine readable output.

@BeatriceMitchell BeatriceMitchell added the feature A new feature or request label Jul 11, 2022
@felangel
Copy link
Contributor

Hey all, just want to give an update:

This is in on our radar but we probably won't get to it for a couple of weeks. We're more than happy to review any PRs in the meantime if this is urgent/blocking for folks.

@jackgllghr
Copy link

Added a PR here: #473
We require this for our CI pipelines, it's the only thing stopping us from migrating to very_good (it's cutting our test runs to 30% of their original run time!)

@BeatriceMitchell BeatriceMitchell linked a pull request Aug 4, 2022 that will close this issue
7 tasks
@Thelm76
Copy link

Thelm76 commented Nov 2, 2022

It would be great to get this option.... I'm looking forward to it, it is mandatory for my project in order to use it in our pipelines

@justinschier
Copy link

Any news on this feature by chance?

@DFelten
Copy link

DFelten commented Jun 24, 2023

This would be a really useful feature for our GitHub pipeline.

We're using very_good with optimization and it's a lot faster than the default tests. But unfortunately it's not possible to use an action like Test Reporter because of the missing json summary file.

@Thelm76
Copy link

Thelm76 commented Feb 27, 2024

Hello! I think this is not an issue anymore since VGC test supports "vanilla" parameters using -- (added to documentation with #840 )

Just be careful not to use --machine or --report as they modify stdout used by the cli to know test statuses. You should use --file-report=<reportType>:<path> as so :
very_good test --coverage -- --file-reporter json:test.txt

@DFelten
Copy link

DFelten commented Apr 4, 2024

I tried the file-reporter parameter. The test therefore takes four times as long. Is that expected?

very_good test --optimization --coverage -> 00:29 +641 ~2: All tests passed!

very_good test --optimization --coverage -- --file-reporter json:test_reports/dd_test_report.json -> 01:53 +641 ~2: All tests passed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected feature A new feature or request
10 participants