VeryGoodOpenSource / very_good_cli

A Very Good Command-Line Interface for Dart created by Very Good Ventures 🦄
http://cli.vgv.dev
MIT License
2.15k stars 188 forks source link

fix: `very_good test` fails to run on Dart project despite `package:test` being present #415

Closed orestesgaolin closed 2 years ago

orestesgaolin commented 2 years ago

Description Getting following error when running tests in this repository:

very_good test --no-optimization
Running "flutter test" in /Users/dominik/Projects/_vgv/very_good_cli...
Error: cannot run without a dependency on either "package:flutter_test" or "package:test". 
Ensure the following lines are present in your pubspec.yaml:

dev_dependencies:
  flutter_test:
    sdk: flutter

Steps To Reproduce

  1. Clone https://github.com/VeryGoodOpenSource/very_good_cli/
  2. Go to the cloned directory cd very_good_cli
  3. Execute flutter pub get
  4. Run very_good test --no-optimization

Expected Behavior

All the tests are run as the test package is present in the main pubspec.yaml:

dev_dependencies:
  build_runner: ^2.0.0
  build_verify: ^3.0.0
  build_version: ^2.0.0
  mocktail: ^0.2.0
  test: ^1.17.0
renancaraujo commented 2 years ago

After going through the steps, could not reproduce that error. Is the command activated from the source or a specific version?

wolfenrain commented 2 years ago

Can't reproduce here either, will close it for now. If you have more information feel free to reopen so we can discuss it further.

Amir-P commented 1 year ago

Facing the same issue. Running very_good test works fine on my machine but not working on GitLab CI. I made sure that it's being run in correct directory and even checked pubspec.yaml content before running very_good test on CI and everything looks good. Any idea what can be the problem?

Log:

Running "flutter test" in /builds/org/repo
✓ Optimizing tests (13.2s)
Error: cannot run without a dependency on either "package:flutter_test" or "package:test". Ensure the following lines are present in your pubspec.yaml:
dev_dependencies:
  flutter_test:
    sdk: flutter

pubspec.yaml:

...

dev_dependencies:
  flutter_test:
    sdk: flutter

...
renancaraujo commented 1 year ago

@Amir-P can you open a new issue with a step-by-step reproducible sample?