Skip to content

Add test for inactive database in VuMark API#3003

Merged
adamtheturtle merged 10 commits intomainfrom
adamtheturtle/add-license-server-url
Feb 23, 2026
Merged

Add test for inactive database in VuMark API#3003
adamtheturtle merged 10 commits intomainfrom
adamtheturtle/add-license-server-url

Conversation

@adamtheturtle
Copy link
Member

@adamtheturtle adamtheturtle commented Feb 22, 2026

Summary

This test verifies that calling the VuMark generation endpoint with credentials from an inactive database correctly returns a ProjectInactive error. This completes the test coverage for issue #3002.

Changes

  • Adds new test file tests/mock_vws/test_vumark_generation.py
  • Includes TestInactiveDatabase class with test for inactive database behavior
  • Helper function _make_vumark_request for making raw HTTP requests to the VuMark API

🤖 Generated with Claude Code


Note

Medium Risk
Changes request validation and serialization around PROJECT_INACTIVE handling for VuMarkDatabase, which can alter API responses for inactive projects. Scope is contained but touches core request gating logic.

Overview
Adds state support to VuMarkDatabase (includes state_name in to_dict/from_dict) and updates Target Manager POST /vumark_databases to accept an optional state_name when creating databases.

Adjusts validate_project_state so PROJECT_INACTIVE enforcement no longer blocks VuMark databases, and extends test infrastructure (new inactive VuMark credentials/fixtures, backend setup, and env example vars) plus a new VuMark generation test asserting inactive VuMark credentials return 404 with UNKNOWN_TARGET.

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

This test verifies that calling the VuMark generation endpoint with credentials from an inactive database returns a ProjectInactive error.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Avoids duplicating _make_vumark_request by placing TestInactiveDatabase in test_vumark_generation_api.py where the helper already exists.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Add state support to VuMarkDatabase, add InactiveVuMarkCloudDatabase
fixture using INACTIVE_VUMARK_VUFORIA_* env vars, and update
project_state_validators to raise ProjectInactiveError for inactive
VuMark databases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…-arguments

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tInactive

Real Vuforia returns 404 UnknownTarget for inactive VuMark databases on the
generation endpoint, not 403 ProjectInactive. Skip the project-inactive check
for VuMarkDatabase so target validation runs and returns the correct response.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.


assert response.status_code == HTTPStatus.NOT_FOUND
response_json = response.json()
assert response_json["result_code"] == ResultCodes.UNKNOWN_TARGET.value
Copy link

Choose a reason for hiding this comment

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

Test asserts wrong error, doesn't test inactive behavior

Medium Severity

The docstring says "returns ProjectInactive" but the assertions check for HTTPStatus.NOT_FOUND and ResultCodes.UNKNOWN_TARGET. The validate_project_state function explicitly exempts VuMarkDatabase from raising ProjectInactiveError (it always returns early), so the request falls through to validate_target_id_exists, which fails because the random target_id doesn't exist. This test doesn't actually verify inactive database behavior — it verifies unknown target behavior, which would produce the same result on an active database with a nonexistent target.

Additional Locations (1)

Fix in Cursor Fix in Web

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@adamtheturtle adamtheturtle merged commit 555a2d1 into main Feb 23, 2026
106 checks passed
@adamtheturtle adamtheturtle deleted the adamtheturtle/add-license-server-url branch February 23, 2026 10:54
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