Skip to content

test-server $cql returns 400 on cql-to-elm translation errors - #379

Merged
cmoesel merged 3 commits into
masterfrom
test-server-translation-error
Sep 20, 2026
Merged

cmoesel merged 3 commits into
masterfrom
test-server-translation-error

Conversation

@dehall

@dehall dehall commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

This PR adds a check for cql-to-elm translation errors in the test-server $cql operation, and if any occur, the return is now HTTP 400 with the translation error. This is implemented by adding a new TranslationError class. I added one test case with Codex but I'm still thinking about how best to add more.

This is targeted at cql-tests that have invalid="true", for instance test "EquivTupleJohnJohnFalse". cql-tests-runner results from before and after this change:

Before:

    {
      "testsName": "CqlComparisonOperatorsTest",
      "groupName": "Equivalent",
      "testName": "EquivTupleJohnJohnFalse",
      "expression": "Tuple { Id : 1, Name : 'John', Position: 'Shift Manager' } ~ Tuple { Id : 1, Name : 'John' }",
      "testStatus": "fail",
      "responseStatus": 200,
      "actual": "null",
      "invalid": "true",
    },

After:

{
[...]
      "testStatus": "pass",
      "responseStatus": 400,
      "actual": "{\"error\":\"Could not resolve call to operator Equivalent with signature (tuple{Id:System.Integer,Name:System.String,Position:System.String}, tuple{Id:System.Integer,Name:System.String}).\"}",
      "invalid": "true",
    },

Pull requests into cql-execution require the following.
Submitter and reviewer should ✔ when done.
For items that are not-applicable, mark "N/A" and ✔.

Submitter:

  • This pull request describes why these changes were made
  • Code diff has been done and been reviewed (it does not contain: additional white space, not applicable code changes, debug statements, etc.)
  • Tests are included and test edge cases
  • Tests have been run locally and pass
  • Code coverage has not gone down and all code touched or added is covered.
  • Code passes lint and prettier (hint: use npm run check to run tests, lint, and prettier)
  • All dependent libraries are appropriately updated or have a corresponding PR related to this change
    Reviewer:

Name:

  • Code is maintainable and reusable, reuses existing code and infrastructure where appropriate, and accomplishes the task’s purpose
  • The tests appropriately test the new code, including edge cases
  • You have tried to break the code

@codecov-commenter

codecov-commenter commented Sep 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.22%. Comparing base (31bcad1) to head (cfb4121).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #379   +/-   ##
=======================================
  Coverage   89.22%   89.22%           
=======================================
  Files          60       60           
  Lines        5116     5116           
  Branches     1468     1468           
=======================================
  Hits         4565     4565           
  Misses        316      316           
  Partials      235      235           

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dehall
dehall requested a review from cmoesel September 20, 2026 14:29

@cmoesel cmoesel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. Thank you!

@cmoesel
cmoesel merged commit b4fdf57 into master Sep 20, 2026
14 checks passed
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.

3 participants