Skip to content

feat: Improve error reporting in test case execution#111

Merged
sebastianpfischer merged 1 commit into
eclipse-kiso-testing:masterfrom
Mcthomas777:Improve-error-reporting-in-test-case
Aug 8, 2022
Merged

feat: Improve error reporting in test case execution#111
sebastianpfischer merged 1 commit into
eclipse-kiso-testing:masterfrom
Mcthomas777:Improve-error-reporting-in-test-case

Conversation

@Mcthomas777
Copy link
Copy Markdown
Contributor

No description provided.

@codecov
Copy link
Copy Markdown

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
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
Copy Markdown
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

Comment thread src/pykiso/exceptions.py Outdated
"""Pykiso specific exception used as basis for all others."""

def __str__(self):
logging.exception(self.message)
Copy link
Copy Markdown
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
Copy Markdown
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 requested a review from sebclrsn August 3, 2022 14:24
@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
Copy Markdown
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 :)

Comment thread src/pykiso/exceptions.py Outdated
Comment thread tests/test_config_registry_and_test_execution.py Outdated
Comment thread tests/test_config_registry_and_test_execution.py Outdated
@Mcthomas777 Mcthomas777 force-pushed the Improve-error-reporting-in-test-case branch from 40e022c to a00490e Compare August 4, 2022 12:35
@sebastianpfischer sebastianpfischer merged commit 59d2cfd into eclipse-kiso-testing: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