Repository navigation
Run negative library-style tests instead of skipping them - #152
Open
bryantaustin13 wants to merge 1 commit into
Open
bryantaustin13 wants to merge 1 commit into
bryantaustin13 wants to merge 1 commit into
Conversation
A library test marked invalid with no <output> names no define, so it was always skipped. Let it through when invalid expects an error, and omit the expression parameter so Library/$evaluate evaluates the whole library. Fixes cqframework#151. Co-Authored-By: Claude Opus 5.5 <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.
Fixes #151.
Problem
A library-style test marked
invalid, with no<output>, was always skipped with "Library-style test output has no 'name' attribute naming the define to evaluate". So a negative library test could never pass or fail. cqframework/cql-tests#142'sAmbiguousOverloadis one: an overload call that should fail to translate.Change
src/shared/results-shared.ts:Resultconstructor: a library test with no<output>no longer skips in the library branch. It falls through to the shared check after the branch, which already allows a missing<output>wheninvalidistrueorsemantic, and skips with "No output specified" otherwise. That's the same rule expression tests follow.generateParametersResource: when no define is named, theexpressionparameter is left out, soLibrary/$evaluateevaluates the whole library.Scoring is unchanged.
run-test-core.tsalready scoresinvalidtrue/semanticaspassonly when the response indicates an error.Tests
test/library-style-tests.test.ts:expressionset to'';url.test/run-tests.test.ts: a negative library test passes whenLibrary/$evaluatereturns an error, and fails when the library evaluates.npx vitest run test/: 240 passed (235 onmain).tsc --noEmitreports the same two errors insrc/server/rest-routes.tsas onmain, which #139 addresses. I lefttest/run-tests.test.tsin its existing two-space style, which isn't Prettier-clean onmaineither.Live run
Using cqframework/cql-tests#142's
CqlOverloadMatching.xmlagainst a local HAPI FHIR 8.12.0 server, withconf/localhost-evaluate.json:mainAmbiguousOverloadskip("Library-style test output has no 'name' attribute…")pass: "Library AmbiguousOverload-1.0.0 loaded, but had errors: Call to operator A(System.Integer) is ambiguous with: …"passpassThe server accepted the
PUTof the untranslatable library and reported the translation error at$evaluate, which settles #151's open question for HAPI. The published library was removed afterwards. Other servers may behave differently.cql-execution couldn't be checked. Its test server only provides
POST /fhir/$cqlfor a single expression, with noLibrary/$evaluateand no Library upload. The runner skips every library-style test on a$cqlserver before sending a request ("Library-style tests require a server configured for the Library/$evaluate operation"), onmainand on this branch alike.Related
syntaxandexecution. This change uses the existingtrue/semanticcheck, so it picks those up once Handle every error kind the test schema's invalid attribute defines #131 merges.results-shared.tsandrun-test-core.ts. This branch merges cleanly with both Handle every error kind the test schema's invalid attribute defines #131 and Send an evaluation request timestamp, defaulting to UTC, with every test #142.🤖 Generated with Claude Code