Skip to content

Reproduce Android lint project-model discrepancies - #171

Draft
Bencodes wants to merge 1 commit into
mainfrom
bencodes/reproduce-lint-project-model
Draft

Bencodes wants to merge 1 commit into
mainfrom
bencodes/reproduce-lint-project-model

Conversation

@Bencodes

@Bencodes Bencodes commented Nov 8, 2026

Copy link
Copy Markdown
Owner

This draft adds six integration assertions for three project-model behaviors reported in the shared branch. All fixtures use the existing public rule attributes. Three controls pass and three regression assertions intentionally fail on main at e11fb42 with Bazel 9.3.2 and Lint 32.4.1.

Case Passing control Failing regression
Test-only API The production caller's report contains RestrictedApi and DefaultLocale. The same caller with is_test_sources = True still reports both. Only DefaultLocale is expected. Both targets enable checkTestSources through lint.xml so the locale warning proves the file was scanned.
Library identity The APK reports MissingVersion and UnusedResources. The library reports the same app-only findings on the same manifest and layout. Both should be absent.
Effective target SDK Passing the APK's actual processed manifest to lint produces Autofill on the layout. The generated manifest contains android:targetSdkVersion="34". Linting the same APK and layout using the source manifest misses Autofill, although the APK declares target SDK 34 through manifest_values.

Reproduce

Run the controls from the repository root.

bazel test --keep_going --strategy=AndroidLint=worker --test_output=errors \
  //tests/integration:production_source_report_test \
  //tests/integration:app_report_test \
  //tests/integration:processed_manifest_report_test

Run the regression assertions separately.

bazel test --keep_going --strategy=AndroidLint=worker --test_output=errors \
  //tests/integration:test_source_report_test \
  //tests/integration:library_report_test \
  //tests/integration:app_target_sdk_report_test

The XML reports are under bazel-bin/tests/integration/. The processed-manifest control gets its file from the configured app's AndroidIdeInfo provider. The assertions describe the intended behavior so future fixes can turn them green.

Compare the same API caller as production and test code, the same layout in an app and a library, and an APK source manifest with its configured processed manifest.

Co-authored-by: Valera Zakharov <vzakharov@slack-corp.com>
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.

1 participant