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

Bug: Exception object not present in TestResult #421

Closed
carl-baillargeon opened this issue Oct 1, 2023 · 5 comments · Fixed by #437
Closed

Bug: Exception object not present in TestResult #421

carl-baillargeon opened this issue Oct 1, 2023 · 5 comments · Fixed by #437
Assignees
Labels
bug Something isn't working
Milestone

Comments

@carl-baillargeon
Copy link
Contributor

The exception object is not set in the error attribute of TestResult when an exception occurs in _collect.

  {
    "name": "DC1-LEAF1A",
    "test": "VerifyAdverseDrops",
    "categories": [
      "hardware"
    ],
    "description": "Verifies there are no adverse drops on DCS7280E and DCS7500E",
    "result": "error",
    "messages": [
      "show hardware counter drop has failed: EapiCommandError (CLI command 2 of 2 'show hardware counter drop' failed: invalid command)"
    ],
    "error": "None", <---------- Here
    "custom_field": "None"
  },

It could be added in the wrapper function of anta_test when we check self.failed_commands.

@carl-baillargeon carl-baillargeon added the bug Something isn't working label Oct 1, 2023
@gmuloc
Copy link
Collaborator

gmuloc commented Oct 2, 2023

Technically there could be multiple failed commands and the attribute error can handle only one exception. Which one should it be - or should we change the field to errors ?

@carl-baillargeon
Copy link
Contributor Author

Technically there could be multiple failed commands and the attribute error can handle only one exception. Which one should it be - or should we change the field to errors ?

Yes I think having a list of Exception would be appropriate here.

@gmuloc
Copy link
Collaborator

gmuloc commented Oct 3, 2023

@mtache - any objection about changing from error to errors?

@carl-baillargeon
Copy link
Contributor Author

Also, if we do this, should we change the messages a little bit to be a little bit more concise?

@mtache mtache self-assigned this Oct 26, 2023
@gmuloc gmuloc added this to the v0.11.0 milestone Oct 27, 2023
@gmuloc gmuloc modified the milestones: v0.11.0, v1.0.0 Nov 13, 2023
@gmuloc
Copy link
Collaborator

gmuloc commented Nov 21, 2023

discussed on a call - lets remove error from TestResult and messages should contain useful info.

@mtache mtache linked a pull request Nov 22, 2023 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants