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

The 'errors' record for series now counts all errors for tests/series. #785

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

Conversation

Paul-Ferrell
Copy link
Collaborator

I've noticed that the 'errors' number when running pav series status doesn't include all test errors, like timeouts and other errors. It should with this change.

Code review checklist:

  • Code is generally sensical and well commented
  • Variable/function names all telegraph their purpose and contents
  • Functions/classes have useful doc strings
  • Function arguments are typed
  • Added/modified unit tests to cover changes.
  • New features have documentation added to the docs.
  • New features and backwards compatibility breaks are noted in the RELEASE.md

status_file.SERIES_STATES.KICKOFF_ERROR):
errors += 1
for error_val in error_values:
if error_val in status.state:
Copy link
Collaborator

@hwikle-lanl hwikle-lanl Sep 27, 2024

Choose a reason for hiding this comment

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

Using str.__contains__ here feels a bit kludgey and error-prone. A better solution would be to implement a mechanism to separate statuses into ERROR, CANCELLED, and TIMEOUT classes, either by:

a) Creating something like a class field on TestStatusInfo that takes on an enum value and testing against that; or

b) Implementing three static methods on StatesStruct that return sets of ERROR, CANCELLED, and TIMEOUT statuses respectively and then checking whether status.state is contained within each set (or simply the union of the three sets).

Copy link
Collaborator

Choose a reason for hiding this comment

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

The second option feels cleaner to me.

# Look for any bad test states
for error_val in error_values:
for state in test_info.state_history:
if error_val in state.state:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ditto here.

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