Skip to content

Conversation

@Mat001
Copy link
Contributor

@Mat001Mat001 commented Dec 5, 2025

Add cmab acceptance tests
Update other tests to accommodate cmab.

https://optimizely-ext.atlassian.net/browse/FSSDK-11725

@Mat001Mat001 self-assigned this Dec 5, 2025
Mat001and others added 13 commits December 5, 2025 12:51
OptimizelyConfig from go-sdk does not include CMAB flags in featuresMap, so the /v1/config endpoint won't return them. CMAB experiments are still tested through decide, activate, and dedicated CMAB tests.
The actual datafile response from the SDK includes 'holdouts' and 'region' fields that were missing from our expected response.
When using ENABLED_FLAGS_ONLY, CMAB flag with 'off' variation (enabled=false) gets filtered out. The test now handles this case gracefully by making the CMAB flag optional and only validating it if present.
Fixed incorrect escaping in triple-quoted string - changed from \" to " for proper JSON parsing.
Changed "Audience1" to "\"Audience1\"" in all audiences fields to match the actual API response format. In triple-quoted Python strings, quotes should be escaped with \" not \\" for proper JSON parsing. All 9 CMAB acceptance tests now pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
…trings In Python triple-quoted strings, \\" is needed (not \") to produce a backslash-quote (\") in the actual string content. Single backslash-quote just produces a quote, resulting in invalid JSON like ""Audience1"". The correct escaping: \\"Audience1\\" → \"Audience1\" → "Audience1" (parsed) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
The conditions field had single backslashes instead of double backslashes, causing JSON parsing to fail. This restores the correct escaping format that matches the master branch. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
The /v1/config API response for revision 139 includes cmab_flag in the featuresMap, so the expected_config needs to include it as well. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
The API response has cmab_flag at the end of featureFlags array and cmab rollout at the end of rollouts array. Reorder to match actual response. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Changed variation ID from 1579277 to 1579279 for the 'off' variation in the CMAB experiment to match the actual API response. This fixes the test_datafile_success test failure. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
The Optimizely API is consistently returning variation ID 1579277 for the CMAB 'off' variation, not 1579279. Reverting to match the actual API response. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Copy link

@pvcravenpvcraven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add additional CMAB tests.

@Mat001Mat001 merged commit 2bf50ce into masterDec 10, 2025
12 checks passed
@Mat001Mat001 deleted the mpirnovar-cmab-accept-tests-fssdk-11725 branch December 10, 2025 19:05
Sign up for freeto 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.

3 participants

@Mat001@pvcraven