-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Root inference: skip turbo.json (#3946)
Integration tests for inferring the root. This demonstrates that detection based upon `turbo.json` (and the change made in #3938) is not (particularly) relevant to root identification. How to review: - Each commit is pretty self-contained. You can see me adding a debug line to assert against in the first commit. - The third commit is both a revert of #3938 and a full deletion of the `turbo.json`-included detection logic. <details> <summary>OUTDATED</summary> There is _one_ behavior change. If you previously: 1. Had nested workspaces (which is not supported by us or any package manager). 2. Had a `turbo.json` at the "outer" one. 3. Did _not_ have a `turbo.json` at the "inner" one Then we would have selected the outer one. We now select the inner one, and throw an error because the inner one does not have a `turbo.json`. I believe this to be an _improvement_. </details> *** #3938 treats any `turbo.json` that has comments in it as nonexistent since `serde_json` doesn't support JSONC. That everything still worked with parsing that is throwing an error made it clear that the `turbo.json` check was not being used except for the described edge case.
- Loading branch information
1 parent
c9c9e2f
commit b75b04d
Showing
58 changed files
with
676 additions
and
56 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
Setup | ||
$ . ${TESTDIR}/../setup.sh | ||
$ . ${TESTDIR}/setup.sh $(pwd) "has-workspaces" | ||
|
||
$ cd $TARGET_DIR && ${TURBO} run build --filter=nothing -vv | ||
[-0-9:.TWZ+]+ \[DEBUG] turborepo_lib::shim: Global turbo version: .* (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turborepo_lib::shim: No local turbo binary found at: .+node_modules/\.bin/turbo (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turborepo_lib::shim: Repository Root: .*/has-workspaces\.t (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turborepo_lib::shim: Running command as global turbo (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turborepo_lib::cli: pkg_inference_root set to "" (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turbo: Found go binary at "[\-\w\/]+" (re) | ||
[-0-9:.TWZ+]+ \[INFO] turbo: skipping turbod since we appear to be in a non-interactive context (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turbo: global hash env vars: vars=\["VERCEL_ANALYTICS_ID"] (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turbo: global hash: value=c1fb8f74a026cdb8 (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turbo: local cache folder: path="" (re) | ||
\xe2\x80\xa2 Packages in scope: (esc) | ||
\xe2\x80\xa2 Running build in 0 packages (esc) | ||
\xe2\x80\xa2 Remote caching disabled (esc) | ||
|
||
No tasks were executed as part of this run. | ||
|
||
Tasks: 0 successful, 0 total | ||
Cached: 0 cached, 0 total | ||
Time:\s*[\.0-9]+m?s (re) | ||
|
||
$ cd $TARGET_DIR/apps/web && ${TURBO} run build --filter=nothing -vv | ||
[-0-9:.TWZ+]+ \[DEBUG] turborepo_lib::shim: Global turbo version: .* (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turborepo_lib::shim: No local turbo binary found at: .+node_modules/\.bin/turbo (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turborepo_lib::shim: Repository Root: .*/has-workspaces\.t (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turborepo_lib::shim: Running command as global turbo (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turborepo_lib::cli: pkg_inference_root set to "apps/web" (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turbo: Found go binary at "[\-\w\/]+" (re) | ||
[-0-9:.TWZ+]+ \[INFO] turbo: skipping turbod since we appear to be in a non-interactive context (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turbo: Using apps/web as a basis for selecting packages (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turbo: global hash env vars: vars=\["VERCEL_ANALYTICS_ID"] (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turbo: global hash: value=c1fb8f74a026cdb8 (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turbo: local cache folder: path="" (re) | ||
\xe2\x80\xa2 Packages in scope: (esc) | ||
\xe2\x80\xa2 Running build in 0 packages (esc) | ||
\xe2\x80\xa2 Remote caching disabled (esc) | ||
|
||
No tasks were executed as part of this run. | ||
|
||
Tasks: 0 successful, 0 total | ||
Cached: 0 cached, 0 total | ||
Time:\s*[\.0-9]+m?s (re) | ||
|
||
$ cd $TARGET_DIR/crates && ${TURBO} run build --filter=nothing -vv | ||
[-0-9:.TWZ+]+ \[DEBUG] turborepo_lib::shim: Global turbo version: .* (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turborepo_lib::shim: No local turbo binary found at: .+node_modules/\.bin/turbo (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turborepo_lib::shim: Repository Root: .*/has-workspaces\.t (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turborepo_lib::shim: Running command as global turbo (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turborepo_lib::cli: pkg_inference_root set to "crates" (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turbo: Found go binary at "[\-\w\/]+" (re) | ||
[-0-9:.TWZ+]+ \[INFO] turbo: skipping turbod since we appear to be in a non-interactive context (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turbo: Using crates as a basis for selecting packages (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turbo: global hash env vars: vars=\["VERCEL_ANALYTICS_ID"] (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turbo: global hash: value=c1fb8f74a026cdb8 (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turbo: local cache folder: path="" (re) | ||
\xe2\x80\xa2 Packages in scope: (esc) | ||
\xe2\x80\xa2 Running build in 0 packages (esc) | ||
\xe2\x80\xa2 Remote caching disabled (esc) | ||
|
||
No tasks were executed as part of this run. | ||
|
||
Tasks: 0 successful, 0 total | ||
Cached: 0 cached, 0 total | ||
Time:\s*[\.0-9]+m?s (re) | ||
|
||
$ cd $TARGET_DIR/crates/super-crate/tests/test-package && ${TURBO} run build --filter=nothing -vv | ||
[-0-9:.TWZ+]+ \[DEBUG] turborepo_lib::shim: Global turbo version: .* (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turborepo_lib::shim: No local turbo binary found at: .+node_modules/\.bin/turbo (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turborepo_lib::shim: Repository Root: .*/has-workspaces\.t (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turborepo_lib::shim: Running command as global turbo (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turborepo_lib::cli: pkg_inference_root set to "crates/super-crate/tests/test-package" (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turbo: Found go binary at "[\-\w\/]+" (re) | ||
[-0-9:.TWZ+]+ \[INFO] turbo: skipping turbod since we appear to be in a non-interactive context (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turbo: Using crates/super-crate/tests/test-package as a basis for selecting packages (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turbo: global hash env vars: vars=\["VERCEL_ANALYTICS_ID"] (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turbo: global hash: value=c1fb8f74a026cdb8 (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turbo: local cache folder: path="" (re) | ||
\xe2\x80\xa2 Packages in scope: (esc) | ||
\xe2\x80\xa2 Running build in 0 packages (esc) | ||
\xe2\x80\xa2 Remote caching disabled (esc) | ||
|
||
No tasks were executed as part of this run. | ||
|
||
Tasks: 0 successful, 0 total | ||
Cached: 0 cached, 0 total | ||
Time:\s*[\.0-9]+m?s (re) | ||
|
||
$ cd $TARGET_DIR/packages/ui-library/src && ${TURBO} run build --filter=nothing -vv | ||
[-0-9:.TWZ+]+ \[DEBUG] turborepo_lib::shim: Global turbo version: .* (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turborepo_lib::shim: No local turbo binary found at: .+node_modules/\.bin/turbo (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turborepo_lib::shim: Repository Root: .*/has-workspaces\.t (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turborepo_lib::shim: Running command as global turbo (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turborepo_lib::cli: pkg_inference_root set to "packages/ui-library/src" (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turbo: Found go binary at "[\-\w\/]+" (re) | ||
[-0-9:.TWZ+]+ \[INFO] turbo: skipping turbod since we appear to be in a non-interactive context (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turbo: Using packages/ui-library/src as a basis for selecting packages (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turbo: global hash env vars: vars=\["VERCEL_ANALYTICS_ID"] (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turbo: global hash: value=c1fb8f74a026cdb8 (re) | ||
[-0-9:.TWZ+]+ \[DEBUG] turbo: local cache folder: path="" (re) | ||
\xe2\x80\xa2 Packages in scope: (esc) | ||
\xe2\x80\xa2 Running build in 0 packages (esc) | ||
\xe2\x80\xa2 Remote caching disabled (esc) | ||
|
||
No tasks were executed as part of this run. | ||
|
||
Tasks: 0 successful, 0 total | ||
Cached: 0 cached, 0 total | ||
Time:\s*[\.0-9]+m?s (re) | ||
|
3 changes: 3 additions & 0 deletions
3
cli/integration_tests/inference/has-workspaces/apps/docs/package.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "docs" | ||
} |
3 changes: 3 additions & 0 deletions
3
cli/integration_tests/inference/has-workspaces/apps/web/package.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "web" | ||
} |
3 changes: 3 additions & 0 deletions
3
...gration_tests/inference/has-workspaces/crates/super-crate/tests/test-package/package.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "test-package" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "inference", | ||
"workspaces": [ | ||
"apps/*", | ||
"packages/*", | ||
"crates/super-crate/tests/test-package" | ||
], | ||
"packageManager": "npm@8.0.0" | ||
} |
3 changes: 3 additions & 0 deletions
3
cli/integration_tests/inference/has-workspaces/packages/eslint-config-custom/package.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "eslint-config-custom" | ||
} |
3 changes: 3 additions & 0 deletions
3
cli/integration_tests/inference/has-workspaces/packages/ui-library/package.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "ui-library" | ||
} |
Empty file.
5 changes: 5 additions & 0 deletions
5
cli/integration_tests/inference/has-workspaces/packages/ui-library/turbo.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"$schema": "https://turbo.build/schema.json", | ||
"extends": ["//"], | ||
"pipeline": {} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Has a comment! | ||
{ | ||
"$schema": "https://turbo.build/schema.json", | ||
"pipeline": { | ||
"build": {} | ||
} | ||
} |
Oops, something went wrong.