Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
fab7b16
feat(otdf-sdk-mgr): manage platform service + install scenario (DSPX-…
dmihalcik-virtru May 15, 2026
a5e6229
fix(otdf-sdk-mgr): repair install scenario + harden silent failures
dmihalcik-virtru May 21, 2026
64132cb
style(otdf-sdk-mgr): ruff format
dmihalcik-virtru May 21, 2026
6a0e805
refactor(otdf-sdk-mgr): address PR review feedback on platform installer
dmihalcik-virtru May 21, 2026
eb76839
docs+chore: require uv run ruff/pyright pre-commit; fix cli_scenario …
dmihalcik-virtru May 21, 2026
5b75907
docs(agents): expand and reorganize AGENTS.md across packages
dmihalcik-virtru May 21, 2026
270fb12
feat(otdf-sdk-mgr): install tip --ref for branches, PRs, and SHAs
dmihalcik-virtru May 27, 2026
acd0899
fixup addd platform source to gitignore
dmihalcik-virtru May 27, 2026
4c159a5
fix(otdf-sdk-mgr): normalize only semver tail for immutable platform …
dmihalcik-virtru May 27, 2026
959a96d
fix(otdf-sdk-mgr): address PR review critical issues
dmihalcik-virtru May 28, 2026
34568fa
fix(otdf-sdk-mgr): tighten error handling and dedupe APIs
dmihalcik-virtru May 28, 2026
9df465a
test(otdf-sdk-mgr): cover mutable-rebuild, PR refspec, registry
dmihalcik-virtru May 28, 2026
5ea87e7
fix(otdf-sdk-mgr): address remaining PR review items
dmihalcik-virtru Jun 1, 2026
ec578ac
docs(schema): document KAS preview features fields
dmihalcik-virtru Jun 2, 2026
a20470e
feat(otdf-local): multi-instance test environments (DSPX-3302)
dmihalcik-virtru May 15, 2026
5c1e619
feat(otdf-local): self-provision keys + opentdf.yaml at instance init
dmihalcik-virtru Jun 2, 2026
ecb04e1
fix(otdf-local): translate scenario suite to pytest argv per actual s…
dmihalcik-virtru Jun 2, 2026
0b41c21
style(otdf-local): apply ruff format
dmihalcik-virtru Jun 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ xtest/sdk/java/cmdline.jar
/xtest/platform/
/xtest/java-sdk/
/xtest/sdk/go/otdfctl
/xtest/sdk/go/platform-src/
/xtest/otdfctl/

/tmp/

# Multi-instance test harness state (DSPX-3302). Per-instance config, logs, and
# keys live under tests/instances/; otdf-sdk-mgr install scenario writes
# .installed.json next to each scenarios.yaml.
/instances/
xtest/scenarios/*.installed.json
.claude/tmp/
10 changes: 4 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ This guide provides essential knowledge for AI agents performing updates, refact
| Path | Purpose | Has its own AGENTS.md? |
|------|---------|------------------------|
| `xtest/` | pytest integration tests (the main test suite) | yes |
| `otdf-sdk-mgr/` | Python CLI that installs SDK CLIs from releases or source (see `otdf-sdk-mgr/README.md`) | no |
| `otdf-sdk-mgr/` | Python CLI that installs SDK CLIs and the platform service from releases or source | yes |
| `otdf-local/` | Python CLI that runs/stops the platform + KAS instances locally | yes |
| `vulnerability/` | Playwright UI test suite (run with `npx playwright test`) | no |
| `xtest/sdk/{go,java,js}/dist/` | Built SDK CLI wrappers, produced by `otdf-sdk-mgr install` (or by `cd xtest/sdk && make` for source builds) | n/a |
| `platform/` | Platform service source — **installed by `otdf-sdk-mgr install platform`**, not committed. Edits here may be wiped by a reinstall. | |
| `xtest/sdk/{go,java,js}/dist/` | Built SDK CLI wrappers, produced by `otdf-sdk-mgr install` (or by `cd xtest/sdk && make` for source builds) | |

## Test Framework Overview

Expand Down Expand Up @@ -234,7 +235,4 @@ yq e '.services.kas.root_key' platform/opentdf-dev.yaml

## Closing Note

Test failures are usually configuration mismatches, not SDK bugs. Check
the local environment against what the tests expect before suspecting the
code. Per-subsystem details live in `xtest/AGENTS.md`,
`otdf-local/AGENTS.md`, and `otdf-sdk-mgr/README.md`.
The test failures are usually symptoms of configuration mismatches, not SDK bugs. Focus on ensuring the local environment matches what the tests expect. See the per-package guides in `xtest/`, `otdf-sdk-mgr/`, and `otdf-local/` for sub-system specifics.
2 changes: 2 additions & 0 deletions otdf-local/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This guide covers operational procedures for managing the test environment with `otdf-local`. For command reference, see [README.md](README.md).

**Depends on `otdf-sdk-mgr`.** `otdf-local` launches binaries that `otdf-sdk-mgr install platform` (or `otdf-sdk-mgr install scenario`) writes into `xtest/platform/dist/`. If `otdf-local up` complains that a binary is missing, run the installer first.

## Environment Setup for pytest

```bash
Expand Down
4 changes: 4 additions & 0 deletions otdf-local/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"httpx>=0.27.0",
"otdf-sdk-mgr",
"pydantic-settings>=2.2.0",
"rich>=13.7.0",
"ruamel.yaml>=0.18.0",
"typer>=0.12.0",
]

[tool.uv.sources]
otdf-sdk-mgr = { path = "../otdf-sdk-mgr", editable = true }

[dependency-groups]
dev = [
"pyright>=1.1.408",
Expand Down
28 changes: 26 additions & 2 deletions otdf-local/src/otdf_local/cli.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
"""Typer CLI for otdf_local - OpenTDF test environment management."""

import json
import os
import shutil
import sys
import time
from typing import Annotated
from pathlib import Path
from typing import Annotated, Optional

import httpx
import typer
Expand Down Expand Up @@ -44,6 +46,18 @@
)


def _register_subapps() -> None:
"""Defer imports so the schema dependency only loads when needed."""
from otdf_local.cli_instance import instance_app
from otdf_local.cli_scenario import scenario_app

app.add_typer(instance_app, name="instance")
app.add_typer(scenario_app, name="scenario")


_register_subapps()


def _show_provision_error(result: ProvisionResult, target: str) -> None:
"""Display provisioning error with stderr details."""
print_error(f"{target} provisioning failed (exit code {result.return_code})")
Expand Down Expand Up @@ -75,9 +89,19 @@ def main(
is_eager=True,
),
] = False,
instance: Annotated[
Optional[str],
typer.Option(
"--instance",
help='Named instance under tests/instances/. Defaults to "default" (or $OTDF_LOCAL_INSTANCE_NAME).',
),
] = None,
) -> None:
"""OpenTDF test environment management CLI."""
pass
if instance is not None:
os.environ["OTDF_LOCAL_INSTANCE_NAME"] = instance
# Invalidate the cached Settings so subsequent commands see the new value
get_settings.cache_clear()
Comment on lines +101 to +104
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The --instance flag correctly updates the environment and clears the settings cache. However, the up command in this file (specifically at lines 192 and 225) still relies on static Ports constants for health checks and port resolution. This will cause health checks to fail when a non-default instance with a different ports_base is active. The up command should be updated to use the instance-aware settings.get_kas_port(name) or the port property of the service instances, and it should iterate over the instances managed by kas_manager instead of Ports.all_kas_names().



@app.command()
Expand Down
Loading
Loading