feat/cmcd-v2-request-validation#163
Conversation
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>
Summary of ChangesHello @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
🧠 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
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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.
…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>
Add functional tests to validate CMCD version 2 requests