You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iceraven-browser/app/src/test/java/org/mozilla/fenix/ext
Michael Comella cc380695b8 No issue: remove unnecessary robolectric annotations.
Theoretically, this should marginally decrease the duration of our unit
test suite. In my testing, for 1 iteration each (i.e. noise is very
possible), the duration changed from 9m 32s to 8m 21s – a 71s
improvement.

---

To identify tests that were running with robolectric that didn't need to
be, I removed the @RunWith(FenixRobo... from all relevant files:
    sed -i '' "/@RunWith(FenixRobolectric/d" app/src/test/**/*.kt

I ran the tests and discovered which ones failed from the Classes tab of
the index.html test result file. Something like:
    tests = document.querySelectorAll('table')[3].querySelectorAll('tr');
    failureElements = tests.querySelectorAll('.failures');
    // TODO: extract the test names

Then I copied these results to a text file and compared them to all the
files that had robolectric test runners to figure out which ones still
pass:
    comm -1 -2 failures.txt changed_files.txt > robolectric_not_needed.txt

And undid the changes to the failing files:
    for i in $(cat robolectric_not_needed.txt); do git checkout $i; done

Then I removed the import statements on those files:
    for i in $(cut changed_files.txt); do sed -i '' "/import.*RunWith/d" $i; done
    for i in $(cat changed_files.txt); do sed -i '' "/import.*RobolectricTestRunner/d" $i; done
3 years ago
..
ActivityTest.kt Target Android 11 3 years ago
AtomicIntegerTest.kt 15278 detekt rule runblocking (#15942) 4 years ago
BookmarkNodeTest.kt Reuse helper functions in bookmark tests 3 years ago
BrowserIconsTest.kt For #9605: replace unit test runners with FenixRobolectricTestRunner. 4 years ago
BrowserStateTest.kt For #20402 - Re-enable "in progress media tab" 3 years ago
ConnectivityManagerTest.kt For #9605: replace unit test runners with FenixRobolectricTestRunner. 4 years ago
ContextTest.kt Add tests for ContextKt (#11824) 4 years ago
DownloadItemKtTest.kt Fix openFile breaking changes 3 years ago
DrawableTest.kt Fixes #9832 - Change targetSdkVersion to Android 10 (#11014) 4 years ago
FragmentTest.kt For #12457 - Add MockK matcher for nav directions (#12262) 4 years ago
ImageButtonTest.kt Add tests for ext package (#11334) 4 years ago
ListTest.kt No issue: remove unnecessary robolectric annotations. 3 years ago
LogTest.kt Simplify build variants to just: debug, nightly, beta and release. 4 years ago
MockKMatcherScope.kt For #2486 - Adds Recently Closed Tabs 4 years ago
NavControllerTest.kt Issue #16330: Remove remaining usages of Sentry.capture 3 years ago
SharedPreferences.kt Add license header to ext tests (#8130) 4 years ago
StringTest.kt For #12565: Don't pass contest to SortingStrategy 4 years ago
TabCollectionTest.kt Run ktlintFormat to adapt to latest formatting rules. 3 years ago
ViewTest.kt Update Robolectric and mockk. 3 years ago