Skip to content

Add initial VuMark generation API test#2931

Merged
adamtheturtle merged 26 commits intomainfrom
adamtheturtle/vumark-api-test
Feb 18, 2026
Merged

Add initial VuMark generation API test#2931
adamtheturtle merged 26 commits intomainfrom
adamtheturtle/vumark-api-test

Conversation

@adamtheturtle
Copy link
Member

@adamtheturtle adamtheturtle commented Feb 16, 2026

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>/instances in both the Flask and responses-based mocks, returning a deterministic PNG payload.

Extends request validation to recognize the new route (required instance_id) and correctly extract target_id from /targets/<id>/instances, and adds a signed integration test plus fixtures/config/docs updates for dedicated VUMARK_VUFORIA_* credentials (including CI running the new test).

Written by Cursor Bugbot for commit 270f9d9. This will update automatically on new commits. Configure here.

See #2942 to add back
the ValidatorError handling once tests cover those branches.
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

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,
)
Copy link

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

request: pytest.FixtureRequest,
vuforia_database: VuforiaDatabase,
inactive_database: VuforiaDatabase,
vumark_vuforia_database: VuMarkVuforiaDatabase,
Copy link

Choose a reason for hiding this comment

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

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)

Fix in Cursor Fix in Web

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.
@adamtheturtle adamtheturtle merged commit 7550c05 into main Feb 18, 2026
106 checks passed
@adamtheturtle adamtheturtle deleted the adamtheturtle/vumark-api-test branch February 18, 2026 09:08
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.

1 participant