Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): add the flag to stop execution on first error
- Loading branch information
Showing
23 changed files
with
183 additions
and
33 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
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,54 @@ | ||
import { newProject, runCLI, uniq, updateProjectConfig } from '@nrwl/e2e/utils'; | ||
|
||
describe('Nx Bail', () => { | ||
beforeEach(() => newProject()); | ||
|
||
it('should stop executing all tasks when one of the tasks fails', async () => { | ||
const myapp1 = uniq('a'); | ||
const myapp2 = uniq('b'); | ||
runCLI(`generate @nrwl/web:app ${myapp1}`); | ||
runCLI(`generate @nrwl/web:app ${myapp2}`); | ||
updateProjectConfig(myapp1, (c) => { | ||
c.targets['error'] = { | ||
executor: 'nx:run-commands', | ||
options: { | ||
command: 'echo boom1 && exit 1', | ||
}, | ||
}; | ||
return c; | ||
}); | ||
updateProjectConfig(myapp2, (c) => { | ||
c.targets['error'] = { | ||
executor: 'nx:run-commands', | ||
options: { | ||
command: 'echo boom2 && exit 1', | ||
}, | ||
}; | ||
return c; | ||
}); | ||
|
||
let withoutBail = runCLI(`run-many --target=error --all --parallel=1`, { | ||
silenceError: true, | ||
}) | ||
.split('\n') | ||
.map((r) => r.trim()) | ||
.filter((r) => r); | ||
|
||
withoutBail = withoutBail.slice(withoutBail.indexOf('Failed tasks:')); | ||
expect(withoutBail).toContain(`- ${myapp1}:error`); | ||
expect(withoutBail).toContain(`- ${myapp2}:error`); | ||
|
||
let withBail = runCLI( | ||
`run-many --target=error --all --parallel=1 --nx-bail`, | ||
{ | ||
silenceError: true, | ||
} | ||
) | ||
.split('\n') | ||
.map((r) => r.trim()) | ||
.filter((r) => r); | ||
withBail = withBail.slice(withBail.indexOf('Failed tasks:')); | ||
expect(withBail).toContain(`- ${myapp1}:error`); | ||
expect(withBail).not.toContain(`- ${myapp2}:error`); | ||
}); | ||
}); |
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
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 |
---|---|---|
|
@@ -137,6 +137,7 @@ export async function runCommand( | |
target: nxArgs.target, | ||
projectGraph, | ||
nxJson, | ||
nxArgs, | ||
} | ||
); | ||
|
||
|
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
Oops, something went wrong.
7bfceb6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
nx-dev – ./
nx.dev
nx-dev-git-master-nrwl.vercel.app
nx-five.vercel.app
nx-dev-nrwl.vercel.app