-
Notifications
You must be signed in to change notification settings - Fork 895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let CI distinguish test compilation and test run failures #15600
Conversation
004c5e1
to
15ce857
Compare
2d35a52
to
3ef92d5
Compare
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.
package.json changes seem fine. Please get another approval for the code changes before merge. I was only able to cursory review and whilst there are some minor issues (top-level anonymous functions and using let instead of const, that whole file has them and we need to improve the linter to catch these).
build/commands/scripts/commands.js
Outdated
const buildTestsCommand = program.command('build_tests <suite>'); | ||
const runTestsCommand = program.command('run_tests <suite>'); | ||
|
||
[testCommand, buildTestsCommand, runTestsCommand].forEach((command) => { |
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.
I think this would be a lot simpler if we had an optional --target
param for the build
command. Separately we should do the same thing for create_dist
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.
for backwards compat you change package.json for npm run test
to handle this as two commands
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.
I think this would be a lot simpler if we had an optional --target param for the build
We have such a param, don't we? For example:
npm run build -- --target=brave/components/policy:pack_policy_templates
I'm pretty sure I'm not fully understanding what you wrote. Could you clarify in more detail what you meant?
PS - as always ty for the review.
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.
for backwards compat you change package.json for npm run test to handle this as two commands
I'm afraid I don't understand the message of this comment either. Yes I'm changing package.json in a way that's backwards compatible (while also retaining the test
command for developer ease). Is there something I should change?
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.
@bridiver could I ask you to clarify your comments?
b42364d
to
0879d7f
Compare
Previously, the command exited with a non-zero code on both compilation and test errors. This made it impossible to determine which of the two happened - and thus hard to decide whether to generate test reports.
cd8cd1a
to
87e0af1
Compare
Previously, `npm run test --output` exited with a non-zero code on both compilation and test errors. This made it impossible to determine which of the two happened - and thus hard to decide whether to generate test reports. Now, the command exits with 0 on test failures. (Note that the behavior is unchanged when --output is not given. That is, in this case you still get non-zero exit codes for test failures.)
Previously, `npm run test --output` exited with a non-zero code on both compilation and test errors. This made it impossible to determine which of the two happened - and thus hard to decide whether to generate test reports. Now, the command exits with 0 on test failures. (Note that the behavior is unchanged when --output is not given. That is, in this case you still get non-zero exit codes for test failures.)
Prerequisite for https://github.com/brave/devops/issues/8517.
At the moment, we have a single command for running tests:
npm run test
. This both builds and runs the tests. If the command fails, then it is unclear whether the failure was in building or running the tests. This leads to confusing error messages in our CI. The present PR is a preparation for fixing this.This PR also incorporates a few small refactorings. Most notably, it introduces internal
buidTests
andrunTests
functions that better separate those concerns.Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
,npm run lint
,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan: