Repository navigation
Conversation
The OpenAI, Amazon Bedrock, and Cohere integration fixtures read the SDKs' standard variables (OPENAI_API_KEY, the AWS_* credentials and region, and COHERE_API_KEY). A developer whose shell already holds one of those keys for other work paid for every integration run. The fixtures now read MEMMACHINE_TEST_OPENAI_API_KEY, MEMMACHINE_TEST_AWS_ACCESS_KEY_ID, MEMMACHINE_TEST_AWS_SECRET_ACCESS_KEY, MEMMACHINE_TEST_AWS_SESSION_TOKEN, MEMMACHINE_TEST_AWS_REGION, and MEMMACHINE_TEST_COHERE_API_KEY, and skip without them. They already pass the credentials to the clients explicitly, so the SDKs never fall back to the standard variables. Bedrock's region no longer falls back to AWS_DEFAULT_REGION. The integration workflow sets the new names from the same secrets and variable, so CI runs these tests exactly when it did before. CONTRIBUTING-CORE.md lists the variables and warns that the tests are billed to those keys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>
marvinyu-memverge
left a comment
There was a problem hiding this comment.
Approving at 862a083.
Verified: the three integration-config fixtures are the only places the test tree reads a real key, and every client built from them gets its credentials passed explicitly (AsyncOpenAI(api_key=...), AsyncClientV2(api_key=...), both boto3 clients with key, secret, session token and region), so none of the SDKs can fall back to the standard variables; main/conftest.py passes the key into the server config explicitly too. The other test clients use dummy keys under mocks, and the AWS_*/OPENAI_API_KEY reads in the configuration tests are monkeypatched. The workflow maps the same secrets and variable onto the new names, so CI's coverage doesn't change. The red test-install jobs fail the same way on unrelated PRs today (Neo4j download 404 in memmachine-configure), so they aren't from this change.
Purpose of the change
The integration tests that call OpenAI, Amazon Bedrock, or Cohere read the SDKs' standard variables. So a developer whose shell already holds one of those keys for other work pays for every
pytest -m integrationrun. These tests now read test-only variables, and spend only when a developer sets keys for the tests.Stack
CONTRIBUTING.md; removeAGENTS.mdandSTYLE_GUIDE.mdThis PR is its one commit, 862a083, on main. #1867 is stacked on it.
Description
OPENAI_API_KEYMEMMACHINE_TEST_OPENAI_API_KEYAWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_SESSION_TOKEN,AWS_REGIONorAWS_DEFAULT_REGIONMEMMACHINE_TEST_AWS_ACCESS_KEY_ID,MEMMACHINE_TEST_AWS_SECRET_ACCESS_KEY,MEMMACHINE_TEST_AWS_SESSION_TOKEN,MEMMACHINE_TEST_AWS_REGIONCOHERE_API_KEYMEMMACHINE_TEST_COHERE_API_KEYopenai_integration_config,bedrock_integration_config, andcohere_integration_configin the server tests'conftest.pyread the new names and skip without them. The fixtures already pass the credentials toopenai.AsyncOpenAI,boto3.client, and Cohere'sAsyncClientV2explicitly, so the SDKs never fall back to their standard variables. No other test reads a real key: the unit tests construct their clients with dummy keys. Ollama (OLLAMA_HOST) and Nebula (NEBULA_HOST) are local services and keep their variables.pytest-integration.ymlsets the new names from the same secrets and variable, so CI runs these tests exactly when it did before. The repository has no OpenAI or AWS secrets, so they skip in CI both before and after this PR.CONTRIBUTING-CORE.mdlists the variables and warns that the tests call the real APIs, billed to those keys. [contributor setup 2] Fold the contributing guides into CONTRIBUTING.md and remove AGENTS.md and STYLE_GUIDE.md #1867 carries the same text intoCONTRIBUTING.md.Type of change
How Has This Been Tested?
Manual verification
A scratch test (not committed) requested the three fixtures:
MEMMACHINE_TEST_AWS_REGIONskipped, even withAWS_REGIONset.ruff format --check,ruff check, and ty onpackages/serveras CI runs it all pass. The server and client unit tests collect (2389), and so do the server integration tests (1725).No test was run against the real APIs.
Test Results: as listed above.
Checklist
Further comments
Anyone who runs these tests locally with the standard variables needs to set the
MEMMACHINE_TEST_*names instead.🤖 Written by Claude Code (Claude Opus 5.5) on behalf of @edwinyyyu.