Skip to content

test: cover instance queries and manual index preparation - #20

Open
brnskn wants to merge 1 commit into
masterfrom
feature/instance-query-regression-tests
Open

brnskn wants to merge 1 commit into
masterfrom
feature/instance-query-regression-tests

Conversation

@brnskn

@brnskn brnskn commented Sep 16, 2026

Copy link
Copy Markdown

Summary

Add HTTP regression scenarios for instance filtering, filter value limits, pagination and manual attribute index preparation. These scenarios exercise a locally built runtime in an isolated environment and accompany vnext PR #987.

Changes

  • Add test_instance_queries.py with a shared API-created fixture for JSON filter safety, 1000-character operand limits and persisted-data checks.
  • Cover pagination boundaries, requested sorting, stable ID tie-breaks, page hydration and following next-page links across supported query formats.
  • Add manual index checks for publication without automatic DDL/jobs, offline CLI SQL generation, explicit DBA-style execution, replay and subsequent Master updates.
  • Retain the superseded automatic index experiment as historical evidence, clearly separated from the current manual contract.
  • Document setup, recorded results and known limitations, and register the scenarios in TEST-SCENARIOS.md.

Validation

Previously completed against isolated, locally built runtime environments; these E2E runs were not repeated while preparing this PR:

  • Filter value limits: 25/25 checks passed; all 36/36 HTTP traces verified.
  • Pagination and ordering: 611/611 checks passed; all 192/192 HTTP traces verified, with ordered SQL paging and persisted data inspected.
  • Manual index preparation: 4/4 checks passed.
  • The original injection baseline passed 59/63 checks; four legacy-format newline cases returned HTTP 400. The README also records request-envelope limitations. These are not reported as fixed.

Checks performed for this PR:

  • Python syntax validation passed for all four scripts; the renamed instance-query runner's --help command passed.
  • Whitespace validation passed.
  • Component validation could not run: npm is unavailable, and invoking its underlying node validate.js command failed because ajv is missing. No workflow component definitions are changed.

@brnskn
brnskn requested review from a team and a lite review from Copilot September 16, 2026 08:38
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 2acb583e-d69d-41e4-860c-e64bf5e21249


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-16T08:40:42.926476Z 62e98ef PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The historical test_auto_indexes.py currently reads required environment variables before the deprecation exit, so it can crash with KeyError instead of cleanly reporting that it is intentionally non-runnable.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This PR adds end-to-end Python regression scenarios that exercise a locally built vNext runtime for instance-list querying (filtering/value limits/pagination) and for the new “manual DBA-owned” attribute index preparation workflow, then registers these scenarios in the repo’s scenario matrix.

Changes:

  • Add api-tests/instance-queries scripts and documentation to validate JSON filter safety, operand length limits, and pagination/ordering + HATEOAS next-link behavior against a persisted PostgreSQL fixture.
  • Add api-tests/attribute-index-preparation/test_manual_indexes.py (plus README) to validate the manual/offline index preparation contract via CLI-generated SQL and explicit execution.
  • Update TEST-SCENARIOS.md to register the new scenarios and mark the automatic index experiment as historical.
File summaries
File Description
TEST-SCENARIOS.md Registers the new instance-query and attribute-index-preparation scenarios and their recorded results.
api-tests/instance-queries/test_instance_queries.py New E2E harness that publishes a fixture workflow, starts instances, runs filter/value-limit checks or pagination checks, and verifies persisted PostgreSQL data.
api-tests/instance-queries/pagination_checks.py Pagination/order/tie-break/next-link assertions reused by the instance query fixture.
api-tests/instance-queries/README.md Runbook + pass criteria and recorded baseline/verified results for instance query regressions.
api-tests/attribute-index-preparation/test_manual_indexes.py New E2E harness for manual/offline index preparation (CLI SQL generation + DBA-style execution + replay checks).
api-tests/attribute-index-preparation/test_auto_indexes.py Retains the superseded automatic-preparation experiment, but now blocks execution via a deprecation exit.
api-tests/attribute-index-preparation/README.md Documents the manual contract and retains historical notes/results for the superseded automatic experiment.
Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +1 to +23
#!/usr/bin/env python3
"""Real-host regression: publication -> durable Aether job -> Dapr -> generated indexes.

Requires an isolated local worktree runtime. SQL is used for assertions and a held
read lock only; all definitions/data are published through the HTTP API.
"""
import json
import os
import subprocess
import time
import urllib.error
import urllib.request
import uuid

BASE = os.environ['VNEXT_BASE_URL'].rstrip('/')
DOMAIN = os.environ['VNEXT_TEST_DOMAIN']
PG = os.environ['VNEXT_TEST_PG_CONTAINER']
DATABASE = os.environ['VNEXT_TEST_DATABASE']
PREFIX = 'auto-' + uuid.uuid4().hex[:10]
MASTER = PREFIX + '-master'
LATEST = PREFIX + '-latest'
PINNED = PREFIX + '-pinned'

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.

2 participants