-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
What version of Turborepo are you using?
1.1.9
What package manager are you using / does the bug impact?
Yarn v1
What operating system are you using?
Mac
Describe the Bug
When running a command like turbo run test, I would expect it to build the graph of tasks to run based on packages that actually define a test task. Instead, it seems like it assumes that all packages contain that task which results in needlessly running all tasks that would be dependencies.
In the case of the reproducer below, only the bar package contains a test script with a dependency on foo. The build task in baz was executed despite the output of it not being required for executing the requested tasks.
Expected Behavior
Only packages that actually contain the tasks to run should be considered when building the task graph.
To Reproduce
- Clone https://github.com/dcherman/turborepo-bad-script-reproducer
yarn installyarn reproduce
Since only bar has a test script, I expected to see the build task from foo and bar run followed by the test task from bar. The build task of baz runs despite it having no test task and it not being a dependency of either of the other packages.
Here's an image of the graph that's generated from running turbo run test --graph
Note that the both the foo and baz tasks contain a node for the test task despite not actually defining a test task in package.json.