Skip to content

test(live): port survey2ddi's qwacback DDI equivalence test - #34

Merged
jstet merged 1 commit into
mainfrom
test/qwacback-equivalence
Sep 24, 2026
Merged

jstet merged 1 commit into
mainfrom
test/qwacback-equivalence

Conversation

@jstet

@jstet jstet commented Sep 24, 2026

Copy link
Copy Markdown
Member

Closes #14. Unblocks the survey2ddi archive (CorrelAid/survey2ddi#5) on the formtransform side.

What

tests/live/qwacback/test_qwacback_equivalence.py sends the same 15 XLSForm cases as survey2ddi's tests/integration/test_conversion_equivalence.py through:

  • formtransform's buildDdiXml (from dist/, via build_ddi.mjs), and
  • qwacback's POST /api/convert/xlsform-to-ddi

It then compares the <var>/<varGrp> shapes. The shape helpers are unchanged, including wrapping qwacback's bare <var>/<varGrp> in a <dataDscr>.

Opt-in: it's under tests/live/, so it's auto-marked docker and excluded from plain uv run pytest. It runs with npm run test:live, or on its own with -k qwacback.

Stack: tests/live/qwacback/docker-compose.yml runs qwacback only, since conversion doesn't touch the worker.

  • ghcr.io/correlaid/qwacback is private (anonymous pull: denied). So QWACBACK_IMAGE overrides the image, QWACBACK_URL reuses a running instance, and the tests skip with that reason when the image can't be pulled.

Result

Run against qwacback main (c99de96, built locally):

13 passed, 2 xfailed

The two differences are strict xfails, so a fix on either side shows up as XPASS:

Case formtransform qwacback Status
range text / discrete (unregistered type → fallback) numeric / contin bug here, filed as #33
note no <var> (folded into <preQTxt>/<notes>) text <var> intended here

Both will change qwacback's output when it swaps its Go converter for this library. HANDOVER_QWAC.md now says so.

Also

tests/README.md claimed qwacback already consumed this library's DDI emitter. It doesn't yet: its Go converter is live. The README is corrected, and it now documents the new suite.

🤖 Generated with Claude Code

tests/live/qwacback/ sends the same 15 XLSForm cases through buildDdiXml and
qwacback's POST /api/convert/xlsform-to-ddi and compares the <var>/<varGrp>
shapes, with the helpers and cases carried over from survey2ddi's
tests/integration/test_conversion_equivalence.py. It stays opt-in: it lives
under tests/live/ and is auto-marked `docker`.

- Own compose file with qwacback only; conversion doesn't need the worker.
  QWACBACK_IMAGE overrides the image (ghcr.io/correlaid/qwacback is private),
  QWACBACK_URL reuses a running instance, and the tests skip with the reason
  when the image can't be pulled.
- build_ddi.mjs calls buildDdiXml from dist/ over stdin/stdout.
- Backs off on 429 (qwacback allows guests 10 conversions a minute).

Against qwacback main (c99de96): 13 pass, 2 strict xfails.
- range: unregistered here, so emitted as text; qwacback emits numeric (#33).
- note: by design formtransform emits no <var> for a note.

tests/README.md said qwacback already consumed this library's DDI emitter;
it still runs its own Go converter. HANDOVER_QWAC.md records the two
differences qwacback's converter swap will cause.

Closes #14

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@jstet
jstet merged commit 5dcafa6 into main Sep 24, 2026
4 checks passed
@jstet
jstet deleted the test/qwacback-equivalence branch September 24, 2026 12:55
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.

Adopt the qwacback equivalence test

1 participant