You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test: add CLARIN consumer-contract coverage + branch-differential CI
The CLARIN/UFAL surface was merged onto dtq (main -> dtq, 2026-08-17) with
zero tests, while three main-lineage consumers depend on it. This lands the
counterpart to test_repo_usage_contract.py for that surface and makes the
main+dtq merge validatable instead of assumed.
Defects fixed (characterization-tested; each crashed or mis-answered a real
consumer call before this change):
- get_bundle_by_name / get_resource_policy / get_items_from_collection: guard
the None from a failed fetch instead of a NoneType subscript (D1/D3/D6).
- get_resource_policy: empty policy list -> None, not IndexError (D2).
- get_user_by_email: a 404 miss -> None, not a truthy uuid-less User that
slips past `if user:` (D4).
- create_submit_group: a 201 with no body -> None, not Group(None) (D5).
- Group(None) / User(None): construct an empty object, not TypeError (D7).
- get_owningCollection: on non-200 return None (not an empty truthy
Collection) so src/repo/_audit.py's `owning_col is None and
last_err.status_code == 401` reauth retry actually fires (D8, found via the
consumer contract).
Tests: +69 (68 -> 137). New suites test_clarin_read/write, test_models_clarin,
test_clarin_usage_contract, test_transport_hardening; _helpers gains CLARIN
builders; TestGetItems gains the no-arg form; test_repo_usage_contract gains
the owningCollection reauth contract.
CI: tests.yml now builds on dtq/main/feat/**/fix/**; a differential-contract
job runs the CLARIN suite against BOTH the dtq and main implementations
(@pytest.mark.dtq_only marks the fixes/deltas skipped on the main leg) as the
merge gate; a coverage floor (--cov-fail-under=70) and secret-gated
consumer-smoke jobs are added. pytest.ini registers the markers.
Verified locally: leg A (dtq) 137 pass; leg B (main impl) 45 shared contracts
pass, 14 dtq_only deselected; the 14 dtq_only CLARIN tests fail on the main
impl, confirming the deltas are real.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments