-
Notifications
You must be signed in to change notification settings - Fork 180
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
Write test log for deployment failures #3596
base: main
Are you sure you want to change the base?
Conversation
a4635e1
to
a5dada8
Compare
a5dada8
to
c2accaf
Compare
c2accaf
to
e69a729
Compare
e69a729
to
f4f962f
Compare
@@ -616,12 +620,15 @@ def _attach_failed_environment_to_result( | |||
# so deployment failure can be tracked. | |||
environment.platform = self.platform | |||
result.environment = environment | |||
|
|||
result.subscribe_log(self._log) |
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.
Does it need to subscribe runner here? The below line result.handle_exception
should have enough log. The runner is called in multi threads, and may bring logs from other cases.
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.
That seems to be sufficient for failed deployment.
In case of successful deployment, the deployment logs wouldn't show up in test log. That should be fine, right?
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.
subscribe here is too late, it won't capture the log generated when deploying. In another word, it includes nothing except the exception is logged out again.
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.
Are you recommending to subscribe and unsubscribe in _deploy_environment_task itself rather than _attach_failed_environment_to_result ?
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.
Yes, subscribe in deploy and prepare, not in the attach failed.
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 am trying to find which test result to use in _prepare_environment
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.
You can manually create an exception in prepare, so it can be tested easier.
a05d963
to
221f2f0
Compare
At present, test logs are not generated for deployment failures. This change creates case log for deployment failure with the failure reason.
221f2f0
to
dafbafc
Compare
At present, test logs are not generated for deployment failures. This change creates case log for deployment failure with the failure reason.