-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Require user to provide comment for manually skipped or failed cert-b…
…lockers (#426) * Require user to provide comment for manually skipped or failed cert-blockers When issuing certificates for a device, the team reviews the different test reports generated. Jobs that have a certification status set to "blocker" must pass in order to issue a review. Sometimes, it is not the case, but users do not necessarily provide a comment that would help with the review. Semi-automated jobs (`user-interact` and `user-interact-verify` [1]) can be skipped before being started or after they've run. Manual jobs can be skipped after been "run", meaning after their content has been displayed to the user and the user has to pick an outcome. These are handled in - checkbox_ng.launcher.stages._run_single_job_with_ui_loop - checkbox_ng.launcher.stages._interaction_callback Checkbox local and Checkbox remote call _interaction_callback() differently; Checkbox remote does not provide the current job's state, which is required to know the job's effective certification status (this status can be set in the job definition, but overriden in the test plan). checkbox_ng.launcher.stages._interaction_callback() signature is modified to pass the job state. Fix #387 [1] https://checkbox.readthedocs.io/en/latest/units/job.html#job-fields * Ask user for a comment if trying to skip a user-interact[-verify] job on remote Previous commit only took Checkbox local into account for `user-interact` and `user-interact-verify` jobs through the _run_single_job_with_ui_loop function. Adding similar feature to Checkbox remote. Make sure to keep existing feature, that is automatically add a "Explicitly skipped before execution" comment when a non-cert-blocker job is being skipped without any user-entered comment. * Modify session resume behavior on Checkbox local When a session is resumed, Checkbox (local mode) will ask the user what to do. If the previously run job is a cert-blocker, a behavior similar to a normal job run is implemented: if the user wants to set the job outcome to `skip` or `fail`, they will have to justify why by adding a comment. In order to do so, a "Add a comment" choice is added, and a loop is run until all the conditions are satisfied. For non-cert-blockers, an automated comment is added depending on the choice, except if a comment was manually entered. * Cleanup plainbox job's certification status docstrings * Add information about certification-status in Checkbox docs The public doc has gone almost eight years (!) without a mention of the `certification-status` option in the job unit. This is now fixed. In addition, a warning note is added to explain that cert-blockers cannot be skipped or failed without the user providing a comment. * Add Metabox scenarios for mandatory comments for cert-blocker jobs These scenarios cover Checkbox local and test the following: - A manual cert-blocker job cannot be failed until it has a comment - A manual cert-blocker job cannot be skipped until it has a comment - A user-interact-verify cert-blocker job cannot be failed until it has a comment - A user-interact-verify cert-blocker job cannot be skipped before being run until it has a comment - A user-interact-verify cert-blocker job cannot be skipped after being run until it has a comment - A user-interact cert-blocker job cannot be skipped before being run until it has a comment - After resuming a session, a manual cert-blocker job cannot be skipped until it has a comment * Modify wording of the warning when cert-blocker job is manually skipped/failed
- Loading branch information
Showing
9 changed files
with
498 additions
and
63 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
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
35 changes: 35 additions & 0 deletions
35
metabox/metabox/metabox-provider/units/cert-blocker-tps.pxu
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
id: cert-blocker-manual | ||
unit: test plan | ||
_name: Manual cert-blocker test | ||
_description: | ||
Test that a cert-blocker manual job cannot be skipped or failed without a | ||
comment. | ||
include: | ||
stub/split-fields/manual certification-status=blocker | ||
|
||
id: cert-blocker-user-interact-verify | ||
unit: test plan | ||
_name: User interact verify cert-blocker test | ||
_description: | ||
Test that cert-blocker user-interact-verify job cannot be skipped or failed | ||
without a comment. | ||
include: | ||
stub/split-fields/user-interact-verify certification-status=blocker | ||
|
||
id: cert-blocker-user-interact | ||
unit: test plan | ||
_name: User interact verify cert-blocker test | ||
_description: | ||
Test that cert-blocker user-interact job cannot be skipped without a comment. | ||
include: | ||
stub/split-fields/user-interact certification-status=blocker | ||
|
||
id: cert-blocker-manual-resume | ||
unit: test plan | ||
_name: Manual cert-blocker test | ||
_description: | ||
Test that a job marked as cert-blocker cannot be skipped without a comment | ||
when resuming a session | ||
include: | ||
stub/split-fields/manual certification-status=blocker | ||
stub/split-fields/user-interact |
Empty file.
Oops, something went wrong.