-
Notifications
You must be signed in to change notification settings - Fork 144
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
Add pending state for results #3485
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -469,6 +469,7 @@ definitions: | |
result_outcome: | ||
type: string | ||
enum: | ||
- pending | ||
- pass | ||
- fail | ||
- info | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1129,9 +1129,11 @@ def go(self, force: bool = False) -> None: | |
""" Execute tests """ | ||
super().go(force=force) | ||
|
||
# Clean up possible old results | ||
# Clean up possible old results, by switching them to pending state | ||
if force: | ||
self._results.clear() | ||
for index, result in enumerate(self._results): | ||
if result.result != ResultOutcome.PENDING: | ||
self._results[index] = Result(name=result.name, result=ResultOutcome.PENDING) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd say this should recreate the list from scratch, i.e. not overwriting the existing results. Let's say there was a test with custom results, creating 100 of results for that single test. Before running the test for the first time, there would be a single |
||
|
||
if self.should_run_again: | ||
self.status('todo') | ||
|
@@ -1201,7 +1203,11 @@ def go(self, force: bool = False) -> None: | |
# which would make results appear several times. Instead, we can reach | ||
# into the original plugin, and use it as a singleton "entry point" to | ||
# access all collected `_results`. | ||
self._results += execute_phases[0].results() | ||
# | ||
# Go through all results and replace those which were pending | ||
for index, result in enumerate(execute_phases[0].results()): | ||
if self._results[index].result == ResultOutcome.PENDING: | ||
self._results[index] = result | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmmm, this is weird. I think it will hit custom results again: for a single test, there may be 100 results in I believe we need a more robust approach here, based on matching the result's test serial numbers, constructing the list from two sources, |
||
|
||
# To separate "execute" from the follow-up logging visually | ||
self.info('') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it won't be as easy as
zip()
. Results may be listed in an arbitrary order - yes, results are added once their tests finish, but I wouldn't rely on it, and there is certainly no code enforcing the order.Check the
Execute.results_for_tests()
which lists results and test pairs, you should be interested in creating new results for pairs where the test is set and the result isNone
, that's a test that has not run yet.