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

feat: Improve error reporting in test case execution #111

Conversation

Mcthomas777
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Aug 2, 2022

Codecov Report

Merging #111 (a00490e) into master (3d7b683) will increase coverage by 1.79%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #111      +/-   ##
==========================================
+ Coverage   93.09%   94.89%   +1.79%     
==========================================
  Files          69       68       -1     
  Lines        4955     4954       -1     
==========================================
+ Hits         4613     4701      +88     
+ Misses        342      253      -89     
Impacted Files Coverage Δ
src/pykiso/test_coordinator/test_execution.py 93.13% <100.00%> (+4.13%) ⬆️
src/pykiso/interfaces/simple_auxiliary.py 97.36% <0.00%> (-2.64%) ⬇️
src/pykiso/interfaces/mp_auxiliary.py 100.00% <0.00%> (ø)
src/pykiso/lib/connectors/cc_raw_loopback.py 100.00% <0.00%> (ø)
src/pykiso/lib/robot_framework/uds_auxiliary.py 100.00% <0.00%> (ø)
.../pykiso/lib/auxiliaries/communication_auxiliary.py 100.00% <0.00%> (ø)
...ykiso/lib/auxiliaries/udsaux/common/uds_request.py 100.00% <0.00%> (ø)
...iso/lib/robot_framework/communication_auxiliary.py 100.00% <0.00%> (ø)
src/pykiso/lib/auxiliaries/acroname_auxiliary.py
...kiso/lib/connectors/cc_socket_can/cc_socket_can.py 98.73% <0.00%> (+0.01%) ⬆️
... and 9 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@Mcthomas777 Mcthomas777 force-pushed the Improve-error-reporting-in-test-case branch 2 times, most recently from 2700f2c to c50d089 Compare August 3, 2022 07:53
@@ -252,6 +252,9 @@ def execute(
log.exception("Keyboard Interrupt detected")
exit_code = ExitCode.ONE_OR_MORE_TESTS_RAISED_UNEXPECTED_EXCEPTION
except Exception:
log.exception(f'Issue detected in the test-suite: {config["test_suite_list"]}!')
log.exception(
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't get this, the principle of log.exception is to log the message at error level AND to print out the exception stack, so even without this change you'd see all of the errors



class PykisoError(Exception):
"""Pykiso specific exception used as basis for all others."""

def __str__(self):
logging.exception(self.message)
Copy link
Contributor

Choose a reason for hiding this comment

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

As discussed don't mix up logging and exceptions, just add the log.exception when the exceptions are caught

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, right just wanted to display the full message, as I didn't know it will be anyway

@Mcthomas777 Mcthomas777 force-pushed the Improve-error-reporting-in-test-case branch 2 times, most recently from 6a85519 to fd7ab03 Compare August 3, 2022 14:16
@Mcthomas777 Mcthomas777 force-pushed the Improve-error-reporting-in-test-case branch 2 times, most recently from 9d5b462 to 40e022c Compare August 3, 2022 15:16
Copy link
Contributor

@sebastianpfischer sebastianpfischer left a comment

Choose a reason for hiding this comment

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

Besides the above question, it looks good :)

src/pykiso/exceptions.py Outdated Show resolved Hide resolved
@sebastianpfischer sebastianpfischer merged commit 59d2cfd into eclipse:master Aug 8, 2022
Pog3k pushed a commit that referenced this pull request Aug 11, 2022
Co-authored-by: Julien THOMAS <external.julien.thomas@de.bosch.com>
Pog3k pushed a commit that referenced this pull request Aug 11, 2022
Co-authored-by: Julien THOMAS <external.julien.thomas@de.bosch.com>
Pog3k pushed a commit that referenced this pull request Aug 11, 2022
Co-authored-by: Julien THOMAS <external.julien.thomas@de.bosch.com>
Pog3k pushed a commit that referenced this pull request Aug 11, 2022
Co-authored-by: Julien THOMAS <external.julien.thomas@de.bosch.com>
Pog3k added a commit that referenced this pull request Aug 11, 2022
Co-authored-by: Julien THOMAS <external.julien.thomas@de.bosch.com>
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.

3 participants