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

Test additional code paths in java decoder #180

Merged
merged 16 commits into from
Jun 25, 2024

Conversation

springmeyer
Copy link
Collaborator

@springmeyer springmeyer commented Jun 21, 2024

Currently we do not fully test all these combinations:

  • Vectorized path + advanced encodings
  • Vectorized path + without advanced encodings
  • Non-Vectorized path + advanced encodings
  • Non-Vectorized path + without advanced encodings

This PR starts testing all those paths.

The code coverage changes are:

  • overall: 36%to 45%
  • mlt.converter: 64% to 85%
  • mlt.decoder: 55% to 71%

In addition this PR includes:

  • Some refactoring in TestUtils.java to share more code between vectorized and non-vectorized
  • Improvements to TestUtils.java around geometry comparisons (refs Geometry equality in Java tests #178)
  • Improvements to TestUtils.java around property comparisons

Finally, this PR does not attempt to solve any bugs. Rather it finds, isolates, and writes tests harnesses to capture them in code. Once bugs are solved in the future it should be easy to update the tests accordingly.

TODO:

@springmeyer springmeyer mentioned this pull request Jun 21, 2024
3 tasks
Copy link
Collaborator

@msbarry msbarry left a comment

Choose a reason for hiding this comment

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

Looks good! A few minor comments TIOLI

java/src/test/java/com/mlt/TestUtils.java Show resolved Hide resolved
java/src/test/java/com/mlt/TestUtils.java Show resolved Hide resolved
java/src/test/java/com/mlt/TestUtils.java Outdated Show resolved Hide resolved
@springmeyer
Copy link
Collaborator Author

Looks good! A few minor comments TIOLI

Thanks @msbarry! Replied to your comments. I'll merge this shortly.

@springmeyer
Copy link
Collaborator Author

As intended & expected, this failed after pulling in #184:

MltDecoderTest > Decode Bing Tiles > com.mlt.decoder.MltDecoderTest.decodeBingTiles(String)[1] FAILED
    org.opentest4j.AssertionFailedError: Error for 4-8-5/non-advanced: 0 ==> expected: <2> but was: <0>
        at app//org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
        at app//org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
        at app//org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
        at app//org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:150)
        at app//org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:563)
        at app//com.mlt.decoder.MltDecoderTest.decodeBingTiles(MltDecoderTest.java:70)

Which is fixed by updating the test expectation in 7123203

@springmeyer springmeyer enabled auto-merge (squash) June 25, 2024 18:23
@springmeyer springmeyer disabled auto-merge June 25, 2024 18:23
@springmeyer springmeyer merged commit b3edfa4 into maplibre:main Jun 25, 2024
8 checks passed
@springmeyer springmeyer deleted the more-java-decoder-test-coverage branch June 25, 2024 18:43
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.

3 participants