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

Update the list of rejected jobs if match function is used (bugfix) #1575

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

pieqq
Copy link
Collaborator

@pieqq pieqq commented Nov 2, 2024

Description

The jobs that are being pruned by the match function should be added to the list of rejected jobs, otherwise the metadata generated at the end of a test run is incorrect.

Because the list of rejected jobs is initially empty but can be altered in several places (run_alternate_selection() and finish_bootstrap()), it is updated in these functions instead of being replaced by another list.

The metadata that states if a test plan has been modified (custom_joblist) should also be set to True in these cases.

Resolved issues

Fix #1568

Documentation

Tests

Unit tests have been updated.

The following end to end tests have been run:

Normal call without use of match

  1. Run checkbox-cli
  2. Select camera-cert-automated test plan
  3. In the Camera category, de-select everything except camera/detect and run the tests

The generated submission.json shows:

{
    "title": "session title",
    "testplan_id": "com.canonical.certification::camera-cert-automated",
    "custom_joblist": true,
    (...)
    "rejected-jobs": [
        {
            <the de-selected tests are here>
        }

Normal call with use of match

The following launcher is used:

[test plan]
unit = com.canonical.certification::camera-cert-automated
forced = yes

[test selection]
match = com.canonical.certification::camera/detect
  1. Run checkbox-cli
  2. Notice that in the test selection screen, in the Camera cateogory, only camera/detect is presented
  3. De-select it, and run the tests

The submission.json generated looks like this:

{
    "title": "session title",
    "testplan_id": "com.canonical.certification::camera-cert-automated",
    "custom_joblist": true,
    "results": [
    ],
    (...)
    "rejected-jobs": [
        {
        <all the camera tests are listed here, including camera/detect>
        }

Automated run with the use of match

The following launcher is used:

[test plan]
unit = com.canonical.certification::camera-cert-automated
forced = yes

[test selection]
forced = yes
match = com.canonical.certification::camera/detect

The generated submission.json looks like this:

{
    "title": "session title",
    "testplan_id": "com.canonical.certification::camera-cert-automated",
    "custom_joblist": true,
    "results": [
        {
            "id": "camera/detect",
            "full_id": "com.canonical.certification::camera/detect",
            "name": "This Automated test attempts to detect a camera.",
            "certification_status": "blocker",
            "category": "Camera tests",
            "category_id": "com.canonical.plainbox::camera",
            "status": "pass",
            "outcome": "pass",
            "comments": null,
            "io_log": "/dev/video0: OK\n    name   : Integrated_Webcam_FHD: Integrat\n    driver : uvcvideo\n    version: 6.8.12\n    flags  : 0x84a00001 [ CAPTURE STREAMING ]\n    Format: MJPG (Motion-JPEG)\n    Resolutions: 1920x1080,1280x960,1280x720,640x480,640x360\n    Format: YUYV (YUYV 4:2:2)\n    Resolutions: 1920x1080,1280x720,640x480,640x360,320x240,320x180,160x120\n\n/dev/video1: OK\n    name   : Integrated_Webcam_FHD: Integrat\n    driver : uvcvideo\n    version: 6.8.12\n    flags  : 0x84a00001 [ CAPTURE STREAMING ]\n    Format: YUYV (YUYV)\n    Resolutions: 640x480\n\n/dev/video2: OK\n    name   : Integrated_Webcam_FHD: Integrat\n    driver : uvcvideo\n    version: 6.8.12\n    flags  : 0x84a00001 [ CAPTURE STREAMING ]\n    Format: GREY (8-bit Greyscale)\n    Resolutions: 640x360\n\n/dev/video3: OK\n    name   : Integrated_Webcam_FHD: Integrat\n    driver : uvcvideo\n    version: 6.8.12\n    flags  : 0x84a00001 [ CAPTURE STREAMING ]\n    Format: YUYV (YUYV)\n    Resolutions: 640x480\n\n",
            "type": "test",
            "project": "certification",
            "duration": 2.1785783767700195,
            "plugin": "shell",
            "template_id": null
        }
    ],
    (...)
    "rejected-jobs": [
        <every camera-related test is listed here, EXCEPT camera/detect>
        ]

Copy link

codecov bot commented Nov 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 48.00%. Comparing base (9c994f1) to head (c087555).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1575   +/-   ##
=======================================
  Coverage   48.00%   48.00%           
=======================================
  Files         371      371           
  Lines       39833    39837    +4     
  Branches     6730     6733    +3     
=======================================
+ Hits        19121    19125    +4     
  Misses      19994    19994           
  Partials      718      718           
Flag Coverage Δ
checkbox-ng 68.60% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pieqq pieqq changed the title Update the list of rejected jobs if match function is used Update the list of rejected jobs if match function is used (bugfix) Nov 2, 2024
The jobs that are being pruned by the `match` function should be added
to the list of rejected jobs, otherwise the metadata generated at the
end of a test run is incorrect.

Because the list of rejected jobs is initially empty but can be altered
in several places (`run_alternate_selection()` and
`finish_bootstrap()`), it is updated in these functions instead of being
replaced by another list.

The metadata that states if a test plan has been modified
(`custom_joblist`) should also be set to True in these cases.

Fix #1568
@Hook25 Hook25 force-pushed the 1568-rejected-job-list-when-matching branch from 6d9fdc4 to c087555 Compare November 8, 2024 14:19
@Hook25 Hook25 merged commit 2cc3162 into main Nov 8, 2024
49 checks passed
@Hook25 Hook25 deleted the 1568-rejected-job-list-when-matching branch November 8, 2024 14:44
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.

List of rejected jobs is empty when using match feature
2 participants