status-im / status-mobile

a free (libre) open source, mobile OS for Ethereum
https://status.app
Mozilla Public License 2.0
3.91k stars 984 forks source link

Solve issue with Nightly E2E tests ignoring Sauce Labs limits #16440

Closed jakubgs closed 1 year ago

jakubgs commented 1 year ago

Currently we have only 1 build session with 8 devices(which is silly slow), and this limit is enforced simply by Jenkins job config:

image

https://ci.status.im/job/status-mobile/job/e2e/job/status-app-prs/configure

This works well enough for our development instance of Jenkins at https://ci.status.im/, but it does not take into account our separate release instance which runs mobile nightly builds which also trigger end-to-end tests, except no limit is enforced due to it being a separate Jenkins instance.

This result is that the E2E job fails with:

ERROR medium/test_activity_center.py::TestActivityMultipleDevicePR::test_navigation_jump_to@new_one_3
  - AttributeError: '_asyncio.Future' object has no attribute 'session_id'

https://ci.status.im/job/status-mobile/job/e2e/job/status-app-prs-rerun/2750/console

There are at least two possible solutions:

  1. Run E2E for nightly on the devel CI by fetching nightly artifacts directly from DigitalOcean bucket.
  2. Run E2E for nightly on the release CI but implement some kind of global session locking mechanism.

The former is simpler, but does require extra logic to find the latest nightly build. The latter is the more correct solution, but would require finding or developing some kind of locking API to use in both jobs. One possibility would be to use Consul API locking mechanism in some kind of script.

yakimant commented 1 year ago

@jakubgs, how can I find a build, which was running at the same time to https://ci.status.im/job/status-mobile/job/e2e/job/status-app-prs-rerun/2750?

jakubgs commented 1 year ago

Good question actually. I actually can't find a matching nightly e2e:

So maybe this one failed for some other reason and the nightly e2e is a red herring in that case.

yakimant commented 1 year ago

Yes, it failed because of a different reason:

image

nightly e2e usually interfere the pr e2e when run in working hours. For example due to nightly build issue fixed in the morning

yakimant commented 1 year ago

For TLDR - jump to Proposal. Internsion of this comment is to present rather than read.

UPDATE 1: Applied changes after review with @jakubgs

Options

Option 1: Switch e2e/nightly from ci.infra to ci. Keep using platform/android-e2e results from ci.infra.

Option 2: Switch e2e/nightly from ci.infra to ci. Use results from platform/android-e2e from ci.

Option 3: Same as 2, but run platform/android-e2e build inside e2e/nightly run with build step.

Option 4: Same as 2, but add both platform/android-e2e and e2e/nightly as build dependencies to meta runner, eg e2e-nightly

Build dependency

Solution

Option 2 + Option 4 combined:

Proposal

Things to decide

Future

jakubgs commented 1 year ago

I think think this is mostly correct except for:

Good research.

yakimant commented 1 year ago

@jakubgs I agree, ammended the proposal

yakimant commented 1 year ago

@churik, please read the proposal part and let's review tomorrow. The main part if you are ok to switch nightly e2e from nightly build type to e2e build type. The diff is here: https://docs.google.com/spreadsheets/d/1vigaW2yFpQoS5xq-p1pN_dx2q_O4hfCVK5awrl9snXg/edit#gid=143162119

churik commented 1 year ago

@jakubgs @yakimant thank you for the detailed explanation! It is OK from e2e perspective to change type of the build, we can use this approach - there are no dependencies on the type of the build currently.

yakimant commented 1 year ago

Still need testing and cleanup, reopening.

yakimant commented 1 year ago

@churik, nightly e2e are running on ci.status.im now, please have a look: https://ci.status.im/job/status-mobile/job/e2e-nightly/

I'm going to cleanup e2e from ci.infra.status.im now.

churik commented 1 year ago

yes, thank you for your work!!!

yakimant commented 1 year ago

Removed:

Backup is in restic for 30 days just in case.

yakimant commented 1 year ago

Both ci.infra/nightly and ci/e2e-nightly work well. e2e-nightly and regular e2e will queue for saucelabs resources now.

yakimant commented 1 year ago

Another issue appeared while discussing the nightlies, I created a ticket for it: https://github.com/status-im/status-mobile/issues/16966