pub icon indicating copy to clipboard operation
pub copied to clipboard

Migrate tests to use pubCommand from `package:pub/pub.dart` or use dartdev?

Open jonasfj opened this issue 4 years ago • 2 comments

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.dart for pub_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 for getExecutableForCommand?
    • Do we need more integration tests in dartdev covering getExecutableForCommand?
  • [ ] 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.

jonasfj avatar Oct 19 '21 12:10 jonasfj

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.

sigurdm avatar Oct 25 '21 08:10 sigurdm

Still would be nice to get done

sigurdm avatar Sep 04 '25 08:09 sigurdm