-
Notifications
You must be signed in to change notification settings - Fork 71
Update gl support test to use glmark2 (New) #2087
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2087 +/- ##
==========================================
+ Coverage 52.01% 52.56% +0.55%
==========================================
Files 388 393 +5
Lines 41794 42680 +886
Branches 7771 7991 +220
==========================================
+ Hits 21738 22436 +698
- Misses 19282 19441 +159
- Partials 774 803 +29
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
rickwu666666
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried with my project which is using mali GPU, and the change works perfectly.
https://certification.canonical.com/hardware/202507-36924/submission/451589/test-results/pass/
fernando79513
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work here, and sorry for being so slow reviewing this.
I've added a couple of comments. Maybe we can reuse some code to get rid of get_desktop_environment_variables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR modernizes the OpenGL support testing by replacing the deprecated unity_support_test (unmaintained for ~10 years) with glmark2. The update validates two key requirements: OpenGL version >= 3.0 (per GNOME/GTK standards) and hardware renderer usage.
Key Changes
- Replaced
GLSupportclass withGLSupportTesterthat uses glmark2 instead of unity_support_test - Added CLI option
--glmark2-overrideto manually select glmark2 binary - Implemented comprehensive unit tests covering various scenarios (hardware/software renderers, version checks, session types)
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| providers/base/bin/gl_support.py | Complete rewrite to use glmark2 for OpenGL validation with desktop environment detection and symlink handling for snap containers |
| providers/base/tests/test_gl_support.py | Comprehensive test suite covering happy paths, error conditions, and edge cases for the new glmark2-based implementation |
| providers/base/tests/test_data/glmark2_ok.txt | Test data for successful OpenGL 4.6 validation |
| providers/base/tests/test_data/glmark2_es2_ok.txt | Test data for successful OpenGL ES 3.2 validation |
| providers/base/tests/test_data/glmark2_llvmpipe.txt | Test data for software renderer (llvmpipe) detection |
| providers/base/tests/test_data/glmark2_es2_llvmpipe.txt | Test data for OpenGL ES software renderer detection |
| providers/base/tests/test_data/glmark2_version_too_old.txt | Test data for OpenGL version below minimum requirement |
| providers/base/tests/test_data/gl_support_succ.txt | Removed obsolete unity_support_test success output |
| providers/base/tests/test_data/gl_support_succ_changed.txt | Removed obsolete unity_support_test processed output |
| providers/base/tests/test_data/gl_support_fail.txt | Removed obsolete unity_support_test failure output |
| providers/base/tests/test_data/gl_support_fail_changed.txt | Removed obsolete unity_support_test processed output |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Resolved issues
This PR updates the
1_gl_support_*cases from unity_support_test to glmark2 since the former has not been updated for almost 10 years. This new test uses almost exactly the same logic asreboot_check_test#1677 except that it just throws exceptions to fail early instead of trying to catch them.Documentation
We are checking 2 things in this test:
GSK_RENDERER=nglbackend or vulkan 1.x forGSK_RENDERER=vulkanor unset according to GNOMEreboot_check_test.py -gexcept that it exits as soon as something goes wrongA new cli option has been added:
--glmark2-override: manually select the glmark2 binary to run. Caller is responsible for checking whether this binary exists.Tests
Unit tests
https://certification.canonical.com/hardware/202411-36032/submission/445444/