Skip to content

Conversation

@tomli380576
Copy link
Contributor

@tomli380576 tomli380576 commented Aug 22, 2025

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 as reboot_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:

  1. Is OpenGL version (from GL_VERSION) newer than 3.0? This requirement comes from gnome and GTK. Note that this is not true for GTK4, which requires OpenGL 4.6 / OpenGL ES 3.1 if using the GSK_RENDERER=ngl backend or vulkan 1.x for GSK_RENDERER=vulkan or unset according to GNOME
  2. Is the DUT using a hardware renderer? This part is the same as reboot_check_test.py -g except that it exits as soon as something goes wrong

A 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/

@tomli380576 tomli380576 marked this pull request as draft August 22, 2025 02:41
@codecov
Copy link

codecov bot commented Aug 22, 2025

Codecov Report

❌ Patch coverage is 93.33333% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.56%. Comparing base (e3775c5) to head (eab56d8).
⚠️ Report is 96 commits behind head on main.

Files with missing lines Patch % Lines
providers/base/bin/gl_support.py 93.33% 2 Missing and 3 partials ⚠️
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     
Flag Coverage Δ
checkbox-ng 70.76% <ø> (-0.15%) ⬇️
checkbox-support 64.93% <ø> (-0.14%) ⬇️
provider-base 30.88% <93.33%> (+2.85%) ⬆️
provider-certification-client 57.14% <ø> (ø)
provider-certification-server 57.14% <ø> (ø)
provider-genio 96.90% <ø> (ø)
provider-gpgpu 93.06% <ø> (ø)
provider-iiotg 100.00% <ø> (ø)
provider-resource 39.38% <ø> (ø)
provider-sru 97.97% <ø> (ø)

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.

@tomli380576 tomli380576 marked this pull request as ready for review August 22, 2025 07:40
@tomli380576 tomli380576 linked an issue Aug 26, 2025 that may be closed by this pull request
1 task
@tomli380576 tomli380576 marked this pull request as draft August 27, 2025 02:06
@tomli380576 tomli380576 marked this pull request as ready for review August 27, 2025 02:22
@tomli380576 tomli380576 marked this pull request as draft August 27, 2025 02:37
@tomli380576 tomli380576 marked this pull request as ready for review August 27, 2025 02:49
rickwu666666
rickwu666666 previously approved these changes Sep 25, 2025
Copy link
Contributor

@rickwu666666 rickwu666666 left a 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/

Copy link
Collaborator

@fernando79513 fernando79513 left a 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

Copy link

Copilot AI left a 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 GLSupport class with GLSupportTester that uses glmark2 instead of unity_support_test
  • Added CLI option --glmark2-override to 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.

@tomli380576 tomli380576 marked this pull request as draft November 24, 2025 07:56
@tomli380576 tomli380576 marked this pull request as ready for review November 25, 2025 02:55
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.

The *gl_support* test fails with NV driver installed under Wayland

4 participants