Skip to content

Support running individual test files from Dart-Code's test suite #5604

@DanTup

Description

@DanTup

Currently when you run npm test it runs all tests (either for all bots, or for a single bot if the BOT env var is set).

It would be convenient to be able to run individual files with npm test foo and have it run any of the test files that contain "foo".

To do this, we need to:

  • ensure npm test passes any additional args to npm test-only
  • ensure npm test-only passes the additional args to ./out/src/test/test_all.js (and ideally skip npm run test-grammar if args are passed)
  • have test_all.ts (which compiles to test_all.js) pass these args in an env variable when invoking vstest.runTests
  • read the env variable in test_runner.ts (which is imported into each test suites index.ts to tun tests) and include it in the pattern used for locating the test files

To verify this is done, set BOT=dart and try tunning some of the test files like:

npm test autolaunch

This should run only the files from dart/debug/autolaunch.test.ts.

Running npm test without any args (but still with BOT=dart) should run all of the standard Dart test suite tests.

The changes must work for all platforms, including Windows.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions