Improve mach test teaching about android kotlin tests
Categories
(Testing :: General, defect, P2)
Tracking
(Not tracked)
People
(Reporter: gerard-majax, Unassigned)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
Attachments
(1 file)
When bug 1897186 landed it added a very nice support of mach test [...].kt
for running android kotlin tests. However, trying to investigate that try failure: https://treeherder.mozilla.org/jobs?repo=try&author=alissy%40mozilla.com&fromchange=da5cac69907c108eae27bb8356361310acd1337e&selectedTaskRun=O-SLrJxwR8O1L12p9L7qgA.0 that was due to:
[task 2024-12-09T15:53:32.414Z] > Task :lib-crash:compileReleaseUnitTestKotlin FAILED
[task 2024-12-09T15:53:32.414Z] e: warnings found and -Werror specified
[task 2024-12-09T15:53:32.414Z] w: file:///builds/worker/checkouts/gecko/mobile/android/android-components/components/lib/crash/src/test/java/mozilla/components/lib/crash/CrashReporterTest.kt:1389:13 Variable 'result' is never used
[task 2024-12-09T15:53:32.414Z] file:///builds/worker/checkouts/gecko/mobile/android/android-components/components/lib/crash/src/test/java/mozilla/components/lib/crash/CrashReporterTest.kt:1389:13: warning: Variable 'result' is never used
[task 2024-12-09T15:53:32.414Z] w: file:///builds/worker/checkouts/gecko/mobile/android/android-components/components/lib/crash/src/test/java/mozilla/components/lib/crash/CrashReporterTest.kt:1449:13 Variable 'result' is never used
[task 2024-12-09T15:53:32.414Z] file:///builds/worker/checkouts/gecko/mobile/android/android-components/components/lib/crash/src/test/java/mozilla/components/lib/crash/CrashReporterTest.kt:1449:13: warning: Variable 'result' is never used
I could never get mach test
locally to report the same error. After a lot of investigation I found about the correct direct gradle
invocation that would report the correct warning: ./mach gradle lib-crash:testDebugUnitTest --tests mozilla.components.lib.crash.CrashReporterTest
.
We taught mach test
, it would be nice if it was now answering our questions :)
Attached is the log of ./mach test mobile/android/android-components/components/lib/crash/src/test/java/mozilla/components/lib/crash/CrashReporterTest.kt
, after touching the file to make sure output is relevant.
Updated•3 months ago
|
Comment 1•2 months ago
|
||
The severity field is not set for this bug.
:jmaher, could you have a look please?
For more information, please visit BugBot documentation.
Updated•2 months ago
|
Comment 2•25 days ago
|
||
Looks like what is happening here is that you have lint warnings in the code and the compiler is failing because we have the warningsAsErrors
compiler flag turned on in various places.
I think this flag is causing undue pain in the android development process and we should just remove it, as the linters run separately anyway.
i raised a bug for this a while ago so will try and prioritise that. https://bugzilla.mozilla.org/show_bug.cgi?id=1923039
Updated•25 days ago
|
Description
•