Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 128a61df authored by Tony Mak's avatar Tony Mak
Browse files

Add TEST_MAPPING to textclassifier

Setup presubmit for textclassifier by using TEST_MAPPING.
We will get a dashboard for the test result as well.

Also fixed a few broken tests found by this CL.

BUG: 124041915

Test: atest --test-mapping frameworks/base/core/java/android/service/textclassifier/TEST_MAPPING

Change-Id: I0c516ea8699d7e94cfabd2ea98ebad58505c7e90
parent 8e6dc3b7
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
{
 "imports": [
    {
      "path": "frameworks/base/core/java/android/view/textclassifier"
    }
  ]
}
+23 −0
Original line number Diff line number Diff line
{
  "presubmit": [
    {
      "name": "FrameworksCoreTests",
      "options": [
        {
          "include-filter": "android.view.textclassifier"
        },
        {
          "exclude-annotation": "androidx.test.filters.FlakyTest"
        }
      ]
    },
    {
      "name": "CtsViewTestCases",
      "options": [
        {
          "include-filter": "android.view.textclassifier.cts"
        }
      ]
    }
  ]
}
+1 −2
Original line number Diff line number Diff line
@@ -380,7 +380,6 @@ public class TextClassifierTest {
        assertThat(textLanguage, isTextLanguage("ja"));
    }

    /* DISABLED: b/122467291
    @Test
    public void testSuggestConversationActions_textReplyOnly_maxThree() {
        if (isTextClassifierDisabled()) return;
@@ -408,7 +407,7 @@ public class TextClassifierTest {
            assertThat(conversationAction,
                    isConversationAction(ConversationAction.TYPE_TEXT_REPLY));
        }
    }*/
    }

    @Test
    public void testSuggestConversationActions_textReplyOnly_noMax() {
+2 −2
Original line number Diff line number Diff line
@@ -91,8 +91,8 @@ public class TextClassifierEventTronLoggerTest {
                .isEqualTo(ConversationAction.TYPE_CALL_PHONE);
        assertThat((float) logMaker.getTaggedData(FIELD_TEXT_CLASSIFIER_SCORE))
                .isWithin(0.00001f).of(0.5f);
        assertThat(logMaker.getTaggedData(FIELD_TEXT_CLASSIFIER_EVENT_TIME))
                .isEqualTo(EVENT_TIME);
        // Never write event time.
        assertThat(logMaker.getTaggedData(FIELD_TEXT_CLASSIFIER_EVENT_TIME)).isNull();
        assertThat(logMaker.getPackageName()).isEqualTo(PACKAGE_NAME);
        assertThat(logMaker.getTaggedData(FIELD_TEXT_CLASSIFIER_WIDGET_TYPE))
                .isEqualTo(WIDGET_TYPE);