jenkins-bot has submitted this change and it was merged.

Change subject: Annotate tests that do not require a WebView
......................................................................


Annotate tests that do not require a WebView

BasePageLoadTest is annotated as @LargeTest but there isn't a flag known
to run all tests not annotated. Instead, annotate all other
instrumentation tests as @Small.

Bug: T133183
Change-Id: Iee336a91b2b610b0ffb53a6bcd3d43f6a4ba90c8
---
M app/src/androidTest/java/org/wikipedia/editing/EditPreviewTaskTest.java
M 
app/src/androidTest/java/org/wikipedia/editing/richtext/SyntaxHighlighterTest.java
M app/src/androidTest/java/org/wikipedia/feed/view/CardLargeHeaderViewTest.java
M app/src/androidTest/java/org/wikipedia/navtab/NavTabViewTest.java
M app/src/androidTest/java/org/wikipedia/nearby/NearbyUnitTests.java
M app/src/androidTest/java/org/wikipedia/savedpages/ImageUrlMapTest.java
M app/src/androidTest/java/org/wikipedia/test/BridgeTests.java
M app/src/androidTest/java/org/wikipedia/test/CreateAccountTaskTest.java
M app/src/androidTest/java/org/wikipedia/test/EditTaskTest.java
M app/src/androidTest/java/org/wikipedia/test/FetchSectionWikitextTaskTests.java
M app/src/androidTest/java/org/wikipedia/test/FullSearchTaskTests.java
M app/src/androidTest/java/org/wikipedia/test/GetDescriptionsTaskTests.java
M app/src/androidTest/java/org/wikipedia/test/LanguageVariantTests.java
M app/src/androidTest/java/org/wikipedia/test/LoginTaskTest.java
M app/src/androidTest/java/org/wikipedia/test/PageTests.java
M app/src/androidTest/java/org/wikipedia/test/ParcelableTest.java
M app/src/androidTest/java/org/wikipedia/test/SectionTests.java
M app/src/androidTest/java/org/wikipedia/test/SiteTests.java
M app/src/androidTest/java/org/wikipedia/test/SuggestionsTaskTests.java
M app/src/androidTest/java/org/wikipedia/test/TranslationTests.java
M app/src/androidTest/java/org/wikipedia/test/concurrency/AsyncTaskTest.java
21 files changed, 47 insertions(+), 5 deletions(-)

Approvals:
  Dbrant: Looks good to me, approved
  jenkins-bot: Verified



diff --git 
a/app/src/androidTest/java/org/wikipedia/editing/EditPreviewTaskTest.java 
b/app/src/androidTest/java/org/wikipedia/editing/EditPreviewTaskTest.java
index 9f8e0b2..64f882c 100644
--- a/app/src/androidTest/java/org/wikipedia/editing/EditPreviewTaskTest.java
+++ b/app/src/androidTest/java/org/wikipedia/editing/EditPreviewTaskTest.java
@@ -1,6 +1,7 @@
 package org.wikipedia.editing;
 
 import android.support.annotation.NonNull;
+import android.support.test.filters.SmallTest;
 import android.support.test.runner.AndroidJUnit4;
 
 import org.junit.Test;
@@ -13,6 +14,7 @@
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.containsString;
 
+@SmallTest
 @RunWith(AndroidJUnit4.class)
 public class EditPreviewTaskTest {
     @Test
diff --git 
a/app/src/androidTest/java/org/wikipedia/editing/richtext/SyntaxHighlighterTest.java
 
b/app/src/androidTest/java/org/wikipedia/editing/richtext/SyntaxHighlighterTest.java
index 93f71d6..b3ad025 100644
--- 
a/app/src/androidTest/java/org/wikipedia/editing/richtext/SyntaxHighlighterTest.java
+++ 
b/app/src/androidTest/java/org/wikipedia/editing/richtext/SyntaxHighlighterTest.java
@@ -1,6 +1,7 @@
 package org.wikipedia.editing.richtext;
 
 import android.support.annotation.NonNull;
+import android.support.test.filters.SmallTest;
 import android.view.ContextThemeWrapper;
 import android.widget.EditText;
 
@@ -15,6 +16,7 @@
 import static org.hamcrest.Matchers.instanceOf;
 import static org.hamcrest.Matchers.is;
 
+@SmallTest
 public class SyntaxHighlighterTest {
     @Test
     public void testSyntaxHighlight() {
diff --git 
a/app/src/androidTest/java/org/wikipedia/feed/view/CardLargeHeaderViewTest.java 
b/app/src/androidTest/java/org/wikipedia/feed/view/CardLargeHeaderViewTest.java
index 95328fb..0da2478 100644
--- 
a/app/src/androidTest/java/org/wikipedia/feed/view/CardLargeHeaderViewTest.java
+++ 
b/app/src/androidTest/java/org/wikipedia/feed/view/CardLargeHeaderViewTest.java
@@ -3,6 +3,7 @@
 import android.support.annotation.DrawableRes;
 import android.support.annotation.NonNull;
 import android.support.annotation.StringRes;
+import android.support.test.filters.SmallTest;
 import android.view.View;
 
 import org.junit.experimental.theories.Theory;
@@ -18,7 +19,7 @@
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 
-public class CardLargeHeaderViewTest extends ViewTest {
+@SmallTest public class CardLargeHeaderViewTest extends ViewTest {
     private CardLargeHeaderView subject;
 
     @Theory public void testWidth(@TestedOn(ints = {WIDTH_DP_L, WIDTH_DP_M}) 
int widthDp,
diff --git a/app/src/androidTest/java/org/wikipedia/navtab/NavTabViewTest.java 
b/app/src/androidTest/java/org/wikipedia/navtab/NavTabViewTest.java
index 0f7b253..ebaee98 100644
--- a/app/src/androidTest/java/org/wikipedia/navtab/NavTabViewTest.java
+++ b/app/src/androidTest/java/org/wikipedia/navtab/NavTabViewTest.java
@@ -1,6 +1,7 @@
 package org.wikipedia.navtab;
 
 import android.support.annotation.NonNull;
+import android.support.test.filters.SmallTest;
 
 import org.junit.Test;
 import org.junit.experimental.theories.Theory;
@@ -13,7 +14,7 @@
 import static org.hamcrest.Matchers.notNullValue;
 import static org.junit.Assert.assertThat;
 
-public class NavTabViewTest extends ViewTest {
+@SmallTest public class NavTabViewTest extends ViewTest {
     private NavTabView subject;
 
     @Theory public void testWidth(@TestedOn(ints = {WIDTH_DP_XL, WIDTH_DP_XS}) 
int widthDp,
diff --git a/app/src/androidTest/java/org/wikipedia/nearby/NearbyUnitTests.java 
b/app/src/androidTest/java/org/wikipedia/nearby/NearbyUnitTests.java
index 85b3d02..445f05e 100644
--- a/app/src/androidTest/java/org/wikipedia/nearby/NearbyUnitTests.java
+++ b/app/src/androidTest/java/org/wikipedia/nearby/NearbyUnitTests.java
@@ -4,6 +4,7 @@
 import org.json.JSONObject;
 import android.location.Location;
 import android.support.annotation.StringRes;
+import android.support.test.filters.SmallTest;
 import android.test.AndroidTestCase;
 
 import java.util.Collections;
@@ -14,6 +15,7 @@
 /**
  * Unit tests for Nearby related classes. Probably should refactor this into a 
model class.
  */
+@SmallTest
 public class NearbyUnitTests extends AndroidTestCase {
     // can't seem to suppress the checkstyle warnings for MagicNumbers. Oh 
well.
     private static final int THREE = 3;
diff --git 
a/app/src/androidTest/java/org/wikipedia/savedpages/ImageUrlMapTest.java 
b/app/src/androidTest/java/org/wikipedia/savedpages/ImageUrlMapTest.java
index 1ffa0d3..c0d3414 100644
--- a/app/src/androidTest/java/org/wikipedia/savedpages/ImageUrlMapTest.java
+++ b/app/src/androidTest/java/org/wikipedia/savedpages/ImageUrlMapTest.java
@@ -1,5 +1,7 @@
 package org.wikipedia.savedpages;
 
+import android.support.test.filters.SmallTest;
+
 import org.junit.Before;
 import org.junit.Test;
 
@@ -7,7 +9,7 @@
 import static org.hamcrest.Matchers.is;
 
 // todo: move to JUnit tests when 
https://github.com/robolectric/robolectric/issues/1605 is fixed.
-public class ImageUrlMapTest {
+@SmallTest public class ImageUrlMapTest {
     private static final String BASE_DIR = "/data/short/img";
 
     private ImageUrlMap.Builder builder;
diff --git a/app/src/androidTest/java/org/wikipedia/test/BridgeTests.java 
b/app/src/androidTest/java/org/wikipedia/test/BridgeTests.java
index 102a194..b1c2732 100644
--- a/app/src/androidTest/java/org/wikipedia/test/BridgeTests.java
+++ b/app/src/androidTest/java/org/wikipedia/test/BridgeTests.java
@@ -1,5 +1,6 @@
 package org.wikipedia.test;
 
+import android.support.test.filters.SmallTest;
 import android.support.test.runner.AndroidJUnit4;
 import android.webkit.WebView;
 import org.json.JSONException;
@@ -14,6 +15,7 @@
 import static org.hamcrest.MatcherAssert.assertThat;
 import static android.support.test.InstrumentationRegistry.getInstrumentation;
 
+@SmallTest
 @RunWith(AndroidJUnit4.class)
 public class BridgeTests {
     private static final String TEST_FILE_URI = 
"file:///android_asset/tests/index.html";
diff --git 
a/app/src/androidTest/java/org/wikipedia/test/CreateAccountTaskTest.java 
b/app/src/androidTest/java/org/wikipedia/test/CreateAccountTaskTest.java
index 0931436..caba8ed 100644
--- a/app/src/androidTest/java/org/wikipedia/test/CreateAccountTaskTest.java
+++ b/app/src/androidTest/java/org/wikipedia/test/CreateAccountTaskTest.java
@@ -4,6 +4,7 @@
 import android.net.Uri;
 import android.support.annotation.NonNull;
 import android.support.test.InstrumentationRegistry;
+import android.support.test.filters.SmallTest;
 import android.support.test.runner.AndroidJUnit4;
 
 import com.facebook.drawee.view.SimpleDraweeView;
@@ -30,6 +31,7 @@
  * a CAPTCHA.  The most we can do is check that we are able to retrieve the 
createaccount token and
  * CAPTCHA image as expected.
  */
+@SmallTest
 @RunWith(AndroidJUnit4.class)
 public class CreateAccountTaskTest {
     private static Api TEST_WIKI_API = new Api("test.wikipedia.org");
diff --git a/app/src/androidTest/java/org/wikipedia/test/EditTaskTest.java 
b/app/src/androidTest/java/org/wikipedia/test/EditTaskTest.java
index 7ab4226..7e37632 100644
--- a/app/src/androidTest/java/org/wikipedia/test/EditTaskTest.java
+++ b/app/src/androidTest/java/org/wikipedia/test/EditTaskTest.java
@@ -1,6 +1,7 @@
 package org.wikipedia.test;
 
 import android.support.annotation.NonNull;
+import android.support.test.filters.SmallTest;
 import android.support.test.runner.AndroidJUnit4;
 
 import org.junit.Before;
@@ -21,7 +22,7 @@
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.MatcherAssert.assertThat;
 
-
+@SmallTest
 @RunWith(AndroidJUnit4.class)
 public class EditTaskTest {
     private static final Site TEST_WIKI_SITE = new Site("test.wikipedia.org");
diff --git 
a/app/src/androidTest/java/org/wikipedia/test/FetchSectionWikitextTaskTests.java
 
b/app/src/androidTest/java/org/wikipedia/test/FetchSectionWikitextTaskTests.java
index 962fea8..4d29015 100644
--- 
a/app/src/androidTest/java/org/wikipedia/test/FetchSectionWikitextTaskTests.java
+++ 
b/app/src/androidTest/java/org/wikipedia/test/FetchSectionWikitextTaskTests.java
@@ -1,6 +1,7 @@
 
 package org.wikipedia.test;
 
+import android.support.test.filters.SmallTest;
 import android.test.ActivityUnitTestCase;
 import org.wikipedia.page.PageTitle;
 import org.wikipedia.Site;
@@ -9,6 +10,7 @@
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
+@SmallTest
 public class FetchSectionWikitextTaskTests extends 
ActivityUnitTestCase<TestDummyActivity> {
     private static final int TASK_COMPLETION_TIMEOUT = 20000;
 
diff --git 
a/app/src/androidTest/java/org/wikipedia/test/FullSearchTaskTests.java 
b/app/src/androidTest/java/org/wikipedia/test/FullSearchTaskTests.java
index cc014e3..bd18969 100644
--- a/app/src/androidTest/java/org/wikipedia/test/FullSearchTaskTests.java
+++ b/app/src/androidTest/java/org/wikipedia/test/FullSearchTaskTests.java
@@ -1,5 +1,6 @@
 package org.wikipedia.test;
 
+import android.support.test.filters.SmallTest;
 import android.test.ActivityUnitTestCase;
 
 import org.wikipedia.Site;
@@ -14,6 +15,7 @@
 /**
  * Tests for full text search.
  */
+@SmallTest
 public class FullSearchTaskTests extends 
ActivityUnitTestCase<TestDummyActivity> {
     private static final int TASK_COMPLETION_TIMEOUT = 20000;
     private static final int BATCH_SIZE = 12;
diff --git 
a/app/src/androidTest/java/org/wikipedia/test/GetDescriptionsTaskTests.java 
b/app/src/androidTest/java/org/wikipedia/test/GetDescriptionsTaskTests.java
index 94eec67..05d5d81 100644
--- a/app/src/androidTest/java/org/wikipedia/test/GetDescriptionsTaskTests.java
+++ b/app/src/androidTest/java/org/wikipedia/test/GetDescriptionsTaskTests.java
@@ -4,6 +4,8 @@
 import org.wikipedia.Site;
 import org.wikipedia.WikipediaApp;
 import org.wikipedia.wikidata.GetDescriptionsTask;
+
+import android.support.test.filters.SmallTest;
 import android.test.ActivityUnitTestCase;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -15,6 +17,7 @@
 /**
  * Tests retrieval of Wikidata descriptions through enwiki.
  */
+@SmallTest
 public class GetDescriptionsTaskTests extends 
ActivityUnitTestCase<TestDummyActivity> {
     private static final int TASK_COMPLETION_TIMEOUT = 200000;
     private static final Site SITE = Site.forLanguageCode("en");
diff --git 
a/app/src/androidTest/java/org/wikipedia/test/LanguageVariantTests.java 
b/app/src/androidTest/java/org/wikipedia/test/LanguageVariantTests.java
index 694d6de..7003b30 100644
--- a/app/src/androidTest/java/org/wikipedia/test/LanguageVariantTests.java
+++ b/app/src/androidTest/java/org/wikipedia/test/LanguageVariantTests.java
@@ -1,5 +1,6 @@
 package org.wikipedia.test;
 
+import android.support.test.filters.SmallTest;
 import android.test.InstrumentationTestCase;
 import android.test.UiThreadTest;
 
@@ -9,6 +10,7 @@
 
 import java.util.Locale;
 
+@SmallTest
 public class LanguageVariantTests extends InstrumentationTestCase {
     private Locale defaultLocale;
     private String appLanguage;
diff --git a/app/src/androidTest/java/org/wikipedia/test/LoginTaskTest.java 
b/app/src/androidTest/java/org/wikipedia/test/LoginTaskTest.java
index eda8407..32d3197 100644
--- a/app/src/androidTest/java/org/wikipedia/test/LoginTaskTest.java
+++ b/app/src/androidTest/java/org/wikipedia/test/LoginTaskTest.java
@@ -2,6 +2,7 @@
 
 import android.support.annotation.StringRes;
 import android.support.test.InstrumentationRegistry;
+import android.support.test.filters.SmallTest;
 import android.support.test.runner.AndroidJUnit4;
 
 import org.junit.Test;
@@ -19,6 +20,7 @@
 import static org.hamcrest.MatcherAssert.assertThat;
 import static android.support.test.InstrumentationRegistry.getInstrumentation;
 
+@SmallTest
 @RunWith(AndroidJUnit4.class)
 public class LoginTaskTest {
     private static final String TEST_WIKI = "test.wikipedia.org";
diff --git a/app/src/androidTest/java/org/wikipedia/test/PageTests.java 
b/app/src/androidTest/java/org/wikipedia/test/PageTests.java
index 6c0317b..f13d738 100644
--- a/app/src/androidTest/java/org/wikipedia/test/PageTests.java
+++ b/app/src/androidTest/java/org/wikipedia/test/PageTests.java
@@ -1,5 +1,7 @@
 package org.wikipedia.test;
 
+import android.support.test.filters.SmallTest;
+
 import junit.framework.TestCase;
 import org.json.JSONObject;
 import org.wikipedia.page.PageTitle;
@@ -11,6 +13,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
+@SmallTest
 public class PageTests extends TestCase {
 
     private static final int NUM_SECTIONS = 10;
diff --git a/app/src/androidTest/java/org/wikipedia/test/ParcelableTest.java 
b/app/src/androidTest/java/org/wikipedia/test/ParcelableTest.java
index 8a3bac8..88d8118 100644
--- a/app/src/androidTest/java/org/wikipedia/test/ParcelableTest.java
+++ b/app/src/androidTest/java/org/wikipedia/test/ParcelableTest.java
@@ -2,6 +2,8 @@
 
 import android.os.Parcel;
 import android.os.Parcelable;
+import android.support.test.filters.SmallTest;
+
 import junit.framework.TestCase;
 import org.json.JSONObject;
 import org.wikipedia.page.PageTitle;
@@ -11,6 +13,7 @@
 import org.wikipedia.page.PageProperties;
 import org.wikipedia.pageimages.PageImage;
 
+@SmallTest
 public class ParcelableTest extends TestCase {
 
     private void parcelAndTestObjects(Parcelable p) throws Exception {
diff --git a/app/src/androidTest/java/org/wikipedia/test/SectionTests.java 
b/app/src/androidTest/java/org/wikipedia/test/SectionTests.java
index 4838c6d..4621ba9 100644
--- a/app/src/androidTest/java/org/wikipedia/test/SectionTests.java
+++ b/app/src/androidTest/java/org/wikipedia/test/SectionTests.java
@@ -1,8 +1,10 @@
 package org.wikipedia.test;
 
+import android.support.test.filters.SmallTest;
 import android.test.AndroidTestCase;
 import org.wikipedia.page.Section;
 
+@SmallTest
 public class SectionTests extends AndroidTestCase {
     public void testSectionLead() {
         // Section 0 is the lead
diff --git a/app/src/androidTest/java/org/wikipedia/test/SiteTests.java 
b/app/src/androidTest/java/org/wikipedia/test/SiteTests.java
index eaf3780..746dcb7 100644
--- a/app/src/androidTest/java/org/wikipedia/test/SiteTests.java
+++ b/app/src/androidTest/java/org/wikipedia/test/SiteTests.java
@@ -1,9 +1,12 @@
 package org.wikipedia.test;
 
+import android.support.test.filters.SmallTest;
+
 import junit.framework.TestCase;
 import org.wikipedia.page.PageTitle;
 import org.wikipedia.Site;
 
+@SmallTest
 public class SiteTests extends TestCase {
 
     public void testEquals() throws Exception {
diff --git 
a/app/src/androidTest/java/org/wikipedia/test/SuggestionsTaskTests.java 
b/app/src/androidTest/java/org/wikipedia/test/SuggestionsTaskTests.java
index faf6ff0..b9c9118 100644
--- a/app/src/androidTest/java/org/wikipedia/test/SuggestionsTaskTests.java
+++ b/app/src/androidTest/java/org/wikipedia/test/SuggestionsTaskTests.java
@@ -1,5 +1,6 @@
 package org.wikipedia.test;
 
+import android.support.test.filters.SmallTest;
 import android.test.ActivityUnitTestCase;
 
 import org.wikipedia.Constants;
@@ -18,6 +19,7 @@
 /**
  * Tests for getting suggestions for further reading.
  */
+@SmallTest
 public class SuggestionsTaskTests extends 
ActivityUnitTestCase<TestDummyActivity> {
     private static final int TASK_COMPLETION_TIMEOUT = 200000;
     private static final Site SITE = new Site("en.wikipedia.org"); // 
suggestions don't seem to work on testwiki
diff --git a/app/src/androidTest/java/org/wikipedia/test/TranslationTests.java 
b/app/src/androidTest/java/org/wikipedia/test/TranslationTests.java
index 01c5487..9d1f037 100644
--- a/app/src/androidTest/java/org/wikipedia/test/TranslationTests.java
+++ b/app/src/androidTest/java/org/wikipedia/test/TranslationTests.java
@@ -3,6 +3,7 @@
 import android.content.res.AssetManager;
 import android.content.res.Configuration;
 import android.content.res.Resources;
+import android.support.test.filters.SmallTest;
 import android.test.ActivityInstrumentationTestCase2;
 import android.util.DisplayMetrics;
 import android.util.Log;
@@ -24,6 +25,7 @@
  *
  * TODO: check content_license_html is valid HTML
  */
+@SmallTest
 public class TranslationTests extends 
ActivityInstrumentationTestCase2<PageActivity> {
     private static final String TAG = "TrTest";
 
diff --git 
a/app/src/androidTest/java/org/wikipedia/test/concurrency/AsyncTaskTest.java 
b/app/src/androidTest/java/org/wikipedia/test/concurrency/AsyncTaskTest.java
index 059c999..e841f71 100644
--- a/app/src/androidTest/java/org/wikipedia/test/concurrency/AsyncTaskTest.java
+++ b/app/src/androidTest/java/org/wikipedia/test/concurrency/AsyncTaskTest.java
@@ -1,5 +1,6 @@
 package org.wikipedia.test.concurrency;
 
+import android.support.test.filters.SmallTest;
 import android.test.ActivityUnitTestCase;
 import org.wikipedia.concurrency.SaneAsyncTask;
 import org.wikipedia.test.TestDummyActivity;
@@ -7,7 +8,7 @@
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-public class AsyncTaskTest extends ActivityUnitTestCase<TestDummyActivity> {
+@SmallTest public class AsyncTaskTest extends 
ActivityUnitTestCase<TestDummyActivity> {
     private static final int TASK_COMPLETION_TIMEOUT = 1000;
 
     public AsyncTaskTest() {

-- 
To view, visit https://gerrit.wikimedia.org/r/310356
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iee336a91b2b610b0ffb53a6bcd3d43f6a4ba90c8
Gerrit-PatchSet: 2
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Niedzielski <sniedziel...@wikimedia.org>
Gerrit-Reviewer: BearND <bsitzm...@wikimedia.org>
Gerrit-Reviewer: Brion VIBBER <br...@wikimedia.org>
Gerrit-Reviewer: Dbrant <dbr...@wikimedia.org>
Gerrit-Reviewer: Mholloway <mhollo...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to