Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the CI on api level 33 and reduce the CI timing. #3758

Merged
merged 12 commits into from
Mar 20, 2024
Merged

Conversation

MohitMaliFtechiz
Copy link
Collaborator

@MohitMaliFtechiz MohitMaliFtechiz commented Mar 18, 2024

Fixes #2096

  • Improved the deleting of zim files in localibrary, since we already paused for a second to check if the delete dialog is displayed or not, and again we are waiting before clicking on it. The same issue for while clicking on the PlayStoreRestrictionDialogTest where we are first waiting for the dialog to visible and then waiting for clicking on it. So we have removed the second wait since this dialog is displaying in both test cases.

  • Improved the TopLevelDestinationTest. Because we were testing the drawer options fragments (Settings, Bookmarks, etc) from the download screen and when we pressed the back button it came to the download screen and refreshed its data due to this our next functionality had to wait to finish this. Now we are testing all the navigation screens from the LocalLibraryScreen which makes this test case faster.

  • Improved ObjectBoxToLibkiwixMigratorTest for clearing the previously saved bookmarks.

  • Improved the ObjectBoxToLibkiwixMigratorTest test case, as it occasionally crashes during testing on API level 33 due to emulator lag on google_apis. The extensive data migration exacerbates the emulator's performance issues, leading to crashes during subsequent test processes. To address this issue, we have reduced the migration volume from 10K to 1K. Also, improved the ObjectBoxToLibkiwixMigratorTest.

  • Refresh the data before checking the loaded data in DownloadTest.

  • Increasing the Retry count for loading data and downloading starts to properly work with a low internet connection.

  • Improved our ZimHostFragmentTest test to boost the test case speed It was running in 2 minutes, but after this change, it now completes in 27 seconds.

  • We are removing the ZimHostFragment test from the API level 33 because, most of the time, the emulator does not have WiFi service. Running this test on this emulator is not worthwhile, as we are testing this code on WiFi. /~https://github.com/kiwix/kiwix-android/actions/runs/8265444407/job/22611097563?pr=3747#step:6:1980.

  • Restricting the testDocumentProviderContentQuery and testExtractDocumentId test cases on API level 33. Since In this version, numerous security updates have been included, preventing us from modifying the default behavior of ContentResolver.

  • Improved the SearchFragmentTest to make it fast.

  • Improved DownloadTest and InitialDownloadTest which sometimes fail due to the file_management_no_files view not error.

  • Improved ObjectBoxToLibkiwixMigratorTest which sometimes crashed due to the process crashing.

  • Disabling animation on emulator since espresso sometimes giving error due to animation(It reduced the emulator boot time) /~https://github.com/kiwix/kiwix-android/actions/runs/8347337553/job/22846729987?pr=3758#step:5:47052.

  • We are not adding the sharing APK functionality in our test cases since after a failure the second run does not receive any test cases to run so that's why we are not introducing the sharing apk functionality. But our aim to make the CI faster is achieved since now CI is stable.

These changes makes the stable and faster. Before test cases were completed on API level 33(Android 13) in 18 Minutes and 57 seconds and by doing the above changes now it is completed in 15 minutes on the same API level so almost 4 minutes have been reduced.

@MohitMaliFtechiz MohitMaliFtechiz marked this pull request as draft March 18, 2024 16:51
@MohitMaliFtechiz MohitMaliFtechiz changed the title Fixed the CI on api level 33 and reducve the CI timing. Fixed the CI on api level 33 and reduce the CI timing. Mar 18, 2024
@MohitMaliFtechiz MohitMaliFtechiz force-pushed the Issue#2096 branch 2 times, most recently from 0db5092 to ff5b09d Compare March 19, 2024 17:14
…ause for a second to check if the delete dialog is displayed or not, and again we are waiting before clicking on it. The same issue for while clicking on the PlayStoreRestrictionDialogTest where we are first waiting for the dialog to visible and then waiting for clicking on it. So we have removed the second wait since this dialog is displaying in both test cases.

* Improved the TopLevelDestinationTest. Because we were testing the drawer options fragments (Settings, Bookmarks etc) from the download screen and when we pressed the back button it came to the download screen and refreshed its data due to this our next functionality had to wait to finish this. Now we are testing all the navigation screens from the LocalLibraryScreen which makes this test case faster.
…ved bookmarks.

* Refresh the data before checking the loaded data in DownloadTest.
* Increasing the Retry count for loading data and downloading start to properly work with low internet connection.
… It was running in 2 minutes, but after this change, it now completes in 27 seconds.
…use, most of the time, the emulator does not have WiFi service. Running this test on this emulator is not worthwhile, as we are testing this code on WiFi.
…nally crashes during testing on API level 33 due to emulator lag on google_apis. The extensive data migration exacerbates the emulator's performance issues, leading to crashes during subsequent test processes. To address this issue, we have reduced the migration volume from 10K to 1K. Also, improved the ObjectBoxToLibkiwixMigratorTest.
…cumentId` test cases on API level 33. Since In this version, numerous security updates have been included, preventing us from modifying the default behavior of ContentResolver.
…ling due to `file_management_no_files` view not error.

* Improved ObjectBoxToLibkiwixMigratorTest which sometime crashed due to process crashing.
Copy link

codecov bot commented Mar 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 53.07%. Comparing base (d4a3db1) to head (c120caa).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3758      +/-   ##
============================================
+ Coverage     52.12%   53.07%   +0.95%     
- Complexity     1272     1292      +20     
============================================
  Files           292      292              
  Lines         10988    10988              
  Branches       1457     1457              
============================================
+ Hits           5727     5832     +105     
+ Misses         4312     4191     -121     
- Partials        949      965      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MohitMaliFtechiz MohitMaliFtechiz marked this pull request as ready for review March 20, 2024 08:34
@MohitMaliFtechiz
Copy link
Collaborator Author

@kelson42, @gouri-panda This PR is ready for review.

@kelson42 kelson42 merged commit e220708 into main Mar 20, 2024
10 checks passed
@kelson42 kelson42 deleted the Issue#2096 branch March 20, 2024 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Speed up Automated Tests by sharing apks
3 participants