Skip to content

feat/cmcd-v2-request-validation#163

Merged
cotid-qualabs merged 6 commits into
feature/cmcdv2from
feat/cmcd-v2-validation
Mar 4, 2026
Merged

feat/cmcd-v2-request-validation#163
cotid-qualabs merged 6 commits into
feature/cmcdv2from
feat/cmcd-v2-validation

Conversation

@littlespex

Copy link
Copy Markdown

Add functional tests to validate CMCD version 2 requests

littlespex and others added 4 commits February 20, 2026 00:03
Adds comprehensive E2E tests using Playwright to validate CMCD v2 payloads
at the network level during real playback. Uses @svta/cml-cmcd validation
functions (validateCmcd, validateCmcdHeaders, validateCmcdEvent, validateCmcdKeys)
for spec-level compliance checks across query, header, and event modes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…CD v2

Replace the Playwright-based E2E test suite with Karma functional tests
that use XHR interceptors to validate CMCD v2 spec compliance. This
eliminates the @playwright/test dependency (~100MB) while maintaining
full test coverage across all three transmission modes (query, header,
event), key filtering, and version validation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CmcdRequestCollector now stores raw CMCD strings instead of pre-parsed
objects, removing its dependency on @svta/cml-cmcd entirely. Tests use
validation function return values (result.data) for both spec validation
and data assertions in a single pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @littlespex, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the project's testing capabilities by adding a suite of functional tests for CMCD version 2. These tests ensure that CMCD data is correctly generated and transmitted in various modes (query, header, and event), validating adherence to the CMCD v2 specification. The changes also include necessary dependency updates and a new utility for collecting request data during tests.

Highlights

  • CMCD v2 Functional Tests: Introduced comprehensive functional tests to validate CMCD version 2 requests across query, header, and event modes.
  • CMCD Request Collector: Added a new utility class, CmcdRequestCollector, to monkey-patch XMLHttpRequest and capture CMCD data for testing purposes.
  • Dependency Updates: Updated several @svta/cml-* dependencies to their latest versions, including @svta/cml-cmcd to 2.2.0, and added baseline-browser-mapping as a dev dependency.
  • Test Configuration: Expanded the smoke.json test configuration to include a new VOD stream for CMCD v2 validation.
  • CMCD Key Filtering and Versioning: Implemented tests to verify correct CMCD key filtering based on configuration and ensured proper version reporting (v=2) in requests.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .gitignore
    • Added 'test-results' directory to be ignored.
  • package-lock.json
    • Updated @svta/cml-608 from 1.0.1 to 1.0.2.
    • Updated @svta/cml-cmcd from 2.1.1 to 2.2.0.
    • Updated @svta/cml-cmsd from 1.0.4 to 1.0.5.
    • Updated @svta/cml-dash from 1.0.4 to 1.0.5.
    • Updated @svta/cml-id3 from 1.0.4 to 1.0.5.
    • Updated @svta/cml-request from 1.0.6 to 1.0.9.
    • Updated @svta/cml-xml from 1.1.2 to 1.1.3.
    • Added baseline-browser-mapping dev dependency version 2.10.0.
  • package.json
    • Added baseline-browser-mapping dev dependency with version ^2.10.0.
    • Updated @svta/cml-608 from 1.0.1 to 1.0.2.
    • Updated @svta/cml-cmcd from 2.1.1 to 2.2.0.
    • Updated @svta/cml-cmsd from 1.0.4 to 1.0.5.
    • Updated @svta/cml-dash from 1.0.4 to 1.0.5.
    • Updated @svta/cml-id3 from 1.0.4 to 1.0.5.
    • Updated @svta/cml-request from 1.0.6 to 1.0.9.
    • Updated @svta/cml-xml from 1.1.2 to 1.1.3.
  • test/functional/config/test-configurations/streams/smoke.json
    • Added a new test stream configuration for 'BBB 30fps VOD' to include CMCD v2 functional tests.
  • test/functional/helpers/CmcdRequestCollector.js
    • Added a new helper class CmcdRequestCollector to intercept and collect CMCD data from XHR requests for testing.
  • test/functional/src/Constants.js
    • Added a new constant TESTCASES.FEATURE_SUPPORT.CMCD_V2 for the new test suite.
  • test/functional/test/feature-support/cmcd-v2.js
    • Added a new functional test file for CMCD v2 request validation, covering query, header, and event modes, key filtering, and version checks.
Activity
  • Functional tests for CMCD version 2 request validation were added to ensure proper implementation and adherence to the specification.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces a comprehensive suite of functional tests for CMCD version 2, which is a great addition for ensuring the correctness of the implementation. The new tests are well-structured, covering query mode, header mode, event mode, key filtering, and versioning aspects. The introduction of CmcdRequestCollector.js to intercept and inspect XHR requests is a solid approach for this kind of testing. The code is of high quality. I have one minor suggestion to improve debuggability in the new test helper.

Comment thread test/functional/helpers/CmcdRequestCollector.js Outdated
littlespex and others added 2 commits February 22, 2026 22:13
…ests

Rewrite CmcdRequestCollector with a single requests array storing
httpRequest objects compatible with CML's validateCmcdRequest(). Replace
mode-specific validators (validateCmcd, validateCmcdHeaders) with the
unified validateCmcdRequest() and remove the invalid validateCmcdKeys
test that was passing a string to a function expecting a parsed object.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cotid-qualabs cotid-qualabs merged commit 5ceaacb into feature/cmcdv2 Mar 4, 2026
1 check passed
cotid-qualabs added a commit that referenced this pull request Jun 10, 2026
* Feature MPD  update on validity expiration (#68)

* Revert "Feature MPD  update on validity expiration (#68)"

This reverts commit bf31094.

* feat: implement CMCD v2 functionality

* event mode with body transmission mode only

* remove url encode from body transmission mode

* add editable configs to cmcd sample page

* add src input to cmcd v2 sample page

* create provider for CMCDParameters lazy loading

* chore: CMCDv2 migration to CMCD Reporter (#159)

* cmcd reporter initialization

* request mode migration

* event mode migration

* cmcd model migration

* fix cmcd model unit tests

* fixes for cmcd parameters and cleanup -
protection controller fixes WIP

* cleanup and update unit tests

* refactor unit tests and fixes

* fix unit tests and remove batchTimer

* Cmcdv2: keys compliance check (#160)

* ab, lab and tab inner list and request mode

* ab, tab and lab inner list for v2

* bl inner list and event mode

* br inner list and event mode

* toInnerList helper

* bsd inner list

* mtp inner list and event mode

* nor inner list

* pb inner list and event mode

* tp inner list and event mode

* tpb inner list and event mode

* fix unit tests

* feat: update CML dependencies

* fix race condition on cmcd contrller for cmcd parameters

* Feature/cmcdv2 update (#162)

* chore: update CML dependencies

* fix: update common media request

* fix: update resourceTiming properties to use performance.now()

* fix: update cmcd data formatting

* fix: remove redundant rr values

* refactor: simplify cmcd reporting

* fix: test mock requests missing parameters

* chore: update cml cmcd version

* should not send report if events are undefined

* fix unit tests

---------

Co-authored-by: cotid-qualabs <constanzad@qualabs.com>

* feat/cmcd-v2-request-validation (#163)

* feat: add CMCD v2 Playwright E2E tests with spec validation

Adds comprehensive E2E tests using Playwright to validate CMCD v2 payloads
at the network level during real playback. Uses @svta/cml-cmcd validation
functions (validateCmcd, validateCmcdHeaders, validateCmcdEvent, validateCmcdKeys)
for spec-level compliance checks across query, header, and event modes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: replace Playwright E2E tests with Karma functional tests for CMCD v2

Replace the Playwright-based E2E test suite with Karma functional tests
that use XHR interceptors to validate CMCD v2 spec compliance. This
eliminates the @playwright/test dependency (~100MB) while maintaining
full test coverage across all three transmission modes (query, header,
event), key filtering, and version validation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: remove double parsing from CMCD v2 tests

CmcdRequestCollector now stores raw CMCD strings instead of pre-parsed
objects, removing its dependency on @svta/cml-cmcd entirely. Tests use
validation function return values (result.data) for both spec validation
and data assertions in a single pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: update cml packages

* fix: add logging to xhr collector

* refactor: use unified collector and validateCmcdRequest for CMCD v2 tests

Rewrite CmcdRequestCollector with a single requests array storing
httpRequest objects compatible with CML's validateCmcdRequest(). Replace
mode-specific validators (validateCmcd, validateCmcdHeaders) with the
unified validateCmcdRequest() and remove the invalid validateCmcdKeys
test that was passing a string to a function expecting a parsed object.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* chore: update CMCD version

* Dedicated sample section for CMCD

* Use headers transmission mode string from CML

* Align CMCD v2 config naming with CML spec

Rename targets->eventTargets, timeInterval->interval, includeOnRequests->
includeInRequests across settings, samples, and tests. Switch event
validation to validateCmcdEvents (batch). HTTPLoader now accepts empty
POST bodies so CMCD event endpoints don't trigger retries.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore: update cml versions

* Catch errors in recordResponseReceived

* Fix wrong URLs in CMCD demos

* Small refactoring in DashManifestModel.js

* Minor refactoring

* Cleanup all events in CmcdController.js when resetting

* Refactor CustomParametersModel.js

* Add CMCD version to reference UI

* Small refactoring in CmcdModel.js

* Add link to sample setion in reference UI

* Add missing CMCD fields to JSDoc in Settings.js

* Add include in requests CMCD field to reference UI

* Add a warning when catching an error in the CmcdController.js

* Add a simple express.js server that the local CMCD demos can report against

* Refactoring of CMCD demo and classes

* Additional CMCD refactoring

* fix: update CML dependencies to address missing CMCD nor values

* Check for CMCD enabled directly for each request

* Function renaming for CMCD

* Rework the CMCD samples

* Fix unit tests

* Adjust samples

* Fix linting issues

* Rename context to dataContext for clarity

* Fix wrong use of this instead of instance

* Reset _isSeeking and remove wrong payload for getGenericCmcdData

* Remove duplicate entries in HTTPRequest.js

* Do not execute CMCD tests when no init segment was identified

* Avoid error when representationController is not defined in _onDataUpdateCompleted

---------

Co-authored-by: Sebastian Piquerez <89274285+sebastianpiq@users.noreply.github.com>
Co-authored-by: Casey Occhialini <1508707+littlespex@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Daniel Silhavy <daniel.silhavy@fokus.fraunhofer.de>
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