Skip to content

fix: test_optimization not compatible with dart version < 2.19.0 #671

@MauriMiguez

Description

@MauriMiguez

Description
Using very_good_cli 0.12.0 but having a dart sdk version lower that 2.19.0, running tests with --optimization flag will throw the following error:

Unable to install dependencies for hook: /Users/mauricio.miguez/.mason-cache/bundled/test_optimizer_0.1.0+1_fd7e6e6a330b90af245996307b1cb097bdbf6531/hooks.
Error: The current Dart SDK version is 2.18.3.

Because hooks requires SDK version >=2.19.0 <3.0.0, version solving failed.

Steps To Reproduce

  1. Install very_good_cli version 0.12.0
  2. Create a dart (or flutter) package
  3. Define dart sdk version in pubspec.yaml to allow it to be less than 2.19.0 (example sdk: ">=2.18.6 <3.0.0")
  4. Run very_good test with --optimization. This is how I run it: very_good test -j 4 --optimization --coverage --test-randomize-ordering-seed random

Expected Behavior
Be able to run the tests without a dependency for hook error.

Screenshots
image

Additional Context
In my local machine I can easily fix it by having an older version of the very_good_cli in which the test_optimizer does not require SDK version to be >=2.19.0 <3.0.0. But, this is not the case when running a very_good_workflow (both flutter and dart package workflows) since even though there is a way of specifying the dart o flutter version, there is no way of specifying the very_good_cli version it is using to run the tests (at least that I am aware of).

Just in case, im referring to these workflows:
VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml@v1
VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1

Side note: for the time being I have disable test_optimization by setting it to false so workflows can continue to run tests without issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions