Skip to content

Add loading tests#369

Draft
gaurav wants to merge 16 commits intomasterfrom
add-loading-tests
Draft

Add loading tests#369
gaurav wants to merge 16 commits intomasterfrom
add-loading-tests

Conversation

@gaurav
Copy link
Collaborator

@gaurav gaurav commented Feb 27, 2026

WIP

gaurav and others added 2 commits February 27, 2026 00:03
- New .github/workflows/test.yml with parallel unit-tests and integration-tests
  jobs; integration job uses a Redis service container on port 6379.
- New docker-compose-redis.yml for running Redis locally during development.
- New tests/test_integration.py with 27 tests across 6 classes (status, get_normalized_nodes,
  semantic_types, curie_prefixes, setid, query, conflations), all marked
  pytest.mark.integration; data-loading placeholder present for Phase 2.
- Updated tests/conftest.py to add session-scoped integration_client fixture
  with Redis availability check and TestClient context manager.
- Updated tests/test_callback.py to skip test_async_query_callback (requires
  external callback-app container).
- Updated pytest.ini to register integration and callback_integration markers
  and document the plain-pytest limitation from test_norm/test_setid module-level
  app.state mutation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
gaurav and others added 14 commits February 27, 2026 01:13
NodeLoader.__init__ and get_config now accept an optional config_file
parameter (defaults to the project-root config.json, preserving existing
behavior). This removes the need for monkeypatching in tests and lets the
integration test fixture and CI loading step pass tests/data/config.json
directly.

Also adds tests/data/config.json pointing at the Gene/Protein compendia and
GeneProtein conflation under tests/data/, and wires it into the
integration_client fixture and the GitHub Actions loading step.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bmt.utils.format_element was renamed to bmt.util.format in the installed
version (bmt==1.4.3); update the import in loader.py and normalizer.py.

Integration tests are marked xfail because bmt-lite raises ValueError when
Toolkit() is called with a schema URL in startup_event (server.py:75).
Add tests/README.md documenting this and the unawaited-coroutine issue in
test_loader.py::test_nn_load.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bmt-lite-v3.1.0 was overwriting bmt/__init__.py in the shared namespace,
causing Toolkit(url) to raise ValueError. Fix: uninstall bmt-lite and
reinstall bmt cleanly. This also lets us revert the bmt.utils->bmt.util
rename (format_element is back), and remove the xfail marker from all
integration tests.

Also fix test_unknown_semantic_type: the endpoint returns a "Not found"
sentinel for unknown types rather than an empty dict; update the assertion
to match the real behavior.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
aioredis 2.x defines TimeoutError(asyncio.TimeoutError, builtins.TimeoutError)
which raises TypeError on Python 3.11+ where the two are the same type.
The codebase uses the aioredis 1.x API (create_redis_pool,
aioredis.commands.Redis) so 2.x would also break at runtime.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Without pins, CI installs pydantic v2 + matching newer fastapi/reasoner-pydantic.
The codebase uses pydantic v1 APIs (class-based Config, min_items, etc.) and
reasoner-pydantic 4.x, which are incompatible with pydantic v2. fastapi 0.100+
dropped pydantic v1 support.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fastapi<0.100 was too broad: fastapi 0.99.x pulls in starlette 0.27+
which uses httpx as the TestClient backend. A newer httpx then dropped
the app= kwarg, breaking TestClient(app) in all tests.

fastapi==0.83.0 pins starlette==0.19.1 (requests-based TestClient),
which is the version the test suite was written against.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
starlette 0.19.1 TestClient calls anyio.start_blocking_portal(), which
was removed in anyio 4.x. CI was getting anyio 4.12.1 while the locally
working version is 3.7.1.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant