Test/improve coverage and screen capture#45
Open
roshan-ku wants to merge 8 commits into
Open
Conversation
* ci: add CodeQL Advanced workflow for C/C++ analysis Adds .github/workflows/codeql.yml, adapted from GitHub's default CodeQL Advanced setup template for this repo: - reduced language matrix to c-cpp (only language used in this repo) - build-mode set to manual, reusing the environment-check and build-dvledtx composite actions so CodeQL traces the same meson/ninja build the rest of CI performs - pinned actions/checkout and github/codeql-action to the same SHAs already used elsewhere in this repo's workflows - added concurrency group and job timeout consistent with other workflows in this repo * ci: align CodeQL workflow with Coverity pattern - codeql.yml: simplified to match coverity.yml (weekly schedule + workflow_dispatch only, single job, minimal permissions), dropping the push/pull_request triggers and language matrix since this repo only analyzes c-cpp. - scan_on_demand.yml: added CodeQL init/build/analyze steps alongside the existing Coverity Scan step, so an on-demand scan also runs CodeQL. * ci: extract CodeQL init/build/analyze into a reusable composite action Adds .github/actions/analysis/codeql/action.yml (Initialize CodeQL, Build dvledtx, Perform CodeQL Analysis), matching the pattern used by the other .github/actions/analysis/* actions (coverity, trivy, etc). codeql.yml and scan_on_demand.yml now both call this single composite action instead of duplicating the three inline steps.
…cess tests - Fix test_open_ffmpeg_tx_uses_app_defaults OOB (idx=1 -> idx=0) after the exactly-sized session_net refactor - Add mtl_tx get_input_format and guard/error-path tests (33% -> 53%) - Add ffmpeg_tx multi-NIC and raw-YUV send tests (68% -> 72%) - Add config_reader 12-bit format and scaling tests - Add opt-in x11grab screen-capture success tests (shared + per-session) that self-skip unless DVLED_TEST_DISPLAY is set; test.sh auto-detects a live X display
…rage Add config_reader validation branch tests (nic_index range, crop bounds, payload_type range, chroma alignment), resolve_ip_addrs tests, mtl_tx copy-crop error-path tests, and an ffmpeg_tx crop-failure test. Raises overall line coverage from 79% to 81%.
There was a problem hiding this comment.
Pull request overview
This PR primarily expands unit/integration-style test coverage around TX paths (MTL direct + FFmpeg avdevice), config validation, and opt-in screen-capture, and adds CodeQL scanning to the GitHub Actions security workflow set.
Changes:
- Add new cmocka tests covering additional pixel formats, guard/error branches, config validation, and FFmpeg TX/crop failure paths.
- Add opt-in “live X display” screen-capture success tests plus CI-side display auto-detection in
scripts/test.sh. - Introduce a CodeQL composite action and workflows (scheduled + on-demand) to upload SARIF to the Security tab.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_mtl_tx.c | Adds format-mapping coverage plus new guard/error-path tests for MTL TX helpers. |
| tests/test_ffmpeg_tx_mock.c | Adds tests for crop-failure, multi-NIC setup, and raw-YUV send paths. |
| tests/test_ffmpeg_decoder_mock.c | Adds opt-in success-path tests for x11grab screen capture when a live X display is available. |
| tests/test_config_reader.c | Expands validation and config-application tests (NIC index, crop alignment, payload type, scaling, IP resolution). |
| scripts/test.sh | Adds auto-detection of a live X display to enable opt-in screen-capture tests. |
| .github/workflows/scan_on_demand.yml | Adds CodeQL scanning step to the on-demand security scan workflow. |
| .github/workflows/codeql.yml | Adds a scheduled + manual CodeQL workflow using the repo’s composite actions. |
| .github/actions/analysis/codeql/action.yml | New composite action to run CodeQL init/build/analyze for C/C++. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Assert destination planes remain zero-filled after mtl_copy_crop_to_frame early-returns on invalid/exceeding crop rects, so the no_copy tests validate the contract rather than just absence of a crash. - Only append screen '.0' to the detected DISPLAY when it does not already specify a screen, avoiding invalid x11grab sources like ':0.0.0+0,0'.
Remove the CodeQL workflow, CodeQL analysis action, and the CodeQL scan step in scan_on_demand.yml that were inadvertently included; this PR is scoped to test coverage and screen-capture only.
Add test_mtl_tx_stub.c wrapping the MTL library calls (mtl_init/uninit, st20p_tx_create/free/get_frame/put_frame, etc.) to exercise mtl_tx_init, mtl_tx_session_create/free and the send paths without a NIC/DPDK. Raises src/mtl/mtl_tx.c coverage from 55% to 98%.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Checklist
Code Quality
Testing
Review Readiness
Documentation
Security
PR Type
What kind of change does this PR introduce?