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

Verify user-visible message in assertQueryFails #20661

Merged
merged 4 commits into from
Feb 13, 2024

Conversation

findepi
Copy link
Member

@findepi findepi commented Feb 12, 2024

Change assertQueryFails so that it verifies the message that the
end-user would see. Before the change, assertQueryFails would accept
any TrinoException that has expected message somewhere in the causal
chain. However, causal chain may or may not be visible to the end user,
depending on the tooling used. This restores the behavior that used to
be before commit 0a56d09 (#20048).

Tests that want to verify causal message should do this explicitly.

@findepi findepi added test no-release-notes This pull request does not require release notes entry labels Feb 12, 2024
@cla-bot cla-bot bot added the cla-signed label Feb 12, 2024
@findepi findepi force-pushed the findepi/assert-top-level branch from 89ab5bf to 5e8d7e2 Compare February 12, 2024 15:55
@findepi
Copy link
Member Author

findepi commented Feb 12, 2024

previous CI run, hive-tests (config-hdp3) failed at #20625

Add dedicated tests for `assertQueryFails`.
@findepi findepi force-pushed the findepi/assert-top-level branch from 5e8d7e2 to e6bc986 Compare February 12, 2024 21:00
Comment on lines 153 to 154
String sql = "SELECT CAST('abc' AS date)";
String lastMessage;
Copy link
Member

Choose a reason for hiding this comment

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

nit: Fix indentation.

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks!

Change `assertQueryFails` so that it verifies the message that the
end-user would see. Before the change, `assertQueryFails` would accept
any TrinoException that has expected message somewhere in the causal
chain. However, causal chain may or may not be visible to the end user,
depending on the tooling used. This restores the behavior that used to
be before commit 0a56d09.

Tests that want to verify causal message should do this explicitly.
@findepi findepi force-pushed the findepi/assert-top-level branch from 80b0d14 to ff973a6 Compare February 13, 2024 08:11
@findepi findepi merged commit 0e6b885 into master Feb 13, 2024
2 of 12 checks passed
@findepi findepi deleted the findepi/assert-top-level branch February 13, 2024 08:11
@github-actions github-actions bot added this to the 439 milestone Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed no-release-notes This pull request does not require release notes entry test
Development

Successfully merging this pull request may close these issues.

3 participants