Skip to content

Use Roboelectric to make some tests (especially mappers) unit tests instead of instrumented tests#47

Merged
rfc2822 merged 3 commits intomainfrom
roboelectric-tests
Aug 9, 2025
Merged

Use Roboelectric to make some tests (especially mappers) unit tests instead of instrumented tests#47
rfc2822 merged 3 commits intomainfrom
roboelectric-tests

Conversation

@rfc2822
Copy link
Member

@rfc2822 rfc2822 commented Aug 9, 2025

No description provided.

@rfc2822 rfc2822 added the refactoring Quality improvement of existing functions label Aug 9, 2025
@rfc2822 rfc2822 self-assigned this Aug 9, 2025
@rfc2822 rfc2822 force-pushed the roboelectric-tests branch from b56f218 to 796c757 Compare August 9, 2025 12:19
@rfc2822 rfc2822 marked this pull request as ready for review August 9, 2025 12:20
@rfc2822 rfc2822 requested a review from Copilot August 9, 2025 12:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Migrates Android tests to Robolectric-based unit tests to improve test execution speed and development workflow. The PR replaces instrumented tests with unit tests that can run on the JVM using Robolectric for Android framework mocking.

Key changes:

  • Added Robolectric dependency and test runner configuration to all test classes
  • Migrated tests from androidTest to test directory structure
  • Updated imports to use explicit references instead of wildcard imports
  • Modified build configuration to support Robolectric unit tests

Reviewed Changes

Copilot reviewed 39 out of 52 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
lib/build.gradle.kts Added Robolectric dependency and enabled Android resources for unit tests
gradle/libs.versions.toml Added Robolectric version definition
lib/src/test/kotlin/at/bitfire/vcard4android/contactrow/*.kt Added @RunWith(RobolectricTestRunner::class) annotations and import cleanup
lib/src/test/kotlin/at/bitfire/synctools/**/*.kt Converted tests to use Robolectric with proper imports
lib/src/test/kotlin/at/bitfire/ical4android/**/*.kt Migrated various utility and core tests to Robolectric
lib/src/androidTest/kotlin/at/bitfire/ical4android/Css3ColorTest.kt Moved from androidTest to test directory
Comments suppressed due to low confidence (1)

lib/src/test/kotlin/at/bitfire/ical4android/LocaleNonWesternDigitsTest.kt:47

  • Using String.Companion.format is unnecessarily verbose. Use String.format directly as it's a static method.
        Assert.assertEquals("2020", String.Companion.format(Locale.ROOT, "%d", 2020))

@rfc2822 rfc2822 force-pushed the roboelectric-tests branch from fa5d0cb to 602b4c7 Compare August 9, 2025 14:53
@rfc2822 rfc2822 merged commit edaac8e into main Aug 9, 2025
9 checks passed
@rfc2822 rfc2822 deleted the roboelectric-tests branch August 9, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Quality improvement of existing functions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants