docs: correct SDK live-test commands and URI guidance#414
Open
DivyamTalwar wants to merge 1 commit into
Open
Conversation
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
marked this pull request as ready for review
July 3, 2026 20:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Python SDK test documentation described
MORPHIK_TEST_URLas the way to point live SDK tests at a custom Morphik server, but the sync and async SDK tests readMORPHIK_TEST_URI. This updates the SDK test examples and environment-variable reference so contributors use the variable the tests actually consume.Changes
MORPHIK_TEST_URI.MORPHIK_TEST_URI.MORPHIK_TEST_URI.morphik://URIs from local secrets instead of inline commands or CI logs.--run-async, align the script usage docstring, and document the verifieduv run pythoninvocations.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 referenceMORPHIK_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:
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_URLas 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.