Skip to content

flutter_test does not use the latest version of test_api #81294

@iapicca

Description

@iapicca

to reproduce

  • create a package that depends on the latest version of test (at the time of writing test: ^1.17.2)
  • create an app based on the latest master (see doctor below)
  • add the package to the dev_dependencies
  • run flutter pub get

expected result

  • flutter_test should be up-to-date with the latest version of test
  • a possible error message should be "understandable"

actual result

  • flutter_test is not up-to-date with test more specifically test_api (^0.4.0 at the time of writing)
  • the error message is not informative and misleading
    • Minimum version ("0.4.0") minimum version of what?
    • immediately direct the user to filing an issue
flutter pub get
$ flutter pub get
Invalid argument(s): Minimum version ("0.4.0") must be less than maximum ("0.4.0-0").
package:pub_semver/src/version_range.dart 67:7      new VersionRange    
package:pub/src/solver/reformat_ranges.dart 56:27   _reformatTerm       
package:pub/src/solver/reformat_ranges.dart 34:26   reformatRanges.<fn> 
dart:_internal                                      ListIterable.toList 
package:pub/src/solver/reformat_ranges.dart 35:12   reformatRanges      
package:pub/src/solver/reformat_ranges.dart 133:25  _reformatCause      
package:pub/src/solver/reformat_ranges.dart 36:7    reformatRanges      
package:pub/src/solver/reformat_ranges.dart 133:25  _reformatCause      
package:pub/src/solver/reformat_ranges.dart 36:7    reformatRanges      
package:pub/src/solver/reformat_ranges.dart 133:25  _reformatCause      
package:pub/src/solver/reformat_ranges.dart 36:7    reformatRanges      
package:pub/src/solver/reformat_ranges.dart 133:25  _reformatCause      
package:pub/src/solver/reformat_ranges.dart 36:7    reformatRanges      
package:pub/src/solver/reformat_ranges.dart 133:25  _reformatCause      
package:pub/src/solver/reformat_ranges.dart 36:7    reformatRanges      
package:pub/src/solver/version_solver.dart 308:24   VersionSolver._resolveConflict
package:pub/src/solver/version_solver.dart 129:27   VersionSolver._propagate
package:pub/src/solver/version_solver.dart 93:11    VersionSolver.solve.<fn>
===== asynchronous gap ===========================                      
package:pub/src/source/hosted.dart 635:14           BoundHostedSource.withPrefetching.<fn>
===== asynchronous gap ===========================                      
package:pub/src/rate_limited_scheduler.dart 110:14  RateLimitedScheduler.withPrescheduling
===== asynchronous gap ===========================                      
package:pub/src/source/hosted.dart 634:12           BoundHostedSource.withPrefetching
===== asynchronous gap ===========================                      
package:pub/src/solver/version_solver.dart 90:14    VersionSolver.solve 
===== asynchronous gap ===========================                      
package:pub/src/entrypoint.dart 233:18              Entrypoint.acquireDependencies
This is an unexpected error. Please run                                 
                                                                        
    dart pub --trace get --no-precompile                                
                                                                        
and include the logs in an issue on https://github.com/dart-lang/pub/issues/new
Running "flutter pub get" in <****some_app****> ...                              
pub get failed (1; and include the logs in an issue on https://github.com/dart-lang/pub/issues/new)

only flutter pub get -v refer the actual package/packages causing the issue

flutter pub get -v (partial)
[   +1 ms] SLVR:   fact: no versions of <****some_package****> match >=0.4.0 <0.4.0+0
[        ] SLVR:   conflict: no versions of <****some_package****> match >=0.4.0 <0.4.0+0
[        ] SLVR:   ! <****some_package****> >=0.4.0 <0.4.0+0 is partially satisfied by not <****some_package****> >=0.4.0+0
[        ] SLVR:   ! which is caused by "<****some_package****> >=0.4.0+0 depends on test ^1.17.1"
[        ] SLVR:   ! thus: <****some_package****> >=0.4.0 requires test ^1.17.1
[        ] SLVR:   ! not test ^1.17.1 is satisfied by not test >=1.17.0
[        ] SLVR:   ! which is caused by "test >=1.17.0 depends on test_api 0.4.0"
[        ] SLVR:   ! thus: <****some_package****> >=0.4.0 requires test_api 0.4.0
[        ] SLVR:   ! not test_api 0.4.0 is satisfied by test_api 0.3.0
[        ] SLVR:   ! which is caused by "every version of flutter_test from sdk depends on test_api 0.3.0"
[        ] SLVR:   ! thus: <****some_package****> >=0.4.0 is incompatible with flutter_test from sdk
[        ] SLVR:   ! flutter_test any from sdk is satisfied by flutter_test any from sdk
[        ] SLVR:   ! which is caused by "<****some_app****> depends on flutter_test any from sdk"
[        ] SLVR:   ! thus: <****some_package****> >=0.4.0 is forbidden
[        ] SLVR:   ! <****some_package****> >=0.4.0 is satisfied by <****some_package****> ^0.4.0
[        ] SLVR:   ! which is caused by "<****some_app****> depends on <****some_package****> ^0.4.0"
[        ] SLVR:   ! thus: version solving failed
[   +2 ms] SLVR: Version solving took 0:00:02.930735 seconds.
doctor
[✓] Flutter (Channel master, 2.3.0-1.0.pre.105, on Linux, locale en_US.UTF-8)
    • Flutter version 2.3.0-1.0.pre.105 at /home/yakforward/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 3eb5736134 (2 hours ago), 2021-04-27 07:49:08 -0400
    • Engine revision 9e4b4e23a3
    • Dart version 2.14.0 (build 2.14.0-47.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /home/yakforward/Android/Sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /snap/android-studio/101/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

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

[✓] Linux toolchain - develop for Linux desktop
    • Ubuntu clang version 12.0.0-1ubuntu1
    • cmake version 3.18.4
    • ninja version 1.10.1
    • pkg-config version 0.29.2

[✓] Android Studio (version 4.1)
    • Android Studio at /snap/android-studio/101/android-studio
    • Flutter plugin version 55.1.1
    • Dart plugin version 201.9335
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Linux
    • Chrome (web)    • chrome • web-javascript • Google Chrome 90.0.4430.85

• No issues found!

proposal

  • would be nice to have some automation that updates flutter_test when a new release of test_api is released
  • the error message could be more clear

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: qualityA truly polished experiencea: tests"flutter test", flutter_test, or one of our testsc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterr: fixedIssue is closed as already fixed in a newer versiontoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions