[test/flink] Cover full data types in UnionRead tests and polish some tests#1167
Conversation
leonardBang
left a comment
There was a problem hiding this comment.
Thanks @naivedogger for the contribution, I left two comments
| "[+I[false, 1, 2, 3, 4, 5.1, 6.0, string, 0.09, 10, 2023-10-25T12:01:13.182005Z, 2023-10-25T12:01:13.183006, [1, 2, 3, 4], 2025], +I[false, 1, 2, 3, 4, 5.1, 6.0, string, 0.09, 10, 2023-10-25T12:01:13.182005Z, 2023-10-25T12:01:13.183006, [1, 2, 3, 4], 2026], +I[true, 10, 20, 30, 40, 50.1, 60.0, another_string, 0.90, 100, 2023-10-25T12:01:13.200005Z, 2023-10-25T12:01:13.201006, [1, 2, 3, 4], 2025], +I[true, 10, 20, 30, 40, 50.1, 60.0, another_string, 0.90, 100, 2023-10-25T12:01:13.200005Z, 2023-10-25T12:01:13.201006, [1, 2, 3, 4], 2026]]"); | ||
| } else { | ||
| assertThat(paimonSnapshotRows.toString().replace("+U", "+I")) | ||
| .isEqualTo( | ||
| "[+I[false, 1, 2, 3, 4, 5.1, 6.0, string, 0.09, 10, 2023-10-25T12:01:13.182005Z, 2023-10-25T12:01:13.183006, [1, 2, 3, 4], null], +I[true, 10, 20, 30, 40, 50.1, 60.0, another_string, 0.90, 100, 2023-10-25T12:01:13.200005Z, 2023-10-25T12:01:13.201006, [1, 2, 3, 4], null]]"); |
There was a problem hiding this comment.
we can split the long string to multiple lines to make sure it readable
| "[+I[false, 1, 2, 3, 4, 5.1, 6.0, string, 0.09, 10, 2023-10-25T12:01:13.182005Z, 2023-10-25T12:01:13.183006, [1, 2, 3, 4], 2025], +I[false, 1, 2, 3, 4, 5.1, 6.0, string, 0.09, 10, 2023-10-25T12:01:13.182005Z, 2023-10-25T12:01:13.183006, [1, 2, 3, 4], 2026], +I[true, 100, 200, 30, 400, 500.1, 600.0, another_string_2, 9.00, 1000, 2023-10-25T12:01:13.400007Z, 2023-10-25T12:01:13.501008, [5, 6, 7, 8], 2025], +I[true, 100, 200, 30, 400, 500.1, 600.0, another_string_2, 9.00, 1000, 2023-10-25T12:01:13.400007Z, 2023-10-25T12:01:13.501008, [5, 6, 7, 8], 2026]]"); | ||
| } else { | ||
| assertThat(result.toString().replace("+U", "+I")) | ||
| .isEqualTo( | ||
| "[+I[false, 1, 2, 3, 4, 5.1, 6.0, string, 0.09, 10, 2023-10-25T12:01:13.182005Z, 2023-10-25T12:01:13.183006, [1, 2, 3, 4], null], +I[true, 100, 200, 30, 400, 500.1, 600.0, another_string_2, 9.00, 1000, 2023-10-25T12:01:13.400007Z, 2023-10-25T12:01:13.501008, [5, 6, 7, 8], null]]"); | ||
| } |
|
|
||
| @ParameterizedTest | ||
| @ValueSource(booleans = {false, true}) | ||
| void testUnionReadFullType(Boolean isPartitioned) throws Exception { |
There was a problem hiding this comment.
All tests in this class are pretty heavy as they need mini-cluster resources, we can reduce testUnionReadFullType and testPrimaryKeyTable to one for example testPrimaryKeyTableWithFullTypes to save the test cost, and testUnionReadWithTimeStamp can be improve the testUnionReadWithTimeStampAndFullTypes. In this way, we improve our test coverage but not waste unnecessary test cost.
329a396 to
32abfe6
Compare
leonardBang
left a comment
There was a problem hiding this comment.
Thanks @naivedogger for the update, LGTM, I append a commit to improve existing tests
bdab959 to
004b6c3
Compare
Purpose
Linked issue: close #1127
Brief change log
Tests
API and Format
Documentation