Repository navigation
fix(test): update Robolectric SDK config from 23 to 26 - #244
forkline-bot[bot] wants to merge 2 commits into
Conversation
- Remove @config(sdk=[26]) from AutofillDecryptActivityTest to let Robolectric use its default SDK selection (targetSdk clamped to max supported). This eliminates the root cause: hardcoded SDK pins break when minSdk changes. - Remove Robolectric entirely from StrictDomainRegexTest since it tests pure Kotlin regex logic (generateStrictDomainRegex) with no Android dependencies. This makes the test faster and eliminates SDK coupling for 6 of 7 previously affected tests. Both changes improve maintainability by removing brittle SDK configuration that caused the original CI failures.
Maintainability Review
Findings1. Priority: medium 2. Priority: medium 3. Priority: low |
Summary
Fixed CI failures in
StrictDomainRegexTest(6 tests) andAutofillDecryptActivityTestcaused byjava.lang.IllegalArgumentException at UnknownSdk.java:45.Root Cause
Robolectric 4.17 enforces that
@Config(sdk)must be >= the app'sminSdk. The app'sminSdkis 26, but both test files were configured with@Config(sdk = [23]), which is no longer valid.Changes
StrictDomainRegexTestfrom@Config(sdk = [23])to@Config(sdk = [26])AutofillDecryptActivityTestfrom@Config(sdk = [23])to@Config(sdk = [26])Both changes align the Robolectric SDK configuration with the app's
minSdk = 26.This PR was generated by Forkline — AI-powered code contributions.
The agent analyzed the issue and implemented this fix autonomously.