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
The flutter test
command should require a flutter_test
or test_api
dependency (and check for it).
#91107
Comments
Would it make sense to test for the right version of test_api, rather than flutter_test? (In the message we should suggest depending on flutter_test, certainly, but I feel like if someone is doing the dance to point to the right test_api version that should work too; they don't have to use flutter_test with |
I would probably just depend on flutter_test, as it will take into account all the possible deps and make sure they are compatible. Being an sdk dependency it is already downloaded and essentially free (assuming it's a dev dependency). In practice it's likely that just enforcing test_api is compatible would fix most issues though. |
I guess asking for it to be in the pubspec.yaml as a dev dependency is probably ok. It doesn't require actually importing it. |
Note dart-lang/test#1977, this is another good example of why we should be requiring this dependency even if people don't use the package as an import. |
This is also what If any tool is going to operate with packages from the pub solve, but not be installed with that same pub solve, it should validate any assumptions it makes about how it can operate with those packages. From the user standpoint a |
DevTools just faced the issue |
Not sure if it was mentiond already but wanted to point out that in the documentation of flutter it is written that
|
That documentation should also be updated as well to just always tell you to add the It feels a bit weird, but it does make sense, based on how the |
This package does not have a dependency on `flutter_test` and so there is no guarantee that the version of `test_api` from the pub solve is compatible with the `flutter test` command. See flutter/flutter#91107
flutter test
command should require a flutter_test
dependency.flutter test
command should require a flutter_test
or test_api
dependency (and check for it).
@christopherfujino - is this something we could address in the near term? We see issues related to this when we make changes to I believe the desired resolution here is still the one from the first comment? ( |
SGTM |
This issue is assigned to @christopherfujino but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks! |
@christopherfujino this is about to come up again when we change the wire format for the I think we can probably make it backwards compatible, but it would be great if we didn't have to, otherwise we are stuck with this tech debt until we decide to knowingly break users on some older version of flutter. |
@jakemac53 thanks for the heads up! Assigning @eliasyishak to fix. |
@eliasyishak is this still on your radar? |
Still tracking on my todos but haven't got around to it yet as I figure out how to handle the breaking change that comes with it |
Use case
The
flutter test
command itself is built with a certain version of thetest
package (whatever is pinned in the repo at the time the SDK was published). If a user is only using the regulartest
package, then there is nothing to ensure that the version is compatible with that of theflutter test
command.See #91059 as an example failure.
Proposal
The
flutter test
command should check for a dependency onflutter_test
, and fail (or at least warn) if one does not exist. This package pins thetest_api
package to a compatible version, solving the issue.The text was updated successfully, but these errors were encountered: