Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CESQL tck tests to match spec changes #1291

Merged

Conversation

Cali0707
Copy link
Contributor

@Cali0707 Cali0707 commented Jun 4, 2024

With all of the CESQL spec changes recently, the spec needed some updates to reflect what had changed

Proposed Changes

  • Add results to every expression that has an error, as CESQL spec has been clarified on what should happen in that case
  • Added missing attribute errors back, as well as tests to ensure that operators handle it correctly
  • Add test for the ABS function overflow error
  • Fix boolean casting now that it is defined for all types

@@ -25,3 +25,4 @@ The `error` values could be any of the following:
* `cast`: Casting error
* `missingFunction`: Addressed a missing function
* `functionEvaluation`: Error while evaluating a function
* `missingAttribute`: Error due to a missing attribute
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you added a generic error message to the spec - should we test for that too? It might end up being more of an impl-specific error case. If it's too hard to put into this generic tck stuff then I'm ok with skipping it. Was just curious.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we could mention it in the README for completeness, but I can't think of any use cases where we would actually use it

expression: -TRUE
result: -1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Correct result, but funny

result: 0
error: cast
error: match
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does "match' mean here - I don't see it listed as a valid error? I expected "missingAttribute"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tbh I'm not sure how I ended up with match here...

You are totally correct, it should be missingAttribute

@duglin
Copy link
Collaborator

duglin commented Jun 5, 2024

Just a few minor questions... otherwise LGTM

* Add generic error to README
* Fix match error -> missingAttribute error

Signed-off-by: Calum Murray <[email protected]>
@duglin
Copy link
Collaborator

duglin commented Jun 6, 2024

Approved on the 6/6 call

@duglin duglin merged commit c0927d1 into cloudevents:main Jun 6, 2024
1 check 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.

2 participants