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

Fix structure and execution of type tests #18594

Merged
merged 1 commit into from
Aug 10, 2023
Merged

Conversation

martint
Copy link
Member

@martint martint commented Aug 8, 2023

Do not use inheritance/overriding for code reuse and specialization, as it makes it harder to reason about what's being tested.

Also, annotate the tests directly so that they are picked up by JUnit

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.

Do not use inheritance/overriding for code reuse and specialization,
as it makes it harder to reason about what's being tested.

Also, annotate the tests directly so that they are picked up by JUnit
Copy link
Member

@hashhar hashhar left a comment

Choose a reason for hiding this comment

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

how do we plan to deal with evolving tests? e.g. if you add a new test testRange then how do you identify which all test classes it should go into? Similarly how do you ensure there isn't a drift in the test method definition across classes.

@martint
Copy link
Member Author

martint commented Aug 9, 2023

Each type needs tests according to its semantics. If you add new behavior to a type that affects how getRange() works, the corresponding tests for that type need to be adjusted. That's no different than how we implement tests for timestamp, timestamp w/ tz, time, time w/ tz, etc. in io.trino.operator.scalar.timestamp.TestTimestamp, io.trino.operator.scalar.timestamp.TestTime, and friends.

@martint martint merged commit a5c50dc into trinodb:master Aug 10, 2023
@martint martint deleted the type-tests branch August 10, 2023 22:29
@martint martint mentioned this pull request Oct 26, 2023
41 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants