Loading packages/SystemUI/checks/src/com/android/internal/systemui/lint/DemotingTestWithoutBugDetector.kt +5 −2 Original line number Diff line number Diff line Loading @@ -43,7 +43,9 @@ class DemotingTestWithoutBugDetector : Detector(), SourceCodeScanner { if (node.qualifiedName in DEMOTING_ANNOTATION_BUG_ID) { if (!containsBugId(node)) { val location = context.getLocation(node) val message = "Please attach a bug id to track demoted test" val message = """Please attach a bug id to track demoted test, """ + """e.g. @FlakyTest(bugId = 123)""" context.report(ISSUE, node, location, message) } } Loading @@ -51,7 +53,8 @@ class DemotingTestWithoutBugDetector : Detector(), SourceCodeScanner { if (node.qualifiedName == DEMOTING_ANNOTATION_IGNORE) { if (!containsBugString(node)) { val location = context.getLocation(node) val message = "Please attach a bug (e.g. b/123) to track demoted test" val message = """Please attach a bug to track demoted test, e.g. @Ignore("b/123")""" context.report(ISSUE, node, location, message) } } Loading packages/SystemUI/checks/tests/com/android/internal/systemui/lint/DemotingTestWithoutBugDetectorTest.kt +5 −5 Original line number Diff line number Diff line Loading @@ -98,7 +98,7 @@ class DemotingTestWithoutBugDetectorTest : SystemUILintDetectorTest() { .run() .expect( """ src/test/pkg/TestClass.java:4: Warning: Please attach a bug id to track demoted test [DemotingTestWithoutBug] src/test/pkg/TestClass.java:4: Warning: Please attach a bug id to track demoted test, e.g. @FlakyTest(bugId = 123) [DemotingTestWithoutBug] @FlakyTest ~~~~~~~~~~ 0 errors, 1 warnings Loading Loading @@ -126,7 +126,7 @@ class DemotingTestWithoutBugDetectorTest : SystemUILintDetectorTest() { .run() .expect( """ src/test/pkg/TestClass.java:4: Warning: Please attach a bug id to track demoted test [DemotingTestWithoutBug] src/test/pkg/TestClass.java:4: Warning: Please attach a bug id to track demoted test, e.g. @FlakyTest(bugId = 123) [DemotingTestWithoutBug] @FlakyTest ~~~~~~~~~~ 0 errors, 1 warnings Loading Loading @@ -181,7 +181,7 @@ class DemotingTestWithoutBugDetectorTest : SystemUILintDetectorTest() { .run() .expect( """ src/test/pkg/TestClass.java:4: Warning: Please attach a bug id to track demoted test [DemotingTestWithoutBug] src/test/pkg/TestClass.java:4: Warning: Please attach a bug id to track demoted test, e.g. @FlakyTest(bugId = 123) [DemotingTestWithoutBug] @Platinum(devices = "foo,bar") ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 0 errors, 1 warnings Loading Loading @@ -236,7 +236,7 @@ class DemotingTestWithoutBugDetectorTest : SystemUILintDetectorTest() { .run() .expect( """ src/test/pkg/TestClass.java:4: Warning: Please attach a bug (e.g. b/123) to track demoted test [DemotingTestWithoutBug] src/test/pkg/TestClass.java:4: Warning: Please attach a bug to track demoted test, e.g. @Ignore("b/123") [DemotingTestWithoutBug] @Ignore ~~~~~~~ 0 errors, 1 warnings Loading Loading @@ -264,7 +264,7 @@ class DemotingTestWithoutBugDetectorTest : SystemUILintDetectorTest() { .run() .expect( """ src/test/pkg/TestClass.java:4: Warning: Please attach a bug (e.g. b/123) to track demoted test [DemotingTestWithoutBug] src/test/pkg/TestClass.java:4: Warning: Please attach a bug to track demoted test, e.g. @Ignore("b/123") [DemotingTestWithoutBug] @Ignore("Not ready") ~~~~~~~~~~~~~~~~~~~~ 0 errors, 1 warnings Loading Loading
packages/SystemUI/checks/src/com/android/internal/systemui/lint/DemotingTestWithoutBugDetector.kt +5 −2 Original line number Diff line number Diff line Loading @@ -43,7 +43,9 @@ class DemotingTestWithoutBugDetector : Detector(), SourceCodeScanner { if (node.qualifiedName in DEMOTING_ANNOTATION_BUG_ID) { if (!containsBugId(node)) { val location = context.getLocation(node) val message = "Please attach a bug id to track demoted test" val message = """Please attach a bug id to track demoted test, """ + """e.g. @FlakyTest(bugId = 123)""" context.report(ISSUE, node, location, message) } } Loading @@ -51,7 +53,8 @@ class DemotingTestWithoutBugDetector : Detector(), SourceCodeScanner { if (node.qualifiedName == DEMOTING_ANNOTATION_IGNORE) { if (!containsBugString(node)) { val location = context.getLocation(node) val message = "Please attach a bug (e.g. b/123) to track demoted test" val message = """Please attach a bug to track demoted test, e.g. @Ignore("b/123")""" context.report(ISSUE, node, location, message) } } Loading
packages/SystemUI/checks/tests/com/android/internal/systemui/lint/DemotingTestWithoutBugDetectorTest.kt +5 −5 Original line number Diff line number Diff line Loading @@ -98,7 +98,7 @@ class DemotingTestWithoutBugDetectorTest : SystemUILintDetectorTest() { .run() .expect( """ src/test/pkg/TestClass.java:4: Warning: Please attach a bug id to track demoted test [DemotingTestWithoutBug] src/test/pkg/TestClass.java:4: Warning: Please attach a bug id to track demoted test, e.g. @FlakyTest(bugId = 123) [DemotingTestWithoutBug] @FlakyTest ~~~~~~~~~~ 0 errors, 1 warnings Loading Loading @@ -126,7 +126,7 @@ class DemotingTestWithoutBugDetectorTest : SystemUILintDetectorTest() { .run() .expect( """ src/test/pkg/TestClass.java:4: Warning: Please attach a bug id to track demoted test [DemotingTestWithoutBug] src/test/pkg/TestClass.java:4: Warning: Please attach a bug id to track demoted test, e.g. @FlakyTest(bugId = 123) [DemotingTestWithoutBug] @FlakyTest ~~~~~~~~~~ 0 errors, 1 warnings Loading Loading @@ -181,7 +181,7 @@ class DemotingTestWithoutBugDetectorTest : SystemUILintDetectorTest() { .run() .expect( """ src/test/pkg/TestClass.java:4: Warning: Please attach a bug id to track demoted test [DemotingTestWithoutBug] src/test/pkg/TestClass.java:4: Warning: Please attach a bug id to track demoted test, e.g. @FlakyTest(bugId = 123) [DemotingTestWithoutBug] @Platinum(devices = "foo,bar") ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 0 errors, 1 warnings Loading Loading @@ -236,7 +236,7 @@ class DemotingTestWithoutBugDetectorTest : SystemUILintDetectorTest() { .run() .expect( """ src/test/pkg/TestClass.java:4: Warning: Please attach a bug (e.g. b/123) to track demoted test [DemotingTestWithoutBug] src/test/pkg/TestClass.java:4: Warning: Please attach a bug to track demoted test, e.g. @Ignore("b/123") [DemotingTestWithoutBug] @Ignore ~~~~~~~ 0 errors, 1 warnings Loading Loading @@ -264,7 +264,7 @@ class DemotingTestWithoutBugDetectorTest : SystemUILintDetectorTest() { .run() .expect( """ src/test/pkg/TestClass.java:4: Warning: Please attach a bug (e.g. b/123) to track demoted test [DemotingTestWithoutBug] src/test/pkg/TestClass.java:4: Warning: Please attach a bug to track demoted test, e.g. @Ignore("b/123") [DemotingTestWithoutBug] @Ignore("Not ready") ~~~~~~~~~~~~~~~~~~~~ 0 errors, 1 warnings Loading