-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gating: assume 'waiting' for two hours on missing results (#4219)
This is part of addressing #4219. Currently we always count the gating status as failed if requirements are unsatisfied. However, it's usual for test results to not be present yet for a little while after the update is created or edited. Ideally we would have a mechanism for knowing for sure whether the tests in question are pending, but we don't, so let's use a dumb rule instead: if there are no failures (only missing results), and it's less than two hours since the update was last modified, we'll return 'waiting' as the status. After two hours, maybe the tests actually didn't get scheduled or the policy is wrong, so we'll return 'failed'. This also substantially simplifies the logic used to decide the status, and reduces code duplication. We can determine the status using only the number of satisfied and unsatisfied requirements: if there are none of either it is ignored, if there are satisfied requirements and no unsatisfied requirements it is passed, otherwise it is failed or waiting. As part of this we change the mock greenwave responses used in a lot of other tests to use test-result-failed not -missing, because they currently use -missing but expect the gating status to be 'failed', which it no longer always will be. We also have to make the mock greenwave responses used in tests that hit this code a bit more realistic - they have to always include the satisfied and unsatisfied requirement lists. Note I've checked greenwave code and it does always include these in a successful query response. Signed-off-by: Adam Williamson <awilliam@redhat.com>
- Loading branch information
Showing
6 changed files
with
386 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.