feat(test-runner): minimal proof-of-concept scheduler API #16698
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proof-of-concept for #14895 (comment).
About
This PR introduces a proof-of-concept, minimal user-facing scheduling API that attempts to address a variety of longstanding issues and feature requests.
At this point, the implementation details should be ignored (although look if you want a puzzle 😄 ). However, the PR serves to allow us to concretely discuss a proposed solution, the general test strategy (which will apply regardless of the solution/API), articulate pros/cons/problems, etc. (The implementation is currently enough so that we can play around with the proposed public API to get a feel for it in the context of the use cases it attempts to solve.)
API Overview
This introduces a
projectSchedule?: string[][]
configuration option at the top-level, which can be used in combination with the already existingprojects
configuration option to guarantee which projects run in relation to others.Using it looks something like:
In this case, this simply means: run all tests in the My Setup project, when that's done run all the tests in Desktop and Mobile project in parallel, then run My Teardown project.
Issues Addressed
From memory, there are other issues (and Slack conversations) that fall into some of the buckets above, too.
Pros
Cons/Limitations/Questions
When using
projectSchedule
:shard
option: if you're using the schedule, you can quasi-shard with the schedule itselfIn the above example, if I want to run Desktop project, but not Mobile, how do we express this? Presumably we need to run My Setup and My Teardown, too.
We're not exposing a full-featured DAG, so dependency expression is limited (I think for the better, for now — although we can do some really neat scheduling optimizations in the future with 1 timing run + the DAG).
We don't guarantee projects run on the same worker/process, so you can't, for instance, start a webserver in memory in My Setup and kill it in My Teardown. Although, in this case you can just use the
webServer
config option, or write a PID in your setup, then read and kill that PID in your teardown.