Skip to content

test: exercise the extension points with a mock external backend - #118

Open
ehennestad wants to merge 1 commit into
add-resolver-reregistrationfrom
add-external-integration-test
Open

test: exercise the extension points with a mock external backend#118
ehennestad wants to merge 1 commit into
add-resolver-reregistrationfrom
add-external-integration-test

Conversation

@ehennestad

@ehennestad ehennestad commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

The point of the serialization, deserialization and resolution architecture in this stack is that an external library can integrate a graph database or a new format without changing openMINDS_MATLAB. Until now nothing verified that end to end.

This adds a mock external backend written purely against the extension surface promoted two PRs down:

  • MockGraphSerializer — a non-JSON-LD record format on openminds.abstract.BaseSerializer; implements only the constructor and formatOutput, inheriting traversal, reference and embedding handling.
  • MockGraphDeserializer — implements only parseToStructs on openminds.abstract.BaseDeserializer, inheriting type dispatch and cross-record link wiring.
  • MockGraphMetadataStoreopenminds.interface.MetadataStore backed by an in-memory record database.
  • MockGraphResolveropenminds.interface.LinkResolver holding its database client as instance state, which is what the instance-method resolver contract exists for.

ExternalIntegrationTest drives the five things an external backend has to be able to do:

  1. save a collection as one record per node through the custom serializer;
  2. load the records back into a single connected graph — values, wired links, controlled terms and embedded values intact;
  3. reproduce the canonical JSON-LD document byte for byte after the round trip, which leans on the deterministic node ordering at the bottom of this stack;
  4. resolve a reference whose type only the database knows, by replacement — the case that was silently broken before the traversal rework;
  5. populate a typed reference in place.

If a change breaks these tests, it breaks every external integration, openminds-kg-sync included. The mock classes double as a worked example of the contract — roughly 200 lines for a complete backend.

The verification run that produced this test also found the Collection.save store bug fixed in #115.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Test Results (R2022a)

767 tests   766 ✅  2m 5s ⏱️
 21 suites    1 💤
  1 files      0 ❌

Results for commit c43a2c8.

♻️ This comment has been updated with latest results.

@ehennestad
ehennestad force-pushed the add-external-integration-test branch from 2b1f9ff to 6111644 Compare August 31, 2026 10:20
@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (add-resolver-reregistration@bbf211b). Learn more about missing BASE report.

Additional details and impacted files
@@                      Coverage Diff                       @@
##             add-resolver-reregistration     #118   +/-   ##
==============================================================
  Coverage                               ?   80.02%           
==============================================================
  Files                                  ?      422           
  Lines                                  ?     4066           
  Branches                               ?        0           
==============================================================
  Hits                                   ?     3254           
  Misses                                 ?      812           
  Partials                               ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Test Results (R2026a)

767 tests  +767   766 ✅ +766   1m 57s ⏱️ + 1m 57s
 21 suites + 21     1 💤 +  1 
  1 files   +  1     0 ❌ ±  0 

Results for commit c43a2c8. ± Comparison against base commit bbf211b.

♻️ This comment has been updated with latest results.

@ehennestad
ehennestad force-pushed the add-external-integration-test branch from 59ee1c8 to 0772857 Compare September 1, 2026 14:31
The reason the serialization, deserialization and resolution
architecture exists is that an external library can integrate a database
or format without changing this repository. Nothing verified that
end to end.

This adds a mock external backend built purely on the extension surface:
a serializer producing database records on openminds.abstract
.BaseSerializer, a deserializer on openminds.abstract.BaseDeserializer,
a store on openminds.interface.MetadataStore and a resolver on
openminds.interface.LinkResolver holding its database client as instance
state.

ExternalIntegrationTest drives it through the five things an external
backend has to be able to do: save a collection as records, load the
records back into one connected graph, reproduce the canonical JSON-LD
document byte for byte after the round trip, resolve a reference whose
type only the database knows by replacement, and populate a typed
reference in place.

If a change breaks these tests, it breaks every external integration,
openminds-kg-sync included. The mock classes double as a worked example
of the contract.

The verification that led to this test found the Collection.save store
bug fixed earlier in this stack.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ehennestad
ehennestad force-pushed the add-external-integration-test branch from 0772857 to c43a2c8 Compare September 1, 2026 20:58
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