canonical / checkbox

Checkbox
https://checkbox.readthedocs.io
GNU General Public License v3.0
30 stars 47 forks source link

Add a new function to find which renderer is running the process (New) #1245

Closed hanhsuan closed 2 weeks ago

hanhsuan commented 4 months ago

Description

While testing without pci id, user couldn't know the process is running on which renderer. Therefore, this change is going to:

The jobs.pxu and test-plan.pxu will be in another PR, and the draft jobs and test-plan that use this new function as below:

plugin: shell
category_id: com.canonical.plainbox::graphics
id: graphics/auto_glxgears
flags: also-after-suspend
user: root
requires:
    executable.name == 'glxgears'
    dmi.product in ['Desktop','Low Profile Desktop','Tower','Mini Tower','Space-saving']
command:
    prime_offload_tester.py -c glxgears -t 30
summary:
    Test that glxgears works for current video card
purpose:
     Tests the basic 3D capabilities of your current video card. This test covers all devices without an integrated display, such as desktops.

plugin: shell
category_id: com.canonical.plainbox::graphics
id: graphics/auto_glxgears_fullscreen
flags: also-after-suspend
user: root
requires:
    executable.name == 'glxgears'
    dmi.product in ['Desktop','Low Profile Desktop','Tower','Mini Tower','Space-saving']
command:
     prime_offload_tester.py -c "glxgears -fullscreen" -t 30
summary:
    Test that glxgears works in full screen mode for current video card
purpose:
     Tests the basic full screen 3D capabilities of your current video card. This test covers all devices without an integrated display, such as desktops.
plugin: user-interact-verify
category_id: com.canonical.plainbox::graphics
id: graphics/valid_glxgears
flags: also-after-suspend
user: root
requires:
    executable.name == 'glxgears'
    dmi.product in ['Desktop','Low Profile Desktop','Tower','Mini Tower','Space-saving']
command:
     prime_offload_tester.py -c glxgears -t 30
summary:
    Test that glxgears works for current video card
purpose:
     Tests the basic 3D capabilities of your current video card. This test covers all devices without an integrated display, such as desktops.
steps:
     1. Click "Test" to execute an OpenGL demo. Press ESC at any time to close.
     2. Verify that the animation is not jerky or slow.
verification:
     1. Did the 3d animation appear?
     2. Was the animation free from slowness/jerkiness?

plugin: user-interact-verify
category_id: com.canonical.plainbox::graphics
id: graphics/valid_glxgears_fullscreen
flags: also-after-suspend
user: root
requires:
    executable.name == 'glxgears'
    dmi.product in ['Desktop','Low Profile Desktop','Tower','Mini Tower','Space-saving']
command:
     prime_offload_tester.py -c "glxgears -fullscreen" -t 30
summary:
    Test that glxgears works in full screen mode for current video card
purpose:
     Tests the basic full screen 3D capabilities of your current video card. This test covers all devices without an integrated display, such as desktops.
steps:
     1. Click "Test" to execute an OpenGL demo. Press ESC at any time to close.
     2. Verify that the animation is not jerky or slow.
verification:
     1. Did the 3d animation appear?
     2. Was the animation free from slowness/jerkiness?
id: graphics-gpu-cert-automated
unit: test plan
_name: Graphics tests (Automated)
_description:
 Graphics tests (Automated)
include:
~ skip ~
 graphics/auto_glxgears                         certification-status=blocker
 graphics/auto_glxgears_fullscreen              certification-status=blocker
~ skip ~
bootstrap_include:
    graphics_card

id: graphics-gpu-cert-manual
unit: test plan
_name: Graphics tests (Manual)
_description:
 Graphics tests (Manual)
include:
~ skip ~
 graphics/valid_glxgears                        certification-status=blocker
 graphics/valid_glxgears_fullscreen             certification-status=blocker
~ skip ~
bootstrap_include:
    graphics_card

Resolved issues

Documentation

Tests

Unit test and laptop: auto, manual desktop: auto, manual

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 92.39130% with 7 lines in your changes missing coverage. Please review.

Project coverage is 44.99%. Comparing base (d62c028) to head (e3d0989). Report is 100 commits behind head on main.

Files with missing lines Patch % Lines
providers/base/bin/prime_offload_tester.py 92.39% 6 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1245 +/- ## ========================================== + Coverage 44.18% 44.99% +0.81% ========================================== Files 359 360 +1 Lines 38813 38941 +128 Branches 6581 6603 +22 ========================================== + Hits 17148 17520 +372 + Misses 21003 20751 -252 - Partials 662 670 +8 ``` | [Flag](https://app.codecov.io/gh/canonical/checkbox/pull/1245/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=canonical) | Coverage Δ | | |---|---|---| | [provider-base](https://app.codecov.io/gh/canonical/checkbox/pull/1245/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=canonical) | `20.80% <92.39%> (+2.23%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=canonical#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

hanhsuan commented 2 weeks ago

@fernando79513 There is no failure and error related to my code when I run the test locally, but the github action couldn't pass. Should I rebase my branch or something else I have to do? thanks.

fernando79513 commented 2 weeks ago

It was not an issue of rebasing, you were patching sys.modules for all the tests:

sys.modules["checkbox_support"] = MagicMock()
sys.modules["checkbox_support.helpers.timeout"] = MagicMock()

There was no need to do so. Also now, there is a @mock_timeout function.

hanhsuan commented 2 weeks ago

Thanks a lot. I'll add more unit test coverage to make it pass codecov.