test(live): port survey2ddi's qwacback DDI equivalence test - #34
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #14. Unblocks the survey2ddi archive (CorrelAid/survey2ddi#5) on the formtransform side.
What
tests/live/qwacback/test_qwacback_equivalence.pysends the same 15 XLSForm cases as survey2ddi'stests/integration/test_conversion_equivalence.pythrough:buildDdiXml(fromdist/, viabuild_ddi.mjs), andPOST /api/convert/xlsform-to-ddiIt 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-markeddockerand excluded from plainuv run pytest. It runs withnpm run test:live, or on its own with-k qwacback.Stack:
tests/live/qwacback/docker-compose.ymlruns qwacback only, since conversion doesn't touch the worker.ghcr.io/correlaid/qwacbackis private (anonymous pull:denied). SoQWACBACK_IMAGEoverrides the image,QWACBACK_URLreuses 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):The two differences are strict xfails, so a fix on either side shows up as XPASS:
rangediscrete(unregistered type → fallback)continnote<var>(folded into<preQTxt>/<notes>)<var>Both will change qwacback's output when it swaps its Go converter for this library.
HANDOVER_QWAC.mdnow says so.Also
tests/README.mdclaimed 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