Repository navigation
Conversation
sengjea
force-pushed
the
override-bindings
branch
3 times, most recently
from
November 3, 2026 16:28
e3d6a59 to
55a4614
Compare
…s a key Tasks often create things for themselves, such as clients of other services, which leaves a graph with no way to give it fakes in a test. taskgraphtest.RunWithOverrides runs a graph with the tasks providing the keys of some bindings replaced by them. The replaced tasks do not run. Replacing tasks is for tests, so it is not part of the Graph API: the engine's support is reached through an internal package, which nothing outside this module can import, and taskgraphtest is the only package which exposes it. Graph.Run and Graph.Check are unchanged, and an input for a key which a task provides is still a duplicate binding, so a key is only ever replaced on purpose. Overriding a key no task provides, or only some of the keys a task provides, is an error, as is overriding a key twice or a key which is also an input. An absent override replaces the task with a failure. Overrides are part of the Binder returned, and inputs only a replaced task needed are no longer required. CheckWithOverrides validates them without running the graph. Skipped tasks are not signalled by the tasks they depend on, which would otherwise block on a channel with no receiver. Overrider holds one set of overrides for code which runs several graphs, such as an operator with a graph to create and one to delete: each graph takes the overrides for the keys it provides, and Check finds any which are for none of them. taskgraphtest's Test and Suite take Overrides, those of a Test replacing those of its Suite for the same key.
sengjea
force-pushed
the
override-bindings
branch
from
November 3, 2026 17:05
55a4614 to
0fb03f6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Tasks often create things for themselves, such as clients of other services, which leaves a graph with no way to give it fakes in a test. An input wrapped in Override replaces the task providing its key, which does not run, instead of being a duplicate binding.
A plain input for a provided key is still an error, so a key is only ever replaced on purpose. Overriding a key no task provides, or only some of the keys a task provides, is an error too, as is overriding a key twice. An absent override replaces the task with a failure. Overrides are part of the Binder returned from Run, and inputs only a replaced task needed are no longer required. Graph.Check validates overrides.
Skipped tasks are not signalled by the tasks they depend on, which would otherwise block on a channel with no receiver.
taskgraphtest's Test and Suite take Overrides, those of a Test replacing those of its Suite for the same key.