Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

adityagesh
Copy link
Collaborator

At present, test logs are not generated for deployment failures. This change creates case log for deployment failure with the failure reason.

@adityagesh adityagesh force-pushed the aditya/log_deployment_failures branch 2 times, most recently from a4635e1 to a5dada8 Compare January 9, 2025 07:14
@adityagesh adityagesh force-pushed the aditya/log_deployment_failures branch from a5dada8 to c2accaf Compare January 13, 2025 03:33
lisa/platform_.py Outdated Show resolved Hide resolved
@adityagesh adityagesh force-pushed the aditya/log_deployment_failures branch from c2accaf to e69a729 Compare January 13, 2025 03:39
lisa/testsuite.py Outdated Show resolved Hide resolved
lisa/testsuite.py Outdated Show resolved Hide resolved
lisa/testsuite.py Outdated Show resolved Hide resolved
@adityagesh adityagesh force-pushed the aditya/log_deployment_failures branch from e69a729 to f4f962f Compare January 13, 2025 09:59
@@ -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)
Copy link
Member

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.

Copy link
Collaborator Author

@adityagesh adityagesh Jan 15, 2025

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?

Copy link
Member

@squirrelsc squirrelsc Jan 16, 2025

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.

Copy link
Collaborator Author

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 ?

Copy link
Member

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.

Copy link
Collaborator Author

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

Copy link
Member

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.

lisa/testsuite.py Outdated Show resolved Hide resolved
@adityagesh adityagesh force-pushed the aditya/log_deployment_failures branch 2 times, most recently from a05d963 to 221f2f0 Compare January 15, 2025 05:54
At present, test logs are not generated for deployment failures.
This change creates case log for deployment failure with the failure
reason.
@adityagesh adityagesh marked this pull request as ready for review January 15, 2025 17:05
@adityagesh adityagesh requested a review from LiliDeng as a code owner January 15, 2025 17:05
@adityagesh adityagesh force-pushed the aditya/log_deployment_failures branch from 221f2f0 to dafbafc Compare January 17, 2025 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants