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

test status available for tearDown() #5224

Merged
merged 2 commits into from
Jan 12, 2022

Conversation

richtja
Copy link
Contributor

@richtja richtja commented Jan 7, 2022

This PR will split the test._run_avocado into the two methods. The
_run_test and _tearDown. Thanks to this change, we can store test
status before execution of the tearDown and make it available to the
users.

Reference: #5217
Signed-off-by: Jan Richter [email protected]

The `test.start_logging` was removed from nrunner in
263c817 but the `test.stop_logging`
wasn't removed. This commit will fix it.

Signed-off-by: Jan Richter <[email protected]>
This commit will split the `test._run_avocado` into the two methods. The
`_run_test` and `_tearDown`. Thanks to this change, we can store test
status before execution of the tearDown and make it available to the
users.

Reference: avocado-framework#5217
Signed-off-by: Jan Richter <[email protected]>
@richtja richtja added this to the #95(TBD) milestone Jan 7, 2022
@richtja richtja self-assigned this Jan 7, 2022
@richtja richtja linked an issue Jan 7, 2022 that may be closed by this pull request
@@ -859,7 +859,8 @@ def run_avocado(self):
self._tag_end()
self._report()
self.log.info("")
self._stop_logging()
if self._config.get("run.test_runner") != 'nrunner':
self._stop_logging()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, we could drop this method. We should not keep support to others runners at this point and we don't need to introduce new code just to support the legacy runner.

Copy link
Contributor Author

@richtja richtja Jan 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I agree with you, we should drop the _start_logging and _stop_logging. I just didn't want to do it before avocado-vt #3295, because last time we had compatibility issues after dropping legacy code. So I would like to wait until the compatibility between avocado and avocado-vt will be resolved.

@richtja
Copy link
Contributor Author

richtja commented Jan 10, 2022

Hi @bfaccini can you please review this PR, it is solving your problem with test statuses during tearDown() from #5217.

Copy link
Contributor

@clebergnu clebergnu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Copy link
Member

@beraldoleal beraldoleal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@beraldoleal beraldoleal merged commit 7a2d5af into avocado-framework:master Jan 12, 2022
@bfaccini
Copy link

Hi @bfaccini can you please review this PR, it is solving your problem with test statuses during tearDown() from #5217.

Sorry for being late, and anyway I would not have been a good reviewer as I am not enough familiar with Avocado internals at this time.
But I would like to thank you for your help and having fixing it so quickly!
Just a last question, do you have any idea about which Avocado version will start containing this fix ?

@richtja
Copy link
Contributor Author

richtja commented Jan 28, 2022

Hi @bfaccini can you please review this PR, it is solving your problem with test statuses during tearDown() from #5217.

Sorry for being late, and anyway I would not have been a good reviewer as I am not enough familiar with Avocado internals at this time. But I would like to thank you for your help and having fixing it so quickly! Just a last question, do you have any idea about which Avocado version will start containing this fix ?

This fix will be available in avocado 95, if everything goes well it should be released on Feb 7.

@richtja richtja deleted the tearDown_status branch July 13, 2022 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test status should be already set and available for tearDown()
5 participants