Migrate tests to use pubCommand from `package:pub/pub.dart` or use dartdev?
Ideally, we would run our tests against dartdev, but that's probably a little hard to do unless we merge this repository in Dart SDK.
And in practice running tool/test-bin/pub_command_runner.dart is probably close enough -- so long as we have a few smoke tests in dartdev too (inside the Dart SDK).
Hence, I suggest we slowly refactor our tests to run against pub_command_runner.dart. Steps:
- [ ] Create utilities similar to
test/test_pub.dartforpub_command_runner.dart - [ ] Ensure that we have snapshotting for
pub_command_runner.dart- Can do AOT snapshot?
- Do we need to test
dart pub run, or can settle with unit testing forgetExecutableForCommand? - Do we need more integration tests in
dartdevcoveringgetExecutableForCommand?
- [ ] Migrate test files to use
pub_command_runner.dart.
We could also explore if we export our tests in a manner that allows them to run against dartdev in the Dart SDK.
Yeah - I don't see any easy way to do the full tests with dartdev on each github commit.
Maybe we can make the tests oblivious to which command it is using (we already take the snapshot as an environment variable), and have the sdk trybots use dart pub for running the full pub test suite, while the tests run locally and on github uses tool/test-bin/pub_command_runner.dart?
W.r.t. dart run we should probably examine what tests we have in the sdk, and expand if we feel they are not good enough.
Still would be nice to get done