canonical / canonical/checkbox

resolution_test.py uses deprecated GDK function

Open
#2,256 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
52
Forks
81
Avg merge
2d 18h
Merged PRs (30d)
70

Description

### Bug Description

On a recent Noble SRU test: https://certification.canonical.com/hardware/202008-28109/submission/463479/

the resolution_test.py job failed, and while looking into that I noticed the deprecation warning. This should be addressed to clear these warnings (noise) from the results and also to be ready for when this function goes away.

/tmp/nest-l_nt8jg2.6e83b59da52f9107948b3064f37269c15a2f7b95244dd45ed99038120adfb1b6/resolution_test.py:24: DeprecationWarning: Gdk.Screen.get_primary_monitor is deprecated
geom = screen.get_monitor_geometry(screen.get_primary_monitor())
/tmp/nest-l_nt8jg2.6e83b59da52f9107948b3064f37269c15a2f7b95244dd45ed99038120adfb1b6/resolution_test.py:24: DeprecationWarning: Gdk.Screen.get_monitor_geometry is deprecated
geom = screen.get_monitor_geometry(screen.get_primary_monitor())

### Cert-blocker Test Case

- [ ] cert-blocker

### To Reproduce

run sru and the resolution test
notice deprecation warnings

### Expected Result

we are not using deprecated functions, or if older versions of GDK still need to be supported, the code handles both cases (tests for new versions and then falls back to the old one when needed).

### Actual Result

currently we call a function throwing a deprecation warning

### Environment

SRU: stock noble linux-generic
Jenkins URL: http://10.102.156.15:8080/job/cert-stock-sru-noble-desktop-prodesk-400-g7-sku3-28109/37/

### Relevant log output

```shell

```

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with resolution_test.py, especially line 24, and inspect the GDK calls producing the deprecation warnings. Run the resolution test in the Noble SRU environment to confirm the current warnings. Done means the test avoids deprecated functions while preserving support for older GDK versions if required.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.