Skip to content
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

Remove gtk from camera multiple resolutions (New) #1400

Merged
merged 35 commits into from
Sep 18, 2024

Conversation

fernando79513
Copy link
Collaborator

@fernando79513 fernando79513 commented Aug 7, 2024

Description

The main objective of this test was to remove Clutter and Gtk dependencies from camera_test.py so we could run the multipe-resolution-images job on core devices without a display. The testing on the available core devices with camera required some additional fixes to the script, So this PR contains a bigger series of changes.:

  • The quiet argument has been included so the test can be run without creating an image window or importing Gtk.
  • The Clutter dependency has been removed.
  • The fswebcam capture has been isolated so it can be removed in the future if we consider.
  • The gstreamer pipelines have been updated to be able to capture images on "shiner" devices.
  • The display and still tests have been modified and renamed to video and image tests.
  • The script has been refactored to have more clear naming and structure.
  • The jobs have been updated.

Resolved issues

https://warthogs.atlassian.net/browse/CHECKBOX-1200

Documentation

The camera test script has been documented further inside the code adding more clear comments

Tests

To test this new script on a device, you can run any of the automated or manual camera tests:

checkbox-cli run com.canonical.certification::camera-cert-automated
checkbox-cli run com.canonical.certification::camera-cert-manual

submission_2024-08-08T14.05.34.803516.zip

Note:
On shiner-imx8-med-pdk001, gstreamer is not able to capture the image at 1640x1232, so the test times out. If that resolution is excluded, the test passes.

==============[ Running job 3 / 7. Estimated time left: 0:00:25 ]===============
-----------[ Webcam multiple resolution capture test for i.MX6S_CSI ]-----------
ID: com.canonical.certification::camera/multiple-resolution-images_video0
Category: com.canonical.plainbox::camera
... 8< -------------------------------------------------------------------------
Failed to validate image /tmp/camera_test_RG101640x1232tuwu9jue.jpg
Format: RG10 (10-bit Bayer RGRG/GBGB)
Resolutions: 3280x2464,1920x1080,1640x1232,640x480
Format: GBRG (8-bit Bayer GBGB/RGRG)
Resolutions: 3280x2464,1920x1080,1640x1232,640x480

Taking multiple images using the RG10 pixelformat
Saving debug image to /var/tmp/checkbox-ng/sessions/checkbox-run-2024-08-08T06.32.44.session/session-share/resolution_test_image_video0.jpg
Failed to capture image with fswebcam, using gstreamer
Timeout exceeded
Image saved to /var/tmp/checkbox-ng/sessions/checkbox-run-2024-08-08T06.32.44.session/session-share/resolution_test_image_video0.jpg
Taking a picture at 640x480
Failed to capture image with fswebcam, using gstreamer
Image saved to /tmp/camera_test_RG10640x4806wjpgc2m.jpg
Validated image /tmp/camera_test_RG10640x4806wjpgc2m.jpg
Taking a picture at 1640x1232
Failed to capture image with fswebcam, using gstreamer
Timeout exceeded
Image saved to /tmp/camera_test_RG101640x1232tuwu9jue.jpg
Image dimensions not found in JPEG file
------------------------------------------------------------------------- >8 ---
Outcome: job failed

With 1640x1232 excluded:

==============[ Running job 3 / 7. Estimated time left: 0:00:25 ]===============
-----------[ Webcam multiple resolution capture test for i.MX6S_CSI ]-----------
ID: com.canonical.certification::camera/multiple-resolution-images_video0
Category: com.canonical.plainbox::camera
... 8< -------------------------------------------------------------------------
Format: RG10 (10-bit Bayer RGRG/GBGB)
Resolutions: 3280x2464,1920x1080,1640x1232,640x480
Format: GBRG (8-bit Bayer GBGB/RGRG)
Resolutions: 3280x2464,1920x1080,1640x1232,640x480

Taking multiple images using the RG10 pixelformat
Saving debug image to /var/tmp/checkbox-ng/sessions/checkbox-run-2024-08-08T06.39.35.session/session-share/resolution_test_image_video0.jpg
Failed to capture image with fswebcam, using gstreamer
Image saved to /var/tmp/checkbox-ng/sessions/checkbox-run-2024-08-08T06.39.35.session/session-share/resolution_test_image_video0.jpg
Taking a picture at 640x480
Failed to capture image with fswebcam, using gstreamer
Image saved to /tmp/camera_test_RG10640x480va3xlq6e.jpg
Validated image /tmp/camera_test_RG10640x480va3xlq6e.jpg
Taking a picture at 1920x1080
Failed to capture image with fswebcam, using gstreamer
Image saved to /tmp/camera_test_RG101920x1080sg0kuplm.jpg
Validated image /tmp/camera_test_RG101920x1080sg0kuplm.jpg
Taking a picture at 3280x2464
Failed to capture image with fswebcam, using gstreamer
Image saved to /tmp/camera_test_RG103280x2464gvjpp57s.jpg
Validated image /tmp/camera_test_RG103280x2464gvjpp57s.jpg
------------------------------------------------------------------------- >8 ---
Outcome: job passed

@fernando79513 fernando79513 marked this pull request as draft August 7, 2024 22:30
Copy link

codecov bot commented Aug 7, 2024

Codecov Report

Attention: Patch coverage is 91.19171% with 17 lines in your changes missing coverage. Please review.

Project coverage is 47.29%. Comparing base (0881101) to head (1ca94f1).
Report is 134 commits behind head on main.

Files with missing lines Patch % Lines
providers/base/bin/camera_test.py 91.19% 12 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1400      +/-   ##
==========================================
+ Coverage   45.87%   47.29%   +1.42%     
==========================================
  Files         367      367              
  Lines       39156    39490     +334     
  Branches     6622     6671      +49     
==========================================
+ Hits        17961    18678     +717     
+ Misses      20504    20099     -405     
- Partials      691      713      +22     
Flag Coverage Δ
provider-base 24.02% <91.19%> (+4.11%) ⬆️

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.

@fernando79513 fernando79513 requested a review from pieqq August 8, 2024 14:18
@fernando79513 fernando79513 marked this pull request as ready for review August 8, 2024 14:18
Copy link
Collaborator

@Hook25 Hook25 left a comment

Choose a reason for hiding this comment

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

Overall I really like the changes here (especially the renames!). I have a few comments here and there

providers/base/bin/camera_test.py Outdated Show resolved Hide resolved
providers/base/bin/camera_test.py Outdated Show resolved Hide resolved
providers/base/bin/camera_test.py Outdated Show resolved Hide resolved
providers/base/bin/camera_test.py Outdated Show resolved Hide resolved
providers/base/bin/camera_test.py Outdated Show resolved Hide resolved
providers/base/bin/camera_test.py Show resolved Hide resolved
providers/base/bin/camera_test.py Outdated Show resolved Hide resolved
providers/base/bin/camera_test.py Outdated Show resolved Hide resolved
providers/base/bin/camera_test.py Outdated Show resolved Hide resolved
@fernando79513 fernando79513 added the waiting-for-changes The review has been completed but the PR is waiting for changes from the author label Aug 26, 2024
@fernando79513 fernando79513 removed the waiting-for-changes The review has been completed but the PR is waiting for changes from the author label Aug 28, 2024
@fernando79513 fernando79513 force-pushed the remove-gtk-from-camera-multiple-resolutions branch from 87f88ab to 1cf61c5 Compare September 18, 2024 13:00
Copy link
Collaborator

@Hook25 Hook25 left a comment

Choose a reason for hiding this comment

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

tyvm for doing this. Super cool, +1

@Hook25 Hook25 merged commit 6c66dd3 into main Sep 18, 2024
41 checks passed
@Hook25 Hook25 deleted the remove-gtk-from-camera-multiple-resolutions branch September 18, 2024 13:06
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.

2 participants