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: Nowdays CI frequently failing on API level 24, and 33. #3659

Merged
merged 4 commits into from
Jan 14, 2024
Merged

Conversation

MohitMaliFtechiz
Copy link
Collaborator

@MohitMaliFtechiz MohitMaliFtechiz commented Jan 8, 2024

Fixes #3627

  • Addressed an issue with the SaveSearchToRecentsTest test, which occasionally failed. The primary cause of this was the recent modification to save the RecentSearch on a background thread using coroutines. In some cases, the test validates the output before the coroutine completes its execution. Consequently, we have adjusted our test case to properly wait for the coroutine to finish its work before validating the output.
  • To fix ZimHostFragment test on API level 33 we have enabled the wifi programmatically on the emulator since it is by default not enabled on the emulator of API level 33.
  • Improved test case for showing "Wifi connection dialog".
  • Improved the permission.
  • Removed the unnecessary logs from CI.

@MohitMaliFtechiz MohitMaliFtechiz marked this pull request as draft January 8, 2024 12:45
Copy link

codecov bot commented Jan 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f8647de) 48.59% compared to head (adeabcf) 48.58%.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3659      +/-   ##
============================================
- Coverage     48.59%   48.58%   -0.01%     
  Complexity     1090     1090              
============================================
  Files           285      285              
  Lines         10588    10588              
  Branches       1418     1418              
============================================
- Hits           5145     5144       -1     
- Misses         4599     4600       +1     
  Partials        844      844              

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

@MohitMaliFtechiz
Copy link
Collaborator Author

So here is the main reason for test failure, The emulator does not have an active wifi connection that is why "Wifi connection" dialog is not displaying, These logs confirm this:

01-09 13:05:29.596 16351 16351 E ZIM_HOST_FRAGMENT: startStopServer: startHotspotManuallyDialog

See workflow: https://github.com/kiwix/kiwix-android/actions/runs/7461002166/job/20300232710?pr=3659
For testing we have added these comments: 2fe3f2f

@MohitMaliFtechiz MohitMaliFtechiz marked this pull request as ready for review January 10, 2024 05:59
@MohitMaliFtechiz
Copy link
Collaborator Author

@gouri-panda This PR is ready for review. It fixes the CI which is often failing.

gouri-panda
gouri-panda previously approved these changes Jan 11, 2024
Copy link
Collaborator

@gouri-panda gouri-panda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MohitMaliFtechiz Thanks! This is really helpful!

@kelson42
Copy link
Collaborator

@MohitMaliDeveloper It failed!!! Please see my comment on the #android chat and reduce the level of verbosity to keep only the essential

* Addressed an issue with the `SaveSearchToRecentsTest` test, which occasionally failed. The primary cause of this was the recent modification to save the `RecentSearch` on a background thread using `coroutines`. In some cases, the test was validating the output before the coroutine completed its execution. Consequently, we have adjusted our test case to properly wait for the coroutine to finish its work before validating the output.
* Improved the permission.
* Enabled wifi programmatically in emulator.
* Improved test case for showing "Wifi connection dialog".
@MohitMaliFtechiz
Copy link
Collaborator Author

@kelson42 I have reduced the verbosity level and now it is showing the essential logs, and now CI has been passed three times in a row without any error.

@kelson42 kelson42 merged commit 3f19f55 into main Jan 14, 2024
9 checks passed
@kelson42 kelson42 deleted the Fix#3627 branch January 14, 2024 15:13
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.

Nowdays CI frequently failing on API level 24, and 33
4 participants