Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Existing and error logs behavior (#4656)
### Description - Adds an integration test for existing behavior (`continue.t`) - Fixes behavior of `--output-logs=errors-only` to match behavior for `full` in the case of a task that errors - Fixes `--continue` behavior to report all failed tasks at the end ### Testing Instructions New `continue.t` integration test. I recommend viewing the changes to that file at each commit to see initial behavior and how it changes. Fixes #4504 link WEB-895
- Loading branch information
Showing
11 changed files
with
208 additions
and
32 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
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
3 changes: 3 additions & 0 deletions
3
turborepo-tests/integration/tests/_fixtures/monorepo_dependency_error/.gitignore
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 @@ | ||
node_modules/ | ||
.turbo | ||
.npmrc |
9 changes: 9 additions & 0 deletions
9
...repo-tests/integration/tests/_fixtures/monorepo_dependency_error/apps/my-app/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,9 @@ | ||
{ | ||
"name": "my-app", | ||
"scripts": { | ||
"build": "echo 'working'" | ||
}, | ||
"dependencies": { | ||
"some-lib": "*" | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...o-tests/integration/tests/_fixtures/monorepo_dependency_error/apps/other-app/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,9 @@ | ||
{ | ||
"name": "other-app", | ||
"scripts": { | ||
"build": "exit 3" | ||
}, | ||
"dependencies": { | ||
"some-lib": "*" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...po-tests/integration/tests/_fixtures/monorepo_dependency_error/apps/some-lib/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,6 @@ | ||
{ | ||
"name": "some-lib", | ||
"scripts": { | ||
"build": "exit 2" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
turborepo-tests/integration/tests/_fixtures/monorepo_dependency_error/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,6 @@ | ||
{ | ||
"name": "monorepo", | ||
"workspaces": [ | ||
"apps/**" | ||
] | ||
} |
9 changes: 9 additions & 0 deletions
9
turborepo-tests/integration/tests/_fixtures/monorepo_dependency_error/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,9 @@ | ||
{ | ||
"$schema": "https://turbo.build/schema.json", | ||
"pipeline": { | ||
"build": { | ||
"dependsOn": ["^build"], | ||
"outputs": [] | ||
} | ||
} | ||
} |
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,85 @@ | ||
Setup | ||
$ . ${TESTDIR}/../../helpers/setup.sh | ||
$ . ${TESTDIR}/_helpers/setup_monorepo.sh $(pwd) monorepo_dependency_error | ||
Run without --continue | ||
$ ${TURBO} build | ||
\xe2\x80\xa2 Packages in scope: my-app, other-app, some-lib (esc) | ||
\xe2\x80\xa2 Running build in 3 packages (esc) | ||
\xe2\x80\xa2 Remote caching disabled (esc) | ||
some-lib:build: cache miss, executing 3494007308f52ad6 | ||
some-lib:build: | ||
some-lib:build: > build | ||
some-lib:build: > exit 2 | ||
some-lib:build: | ||
some-lib:build: npm ERR! Lifecycle script `build` failed with error: | ||
some-lib:build: npm ERR! Error: command failed | ||
some-lib:build: npm ERR! in workspace: some-lib | ||
some-lib:build: npm ERR! at location: (.*)/apps/some-lib (re) | ||
some-lib:build: ERROR: command finished with error: command \((.*)/apps/some-lib\) npm run build exited \(1\) (re) | ||
command \((.*)/apps/some-lib\) npm run build exited \(1\) (re) | ||
|
||
Tasks: 0 successful, 1 total | ||
Cached: 0 cached, 1 total | ||
Time:\s*[\.0-9]+m?s (re) | ||
|
||
ERROR run failed: command exited (1) | ||
[1] | ||
|
||
Run without --continue, and with only errors. | ||
$ ${TURBO} build --output-logs=errors-only | ||
\xe2\x80\xa2 Packages in scope: my-app, other-app, some-lib (esc) | ||
\xe2\x80\xa2 Running build in 3 packages (esc) | ||
\xe2\x80\xa2 Remote caching disabled (esc) | ||
some-lib:build: cache miss, executing 3494007308f52ad6 | ||
some-lib:build: | ||
some-lib:build: > build | ||
some-lib:build: > exit 2 | ||
some-lib:build: | ||
some-lib:build: npm ERR! Lifecycle script `build` failed with error: | ||
some-lib:build: npm ERR! Error: command failed | ||
some-lib:build: npm ERR! in workspace: some-lib | ||
some-lib:build: npm ERR! at location: (.*)/apps/some-lib (re) | ||
some-lib:build: ERROR: command finished with error: command \((.*)/apps/some-lib\) npm run build exited \(1\) (re) | ||
command \((.*)/apps/some-lib\) npm run build exited \(1\) (re) | ||
|
||
Tasks: 0 successful, 1 total | ||
Cached: 0 cached, 1 total | ||
Time:\s*[\.0-9]+m?s (re) | ||
|
||
ERROR run failed: command exited (1) | ||
[1] | ||
|
||
Run with --continue | ||
$ ${TURBO} build --output-logs=errors-only --continue | ||
\xe2\x80\xa2 Packages in scope: my-app, other-app, some-lib (esc) | ||
\xe2\x80\xa2 Running build in 3 packages (esc) | ||
\xe2\x80\xa2 Remote caching disabled (esc) | ||
some-lib:build: cache miss, executing 3494007308f52ad6 | ||
some-lib:build: | ||
some-lib:build: > build | ||
some-lib:build: > exit 2 | ||
some-lib:build: | ||
some-lib:build: npm ERR! Lifecycle script `build` failed with error: | ||
some-lib:build: npm ERR! Error: command failed | ||
some-lib:build: npm ERR! in workspace: some-lib | ||
some-lib:build: npm ERR! at location: (.*)/apps/some-lib (re) | ||
some-lib:build: command finished with error, but continuing... | ||
other-app:build: cache miss, executing af6505fe5634a5f5 | ||
other-app:build: | ||
other-app:build: > build | ||
other-app:build: > exit 3 | ||
other-app:build: | ||
other-app:build: npm ERR! Lifecycle script `build` failed with error: | ||
other-app:build: npm ERR! Error: command failed | ||
other-app:build: npm ERR! in workspace: other-app | ||
other-app:build: npm ERR! at location: (.*)/apps/other-app (re) | ||
other-app:build: command finished with error, but continuing... | ||
command \((.*)/apps/some-lib\) npm run build exited \(1\) (re) | ||
command \((.*)/apps/other-app\) npm run build exited \(1\) (re) | ||
|
||
Tasks: 1 successful, 3 total | ||
Cached: 0 cached, 3 total | ||
Time:\s*[\.0-9]+m?s (re) | ||
|
||
ERROR run failed: command exited (1) | ||
[1] |