-
Notifications
You must be signed in to change notification settings - Fork 40
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
Fix result when test task fails so that correct exit code is returned #303
Conversation
Security InsightsNo security relevant content was detected by automated scans. Action Items
Questions or Comments? Reach out on Slack: #support-infosec. |
lib/src/dart_dev_cli.dart
Outdated
@@ -182,9 +182,9 @@ Future _run(List<String> args) async { | |||
|
|||
reporter.log(''); | |||
if (result.successful) { | |||
reporter.success(result.message, shout: true); | |||
reporter.success(result.message ?? '', shout: true); |
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'm a little concerned/unclear what empty string will accomplish if result.message is null.
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.
isNotEmpty
threw here: https://github.com/Workiva/dart_dev/blob/master/lib/src/reporter.dart#L102
I will push a commit to fix it up farther down the stack though.
👏 , but CI failed. |
2a65d69
to
f4040ee
Compare
+10 Testing Performed
|
@Workiva/release-management-p |
In the test task, the
outputProcessed
future was only completed if the tests ran or if the test regex didn't match any test names. If anything else happened, the task'sdone
future never completed, the result was never returned todart_dev_cli.dart
, and no matter what happened in the task, an exit code of0
was returned.This PR makes sure that the future is completed in the test task no matter what. As a result, we can remove the extra build that was going on in the test task before. Now, if you run
ddev test
and the build fails, an exit code of 1 will be returned.QA +1 Instructions
config.test.deleteConflictingOutputs
option set to true.ddev test
with a passing build, ensure that the--delete-conflicting-outputs
flag is passed to the build command, and tests run successfully.ddev test
. After the build fails, tryecho $?
and ensure that the exit code returned was 0.