Skip to content

Test/improve coverage and screen capture#45

Open
roshan-ku wants to merge 8 commits into
OpenVisualCloud:mainfrom
roshan-ku:test/improve-coverage-and-screen-capture
Open

Test/improve coverage and screen capture#45
roshan-ku wants to merge 8 commits into
OpenVisualCloud:mainfrom
roshan-ku:test/improve-coverage-and-screen-capture

Conversation

@roshan-ku

Copy link
Copy Markdown
Contributor

Description

Checklist

Code Quality

  • Code follows project style guidelines
  • No unnecessary debug logs or commented-out code
  • No hardcoded values / secrets

Testing

  • Unit test added/modified accordingly
  • Perform manual basic sanity testing at system level

Review Readiness

  • PR title and description are clear and meaningful
  • Story/Task IDs are linked

Documentation

  • README or relevant docs updated (if applicable)

Security

  • No sensitive data exposed (keys, passwords, tokens)
  • Input validation added where needed

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Documentation content changes
  • Testing
  • Other... Please describe:

* 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%.

Copilot AI left a comment

Copy link
Copy Markdown

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 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.

Comment thread tests/test_mtl_tx.c
Comment thread tests/test_mtl_tx.c
Comment thread scripts/test.sh
- 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%.
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