Skip to content

feat/cmcd-v2-request-validation#163

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

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

Conversation

@littlespex
Copy link

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

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.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

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.

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