Merge CQL library-based comparison operator tests into XML-based tests#1398
Merged
Merge CQL library-based comparison operator tests into XML-based tests#1398
Conversation
|
Formatting check succeeded! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1398 +/- ##
=========================================
Coverage 63.73% 63.73%
Complexity 2666 2666
=========================================
Files 494 494
Lines 27836 27829 -7
Branches 5528 5528
=========================================
- Hits 17741 17737 -4
+ Misses 7852 7848 -4
- Partials 2243 2244 +1 ☔ View full report in Codecov by Sentry. |
JPercival
approved these changes
Aug 12, 2024
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.
I copied all the tests from the engine's
CqlComparisonOperatorsTest.all_comparison_operators_tests(CQL library-based) toCqlComparisonOperatorsTest.xml(unless the same or equivalent tests were there already) and removed the library-based tests that test the same functionality as the XML tests.The
CqlComparisonOperatorsTest.all_comparison_operators_testsmethod uses theengine/.../CqlComparisonOperatorsTest.cqllibrary. Note that there are also similar define's incql-to-elm/.../CqlComparisonOperators.cqlandcql-to-elm/.../ComparisonOperators.cql. I went throughall three and added the new tests to
CqlComparisonOperatorsTest.xml.Note also:
to
TupleEqDateTimeTrue2andDateTimeEqTruerespectively because they both evaluate to true. They come fromcql-to-elm/.../CqlComparisonOperators.cqlwhich is only used in cql2elm tests that check translatability and not compare the results of the tests.CqlListOperatorsTest.xml:CqlListOperatorsTest.xml:CqlIntervalOperatorsTest.xml:CqlComparisonOperatorsTest.all_comparison_operators_tests:but they work as expected (throw a translation error), so I added them to
CqlComparisonOperatorsTest.xml.Now that everything is synced into
CqlComparisonOperatorsTest.xml, I could removeengine/.../CqlComparisonOperatorsTest.cqlwhich was only used by the engine'sCqlComparisonOperatorsTest. I also removed thecql_comparison_test_suite_compilestest from that class which made sure that the CQL library compiled with no errors. The test used the default options withoutDisableListDemotionandDisableListPromotion. The same compiler options are used when the XML tests are run (with the addition ofEnableDateRangeOptimizationwhich should not affect the translatability of the comparison operator tests in question), so they also test the same translation functionality.At this stage, we have to keep the other two CQL files because they are currently used in other tests (some cql2elm and cql-formatter tests). In the future, we can generate those CQL files dynamically from the XML content when we run the tests and not have to maintain the files separately?
There are corresponding PRs in the cql-tests repo: cqframework/cql-tests#45 and cqframework/cql-tests#46.