Skip to content

Conversation

@hanhsuan
Copy link
Contributor

@hanhsuan hanhsuan commented Apr 5, 2025

Description

This new script is using the functionality of display_info in the checkbox support that using dbus to control directly.

The test cases modification will be in the follow up PR:

unit: template
template-resource: graphics_card
template-filter: graphics_card.prime_gpu_offload == 'Off'
plugin: user-interact-verify
category_id: com.canonical.plainbox::graphics
id: graphics/{index}_rotation_{product_slug}
template-id: graphics/index_rotation_product_slug
flags: also-after-suspend
command:
 # shellcheck disable=SC1091
 source graphics_env.sh {driver} {index}
 if [[ $XDG_SESSION_TYPE == "wayland" ]]
 then
   randr_cycle.py -c transform --prefix {index} --screenshot_dir="$PLAINBOX_SESSION_SHARE"
 else
   rotation_test.py
 fi
estimated_duration: 20.000
_summary: Test rotation for {vendor} {product}
_purpose:
 This test will test display rotation on the {vendor} {product} graphics card
_steps:
 1. Click "Test" to test display rotation. The display will be rotated every 4 seconds.
 2. Try moving the mouse or try opening multiple terminals via ‘Ctrl+Alt+T’ every time the screen automatically turns.
 3. Check if all rotations (normal, right, inverted, left) took place without permanent screen corruption.
_verification:
 Did the display rotation take place without permanent screen corruption?
unit: template
template-resource: graphics_card
template-filter: graphics_card.prime_gpu_offload == 'Off'
plugin: user-interact-verify
category_id: com.canonical.plainbox::graphics
id: graphics/{index}_cycle_resolution_{product_slug}
template-id: graphics/index_cycle_resolution_product_slug
flags: also-after-suspend
requires: package.name == 'xorg'
depends: graphics/VESA_drivers_not_in_use
command:
 # shellcheck disable=SC1091
 source graphics_env.sh {driver} {index}
 if [[ $XDG_SESSION_TYPE == "wayland" ]]
 then
   randr_cycle.py -c resolution --prefix {index} --screenshot_dir="$PLAINBOX_SESSION_SHARE"
 else
   xrandr_cycle.py --screenshot-dir="$PLAINBOX_SESSION_SHARE"
 fi
estimated_duration: 250.000
_summary: Test resolution cycling for {vendor} {product}
_description:
_purpose:
     This test cycles through the detected video modes for the {vendor} {product} graphics card
_steps:
     1. Click "Test" to start cycling through the video modes
_verification:
     Did the screen appear to be working for each mode?
unit: template
template-resource: graphics_card
template-filter: graphics_card.prime_gpu_offload == 'Off'
plugin: attachment
category_id: com.canonical.plainbox::suspend
id: suspend/{index}_xrandr_screens_after_suspend.tar.gz_auto
template-id: suspend/index_xrandr_screens_after_suspend.tar.gz_auto
depends: after-suspend-graphics/{index}_cycle_resolution_{product_slug}
command: [ -f "$PLAINBOX_SESSION_SHARE"/{index}_xrandr_screens_after_suspend.tgz ] && cat "$PLAINBOX_SESSION_SHARE"/{index}_xrandr_screens_after_suspend.tgz
_purpose: This attaches screenshots from the suspend/cycle_resolutions_after_suspend test to the results submission.
_summary: Attach screenshots from suspend/cycle resolutions after suspend test to results.

Resolved issues

This is a followup PR for
#855

and fix
#370

Documentation

Tests

24.04:
https://certification.canonical.com/hardware/202001-27667/submission/437591/

@hanhsuan hanhsuan force-pushed the add_new_randr_cycle_script branch from 4bfe985 to 4c6f8b7 Compare April 5, 2025 06:46
@codecov
Copy link

codecov bot commented Apr 5, 2025

Codecov Report

❌ Patch coverage is 96.62921% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.03%. Comparing base (7c13717) to head (bb197c7).
⚠️ Report is 71 commits behind head on main.

Files with missing lines Patch % Lines
providers/base/bin/randr_cycle.py 96.62% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1843      +/-   ##
==========================================
+ Coverage   51.21%   52.03%   +0.81%     
==========================================
  Files         386      389       +3     
  Lines       41697    41862     +165     
  Branches     7752     7781      +29     
==========================================
+ Hits        21357    21784     +427     
+ Misses      19577    19304     -273     
- Partials      763      774      +11     
Flag Coverage Δ
provider-base 28.51% <96.62%> (+2.39%) ⬆️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hanhsuan hanhsuan marked this pull request as ready for review July 9, 2025 05:42
GabrielChenCC
GabrielChenCC previously approved these changes Jul 18, 2025
Copy link
Contributor

@GabrielChenCC GabrielChenCC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The PR content is detailed, easy to read, clear and correct. Thanks @hanhsuan

…ckbox support that using dbus to control directly.
@hanhsuan hanhsuan force-pushed the add_new_randr_cycle_script branch from 0e66914 to 1b47c52 Compare July 22, 2025 13:00
@hanhsuan hanhsuan requested a review from GabrielChenCC July 23, 2025 00:21
@hanhsuan
Copy link
Contributor Author

I've followed the changes of #1916 to modify my code and unit test.

GabrielChenCC
GabrielChenCC previously approved these changes Aug 22, 2025
Copy link
Contributor

@GabrielChenCC GabrielChenCC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hanhsuan LGTM. Thanks.

Copy link
Collaborator

@p-gentili p-gentili left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks already good, but I proposed some changes to make it look easier to read.

Also: after you update the test cases to make use of this script, will we be able to finally get rid of gnome-randr from Checkbox?

hanhsuan and others added 2 commits September 25, 2025 08:43
2. Moving filter logic to smaller functions
@hanhsuan
Copy link
Contributor Author

Also: after you update the test cases to make use of this script, will we be able to finally get rid of gnome-randr from Checkbox?

gnome_randr_cycle.py and rotation_test.py are the only scripts that utilize gnome-randr. Therefore, I believe we could.

@hanhsuan hanhsuan requested a review from p-gentili September 25, 2025 12:22
Copy link
Collaborator

@p-gentili p-gentili left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely, thanks for the changes!

@p-gentili p-gentili merged commit a8f7c72 into main Sep 25, 2025
27 checks passed
@p-gentili p-gentili deleted the add_new_randr_cycle_script branch September 25, 2025 14:12
stanley31huang pushed a commit that referenced this pull request Oct 3, 2025
* This new script is using the functionality of display_info in the checkbox support that using dbus to control directly.

---------

Co-authored-by: Paolo Gentili <[email protected]>
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.

5 participants