Skip to content

Conversation

jakemac53
Copy link
Contributor

Fixes #2535

  • Adds a hard coded version value to package:test, and a test to ensure it stays in line with the pubspec.
  • Add optional arguments to the test_core apis to accept a version, and use that for the --version option.

Open question: Does this work out of the box for flutter or would they separately have to pass a version?

@jakemac53 jakemac53 requested a review from a team as a code owner September 4, 2025 21:42
@jakemac53 jakemac53 requested a review from natebosch September 4, 2025 21:42
@jakemac53
Copy link
Contributor Author

cc @DanTup

@jakemac53
Copy link
Contributor Author

Ugh, this actually probably won't work - https://github.com/flutter/flutter/blob/8a5c6df06fe2773c6c25c5c2ac13111823b04189/packages/flutter_tools/lib/src/test/test_wrapper.dart#L31C11-L31C15.

package:test is not even a dependency here

Copy link

github-actions bot commented Sep 4, 2025

PR Health

Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

This check can be disabled by tagging the PR with skip-changelog-check.

@jakemac53
Copy link
Contributor Author

@natebosch idk if you have a better solution...

@natebosch
Copy link
Member

@natebosch idk if you have a better solution...

Reading it from the new files that pub writes makes the most sense to me, but I'm not sure if the pub team has any concerns about us taking a dependency on the new file formats.

#2538

@jakemac53
Copy link
Contributor Author

Reading it from the new files that pub writes makes the most sense to me, but I'm not sure if the pub team has any concerns about us taking a dependency on the new file formats.

I do think a hard coded value is concretely better (less flaky, faster, can work in any environment, doesn't require pub at all so it works internally too, etc). But, I don't know how to do it in a way that works for flutter other than putting the value in test_core which would work because of the pinning but seems wrong to do still.

@natebosch
Copy link
Member

which would work because of the pinning but seems wrong to do still.

Yeah I don't think I want to add a new and very concrete blocker for moving to proper semantic versioning between the test runner packages. If the pub team doesn't want external dependencies on these files hardcoding is probably the best set of tradeoffs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"dart test --version" doesn't work in workspace folders
2 participants