Skip to content

docs: correct SDK live-test commands and URI guidance#414

Open
DivyamTalwar wants to merge 1 commit into
morphik-org:mainfrom
DivyamTalwar:docs/sdk-test-uri-env
Open

docs: correct SDK live-test commands and URI guidance#414
DivyamTalwar wants to merge 1 commit into
morphik-org:mainfrom
DivyamTalwar:docs/sdk-test-uri-env

Conversation

@DivyamTalwar

Copy link
Copy Markdown

Summary

The Python SDK test documentation described MORPHIK_TEST_URL as the way to point live SDK tests at a custom Morphik server, but the sync and async SDK tests read MORPHIK_TEST_URI. This updates the SDK test examples and environment-variable reference so contributors use the variable the tests actually consume.

Changes

  • Update the Python SDK README live-test example to use MORPHIK_TEST_URI.
  • Update the SDK test README custom-server example to use MORPHIK_TEST_URI.
  • Update the SDK test README environment-variable reference to name MORPHIK_TEST_URI.
  • Clarify that the custom server URI applies to both sync and async SDK tests.
  • Warn that the live SDK tests and example script mutate server state, may leave residual artifacts, and should only target local or disposable test environments.
  • Direct contributors to source credential-bearing morphik:// URIs from local secrets instead of inline commands or CI logs.
  • Correct the example-usage async flag to --run-async, align the script usage docstring, and document the verified uv run python invocations.

Why this matters

Contributors running the SDK tests against a non-default server need the documented environment variable to match the test code. The previous docs could silently fall back to http://localhost:8000, making local SDK verification confusing.

Tests

Commands run:

  • rg -n "MORPHIK_TEST_(URL|URI)" sdks/python/README.md sdks/python/morphik/tests/README.md sdks/python/morphik/tests/test_sync.py sdks/python/morphik/tests/test_async.py - passed; SDK docs and tests consistently reference MORPHIK_TEST_URI.
  • git diff --check origin/main...HEAD - passed.
  • uv run python -m morphik.tests.example_usage --help - passed; shows --run-async.
  • cd sdks/python/morphik/tests && PYTHONPATH=../.. uv run python example_usage.py --help - passed; shows --run-async.
  • uv run python -m py_compile sdks/python/morphik/tests/example_usage.py - passed.
  • uv run pytest --collect-only -q sdks/python/morphik/tests/test_sync.py sdks/python/morphik/tests/test_async.py - passed; 26 tests collected.

Not run:

  • Live SDK test execution against a running Morphik server; this is a documentation and usage-docstring change, and those tests require a server.

Risk

Risk level: low

This is a documentation and usage-docstring correction matching existing test behavior. There is no runtime behavior change, and rollback is a direct revert of the README and usage-docstring edits.

Issue

No existing issue. This was discovered during repository analysis.

Notes for maintainers

I intentionally did not add MORPHIK_TEST_URL as an alias in test code because the existing SDK tests already have a single variable contract; this PR only corrects the docs to match it.

SDK live tests read MORPHIK_TEST_URI, but the SDK docs told contributors to set MORPHIK_TEST_URL. Align the examples and environment-variable reference with the actual test code, clarify supported URI forms, warn that live tests and examples can leave residual server state, and correct the verified example script commands.

Constraint: Existing SDK sync and async tests already consume MORPHIK_TEST_URI and the example script exposes --run-async.

Rejected: Supporting both environment variable names in test code | unnecessary behavior change for a documentation mismatch.

Confidence: high

Scope-risk: narrow

Directive: Keep this PR limited to SDK live-test documentation and usage text; do not change live-test behavior.

Tested: git diff --check; rg -n -- "MORPHIK_TEST_URL|MORPHIK_TEST_URI|localhost:8000 URL|--async|--run-async" sdks/python/README.md sdks/python/morphik/tests/README.md sdks/python/morphik/tests/example_usage.py sdks/python/morphik/tests/test_sync.py sdks/python/morphik/tests/test_async.py; uv run python -m morphik.tests.example_usage --help; cd sdks/python/morphik/tests && PYTHONPATH=../.. uv run python example_usage.py --help; uv run python -m py_compile sdks/python/morphik/tests/example_usage.py; uv run pytest --collect-only -q sdks/python/morphik/tests/test_sync.py sdks/python/morphik/tests/test_async.py

Not-tested: Live SDK test execution against a running Morphik server.
@DivyamTalwar
DivyamTalwar marked this pull request as ready for review July 3, 2026 20:56
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