Open findepi opened 3 years ago
Hi @findepi May I work on this?
@choiwaiyiu sure, thank you!
please make sure to have a look at https://github.com/trinodb/trino/pull/6554 to see how some of the code places have been updated recently.
Hello @findepi, does @choiwaiyiu still work on that issue or I can try?
@MariyaR hopefully @choiwaiyiu will clarify that. If not, please feel free to go ahead.
@MariyaR @findepi Sorry for my slow progress. I have already started working on this issue and will create a pull request soon.
@choiwaiyiu no worries and thanks for info!
Also, thank you for your #6767 PR! @MariyaR do you want to help review this?
@findepi Should we prohibit fail()
by modernizer?
I think there are legitimate cases where verifying some condition.
We shouldn't need to
assertTrue(some condition);
as
if (! some condition) {
fail("good message");
}
reads better.
Of course, we could use throw new AssertionError
in these cases, but we should make sure we have an agreement on this first.
@findepi yes, I would like to help with review
https://github.com/trinodb/trino/pull/6767 is merged. @choiwaiyiu can you please do another check whether there is anything remaining and close the issue? thanks!
@findepi Here are the remaining "fail() + catch" pattern.
trino-blackhole
trino-hive
trino-main
FunctionAssertions (used inside a deprecated method)
trino-phoenix5
trino-product-tests
trino-prometheus
- trino-spi
- TestUnscaledDecimal128Arithmetic
- https://github.com/trinodb/trino/blob/master/core/trino-spi/src/test/java/io/trino/spi/type/TestUnscaledDecimal128Arithmetic.java#L631-L644
Since choiwaiyiu moved this back to Open, I assume that there is still work to do here? I wasn't sure if choiwaiyiu's Mar. 22nd update means that there are still cases to fix.
Hello, @findepi I would like to start my contribution to this issue. Can I pick this up??
Some tests use the following pattern
this is not very readable and can be expressed more tersely with
assertThatThrownBy
also, in case the message not as expected, the actual failure gets lots, so it's harder to diagnose the problemfind all occurrences of such pattern and migrate to
assertThatThrownBy
see https://github.com/trinodb/trino/pull/6554 for example of such migration