8000 Add test cases to GeocacheFilterTest by RJCheuk · Pull Request #16960 · cgeo/cgeo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add test cases to GeocacheFilterTest #16960

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

Merged
merged 4 commits into from
Jun 9, 2025

Conversation

RJCheuk
Copy link
Contributor
@RJCheuk RJCheuk commented May 19, 2025

This PR adds four new unit tests to GeocacheFilterTest to improve test coverage of the GeocacheFilter class, specifically focusing on filtersSame() and filterList() behavior under minimal configuration.

· Added test cases:
filtersSameReturnsTrueForEmptyFilters()
➤ Verifies that two empty filters (with no internal tree) are considered equal.

filtersSameReturnsFalseIfInconclusiveDiffers()
➤ Verifies that filters with different includeInconclusive values are considered unequal.

filtersSameReturnsFalseIfNameDiffers()
➤ Verifies that filters with different names are considered unequal.

filterListWithNullTreeKeepsAll()
➤ Ensures that calling filterList() with a null tree does not remove any geocaches from the list.

·All tests pass successfully on local fork (RJCheuk/cgeo-rjz).
These tests help verify edge-case behavior in minimal or default filter configurations.

@cgeo-ci-bot
Copy link
Collaborator

Can one of the core team members give me the the permission to test this?

@bekuno
Copy link
Member
bekuno commented May 19, 2025

ok to test

@bekuno bekuno added the ok-to-test Allow running GitHub Workflows label May 19, 2025
Copy link

Job Summary for Gradle

Unit tests :: integration-tests
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
cgeo testDebug 8.11.1 Build Scan published
cgeo packageBasicDebug 8.11.1 Build Scan published
cgeo packageBasicDebugAndroidTest 8.11.1 Build Scan published

Copy link

Job Summary for Gradle

Unit tests :: integration-tests
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
cgeo testDebug 8.11.1 Build Scan published
cgeo packageBasicDebug 8.11.1 Build Scan published
cgeo packageBasicDebugAndroidTest 8.11.1 Build Scan published

@RJCheuk
Copy link
Contributor Author
RJCheuk commented May 20, 2025

Note: The same 9 integration test failures in connectedBasicDebugAndroidTest have appeared twice, once on Android 11 (emulator-5554) and once on Android 8.0.0.

All of the failures are from OC-related modules (OCConnectorTest, OkapiClientTest, ConnectorFactoryTest) and involve missing values (e.g., null geocodes) or assertions related to missing OKAPI keys.

My PR only adds unit tests to GeocacheFilterTest, does not modify any connector code, and all the new tests pass locally.

These failures seem unrelated to my changes and likely stem from CI environment limitations or external dependencies.

Could you kindly help verify if this is acceptable? Please let me know if I should take any action. Thanks again for your review and time!

@eddiemuc
Copy link
Member

Hi @RJCheuk , the failing integration tests are indeed unrelated.

The important joba are "Codacy static. Code analysis" and "default". "Default" job shows all tests passing, you are fine there :-)

However you have some lint/checkstyle errors in your PR. See Codacy and Jenkins.
https://ci.cgeo.org/job/cgeo-CI_PR-build/12018/checkstyleResult/new/

@moving-bits
Copy link
Member

As for the import order and final checks, please have a look at this wiki page about our coding conventions

Copy link

Job Summary for Gradle

Unit tests :: integration-tests
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
cgeo testDebug 8.11.1 Build Scan published
cgeo packageBasicDebug 8.11.1 Build Scan published
cgeo packageBasicDebugAndroidTest 8.11.1 Build Scan published

Copy link

Job Summary for Gradle

Unit tests :: integration-tests
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
cgeo testDebug 8.11.1 Build Scan published
cgeo packageBasicDebug 8.11.1 Build Scan published
cgeo packageBasicDebugAndroidTest 8.11.1 Build Scan published

Copy link

Job Summary for Gradle

8000
Unit tests :: integration-tests
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
cgeo testDebug 8.11.1 Build Scan published
cgeo packageBasicDebug 8.11.1 Build Scan published
cgeo packageBasicDebugAndroidTest 8.11.1 Build Scan published

Copy link

Job Summary for Gradle

Unit tests :: integration-tests
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
cgeo testDebug 8.11.1 Build Scan published
cgeo packageBasicDebug 8.11.1 Build Scan published
cgeo packageBasicDebugAndroidTest 8.11.1 Build Scan published

Copy link

Job Summary for Gradle

Unit tests :: integration-tests
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
cgeo testDebug 8.11.1 Build Scan published
cgeo packageBasicDebug 8.11.1 Build Scan published
cgeo packageBasicDebugAndroidTest 8.11.1 Build Scan published

Copy link

Job Summary for Gradle

Unit tests :: integration-tests
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
cgeo testDebug 8.11.1 Build Scan published
cgeo packageBasicDebug 8.11.1 Build Scan published
cgeo packageBasicDebugAndroidTest 8.11.1 Build Scan published

Copy link

Job Summary for Gradle

Unit tests :: integration-tests
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
cgeo testDebug 8.11.1 Build Scan published
cgeo packageBasicDebug 8.11.1 Build Scan published
cgeo packageBasicDebugAndroidTest 8.11.1 Build Scan published

Removed unnecessary blank lines
@moving-bits moving-bits merged commit cba527d into cgeo:master Jun 9, 2025
10 checks passed
@moving-bits
Copy link
Member

Thanks @RJCheuk for your contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Allow running GitHub Workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0