mit einem Klick
test-and-fix-connector
// Run the AdmeOsduLakeflowConnect pytest suite, diagnose failures, and fix the connector or simulator until everything passes. Branches on mode={simulate|live}.
// Run the AdmeOsduLakeflowConnect pytest suite, diagnose failures, and fix the connector or simulator until everything passes. Branches on mode={simulate|live}.
Set up authentication for the ADME OSDU connector — get an Azure bearer token and write dev_config.json for live testing.
Mechanical audit of the ADME OSDU connector — implementation correctness, test coverage, artifacts completeness, and security. Produces a scored report.
Validate that credentials for the ADME OSDU connector authenticate successfully against the real ADME API.
Validate that ADME domain tables (wellbore, reservoir, rock_and_fluid) correctly implement CDC incremental sync — offset tracking, watermark filtering, and pagination termination.
| name | test-and-fix-connector |
| description | Run the AdmeOsduLakeflowConnect pytest suite, diagnose failures, and fix the connector or simulator until everything passes. Branches on mode={simulate|live}. |
Validate AdmeOsduLakeflowConnect by running its pytest suite and applying minimal fixes until everything passes.
| Mode | When | Credentials | Posture |
|---|---|---|---|
simulate | Default (no creds) | None — uses corpus | Either connector or corpus could be wrong — judge on merits |
live | Record against real ADME | dev_config.json | Live API is authoritative — fix corpus/spec first |
sleep, poll loops, or tail.Verify these files exist:
connector/lakeflow/interface.pyconnector/lakeflow/adme_osdu.pyconnector/simulator/corpus/wellbore.jsonconnector/simulator/corpus/reservoir.jsonconnector/simulator/corpus/rock_and_fluid.jsonconnector/simulator/corpus/legal_tags.jsonconnector/simulator/corpus/entitlements.jsontests/unit/adme_osdu/test_adme_osdu_lakeflow_connect.pypip install -e ".[dev]" -q 2>/dev/null || pip install -r requirements-dev.txt -q
pytest tests/unit/adme_osdu/ -v
No CONNECTOR_TEST_MODE env var. No credentials. No network.
kind field routing in conftest.py)read_terminates fails because offset never stabilises; check _read_domain returns start_offset unchanged when results is emptyFix the connector or corpus as needed. Iterate until all tests pass.
Place tests/unit/adme_osdu/dev_config.json (gitignored):
{
"base_url": "https://YOUR-ADME.energy.azure.com",
"data_partition_id": "YOUR-PARTITION",
"access_token": "YOUR-BEARER-TOKEN"
}
Or set CONNECTOR_TEST_CONFIG_JSON env var.
CONNECTOR_TEST_MODE=live pytest tests/unit/adme_osdu/ -v
After a successful live run, update corpus files with real data:
connector/simulator/corpus/*.jsonpytest tests/unit/adme_osdu/ -v
Must still be green.
If a test hangs on a domain table:
page_size — edit conf/domains/wellbore.yaml and set page_size: 5pytest ... -s --log-cli-level=DEBUGincremental_filter_template — an unbounded query: "" on large partitions can time outAfter fixing the connector, no merge script is needed (this is a standalone repo, not the community connector monorepo).