Add initial VuMark generation API test#2931
Conversation
See #2942 to add back the ValidatorError handling once tests cover those branches.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| request_method=request.method or "", | ||
| request_path=request.path_url, | ||
| databases=self._target_manager.databases, | ||
| ) |
There was a problem hiding this comment.
Missing ValidatorError handling in VuMark route handler
High Severity
The generate_vumark_instance method in the requests-mock server calls run_services_validators without wrapping it in try/except ValidatorError, unlike every other route handler in this file. When validation fails (e.g., bad auth, unknown target, missing keys), the ValidatorError propagates as an unhandled exception through the responses mock callback instead of being converted into a proper HTTP error response via exc.status_code, exc.headers, exc.response_text.
| request: pytest.FixtureRequest, | ||
| vuforia_database: VuforiaDatabase, | ||
| inactive_database: VuforiaDatabase, | ||
| vumark_vuforia_database: VuMarkVuforiaDatabase, |
There was a problem hiding this comment.
Shared fixtures now mandate VuMark credentials without skip
Medium Severity
The vumark_vuforia_database fixture was added as a parameter to verify_mock_vuforia and mock_only_vuforia, which are shared fixtures used by pre-existing tests (e.g., test_add_target.py). The _VuMarkVuforiaDatabaseSettings has required fields without defaults, so if VUMARK_VUFORIA_* env vars aren't configured, pydantic raises a ValidationError — causing all tests using these shared fixtures to error, not just VuMark tests. The PR description states the fixture skips when credentials are missing, but no pytest.skip() logic exists.
Additional Locations (2)
The previous default '<SHARED_VUMARK_TARGET_ID>' contained '<' and '>' which are not matched by the target ID URL pattern [A-Za-z0-9]+, causing the mock to fail to route requests in tests.
The windows-tests and skip-tests CI jobs copy this file directly, so the VUMARK_VUFORIA_TARGET_ID value must be alphanumeric to match the [A-Za-z0-9]+ URL pattern.


This introduces the first VuMark generation API test by sending a signed request to POST /targets/{id}/instances and asserting the expected missing-target response. It also adds a dedicated VuMark credentials fixture sourced from VUMARK_VUFORIA_* environment variables for server-key auth. If VuMark credentials are not configured, the fixture skips the test so the rest of the suite remains unaffected.
Note
Medium Risk
Introduces a new API surface and validation path plus binary response handling, which could affect request routing/validation for VWS endpoints if edge cases regress.
Overview
Adds initial support for the VuMark generation API by implementing
POST /targets/<target_id>/instancesin both the Flask andresponses-based mocks, returning a deterministic PNG payload.Extends request validation to recognize the new route (required
instance_id) and correctly extracttarget_idfrom/targets/<id>/instances, and adds a signed integration test plus fixtures/config/docs updates for dedicatedVUMARK_VUFORIA_*credentials (including CI running the new test).Written by Cursor Bugbot for commit 270f9d9. This will update automatically on new commits. Configure here.