Status Update
Comments
ju...@google.com <ju...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
Author: Radha Nakade <
Link:
Migrate traffic from pixel2 to mediumphone on FTL emulators.
Expand for full commit details
Migrate traffic from pixel2 to mediumphone on FTL emulators.
Bug: 396715333
Test: ./gradlew emoji2:emoji2-emojipicker:ftlmediumphoneapi33
Change-Id: If5555443ca1a91479128e1bd6f4f909154c40ba2
Files:
- M
buildSrc/private/src/main/kotlin/androidx/build/FtlRunner.kt
Hash: c76f8094154101867327912e659ae47509755957
Date: Wed Feb 26 11:27:46 2025
lp...@google.com <lp...@google.com> #3
Ah interesting, I didn't know about that. We have a lot of Compose custom lint checks that probably should be running on tests (we have the test scope defined in those lint checks), but I don't think adding all the IDs to this file with fatal is the best way of enabling these...
Could we consider inverting this so we just disable the specific built-in checks we don't want, and rely on the test scope as a signal for checks that should run vs not run?
au...@google.com <au...@google.com>
ju...@google.com <ju...@google.com> #4
Could we consider inverting this so we just disable the specific built-in checks we don't want, and rely on the test scope as a signal for checks that should run vs not run?
That would be the ideal solution, but the configuration options from lint don't really allow it.
The default behavior when checkTestSources
is false is that only checks with test scope set are run on test sources. AndroidX wanted to run the NewApi
check on tests, which doesn't have test scope set, and requested lint add a configuration option to enable additional checks on test sources in checkTestSources
to true, disabling all checks on tests, and reenabling specific checks. The downside of this solution is that now checks with test scope are not run on test sources unless specifically enabled. I went through lint.xml
.
Some options of how we could update the configuration:
- Set
checkTestSources
to false. Of the issues enabled for test sources inlint.xml
, most are in the AndroidX repo, so we can set test scope for those. The non-AndroidX checks areNewApi
andWrongThread
. We could make clones of these in the AndroidXlint-checks
project with test scope set. (I think we could clone them without actually copying the code from the original checks because the implementation classes are accessible from thelint-checks
project.) - Keep
checkTestSources
true, but instead of disabling all checks on tests and reenabling some, we could disable the checks we don't want run on tests. The trouble there is that there's a we'd probably want to disable, and we'd need to set all the test paths to ignore for each one. We could programmatically generate thevery long list of checks lint.xml
file to make that part easier to maintain. - Keep the current behavior of checks selectively reenabled for tests in
lint.xml
. Add a lint check which looks for other lint checks which have test scope set but aren't inlint.xml
and suggest adding them.
ju...@google.com <ju...@google.com> #5
ag/31807228 added the configuration we need to switch to running checks with test scope plus specified additional checks on test sources, but unfortunately NewApi
, which is one of the checks we want to enable on test sources even though it does not specify test scope, still won't run on test sources --
bu...@google.com <bu...@google.com> #6
Bugjuggler:
ap...@google.com <ap...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-main
Author: Julia McClellan <
Link:
Add test scope to lint checks we run on test sources
Expand for full commit details
Add test scope to lint checks we run on test sources
These two checks are currently enabled for tests in lint.xml, but don't set test scope.
Bug: 382507748
Test: ./gradlew lint
Change-Id: I25f8041ca4c0195480b951a9f1f3f2591fcf15ac
Files:
- M
lint-checks/src/main/java/androidx/build/lint/BanThreadSleep.kt
- M
lint/lint-gradle/src/main/java/androidx/lint/gradle/WithPluginClasspathUsageDetector.kt
Hash: 75ef3e9faf4b975653cf7344f5ed1bbd0f30b5d1
Date: Fri Feb 28 16:23:14 2025
ju...@google.com <ju...@google.com>
ap...@google.com <ap...@google.com> #8
Project: platform/frameworks/support
Branch: androidx-main
Author: Julia McClellan <
Link:
Move root lint.xml config to buildSrc subdirectory
Expand for full commit details
Move root lint.xml config to buildSrc subdirectory
Having the file directly in buildSrc causes issues for `./gradlew buildSrc-tests:lint` when lint checks are set to run on tests in lint.xml. The configuration file was registered twice, once from the setting in LintConfiguration and once from scanning the directory. When it was picked up from scanning the directory, it caused the lint warning "The tests attribute can only be specified for lint.xml files at the module level or higher".
Bug: 382507748
Test: `./gradlew buildSrc-tests:lint` for topic
Change-Id: I0629ac180487ac200b263caf3030739ee71c292e
Files:
- M
buildSrc/OWNERS
- M
buildSrc/lint/lint.xml
- M
buildSrc/lint/lint_samples.xml
- M
buildSrc/private/src/main/kotlin/androidx/build/LintConfiguration.kt
Hash: 2a3f0104842840b2b1f4db7342a99f0e77154573
Date: Tue Mar 04 17:47:16 2025
ap...@google.com <ap...@google.com> #9
Project: platform/frameworks/support
Branch: androidx-main
Author: Julia McClellan <
Link:
Update lint configuration for test sources
Expand for full commit details
Update lint configuration for test sources
Instead of disabling all lint checks on test sources and then reenabling specific checks, this enables specifically the lint checks which set test scope, and also a few other checks.
Bug: 382507748
Test: `./gradlew lint` for topic
Change-Id: Ib91c16de04df9b763788247d2e19180558630f44
Files:
- M
buildSrc/lint.xml
- M
buildSrc/private/src/main/kotlin/androidx/build/LintConfiguration.kt
Hash: bc74ab7c553a41f52e031349bdaccfd83043b999
Date: Sat Feb 22 14:39:43 2025
Description
I noticed that we aren't running (some? all?) lint checks on test sources in multiplatform projects.
I think this is related to the workaround we have here:
This only adds androidMain (and depenendencies), but it doesn't look like we are adding androidInstrumentedTest / androidUnitTest etc anywhere.
To try and prove this I added those to the block I linked above, and I started getting a lot of new lint failures in
compose:ui:ui:lint
, but it's also possible there could be some other issue with lint running on test source sets, since there is a differentiation in lint between test and non-test source sets (checkTestSources
inLintConfiguration
). I see some baselined lint issues in test sources for other mpp libraries though, so I'm not sure if something regressed here at some point, or there is something unique about compose:ui:ui, etc.I also don't know if this is similarly broken for other mpp libraries, that do not go through this Android-specific workaround, it might also be broken for other non-android, non-test source sets.