Skip to content

[UI tests] Run canaries on a PR and optionally full suite#2137

Merged
Stojdza merged 15 commits intodevelopfrom
try/e2e/optional-runs
May 21, 2020
Merged

[UI tests] Run canaries on a PR and optionally full suite#2137
Stojdza merged 15 commits intodevelopfrom
try/e2e/optional-runs

Conversation

@Stojdza
Copy link
Copy Markdown
Contributor

@Stojdza Stojdza commented Apr 8, 2020

In this PR I added a couple of options to make test runs more stable.

  1. Run only a subset of tests (canaries) on every PR - this will shorten execution time for UI tests jobs in CircleCI. All tests marked with @canary will be part of these. Name of these jobs are Test Android on Device - Canaries and Test iOS on Device - Canaries and they are mandatory for every PR. I marked three tests with the @canary and we can change that and choose other tests if needed. @hypest once this PR is approved and ready to merge, we should change required jobs for develop branch - canaries should be marked as required and Test Android/iOS on Device should be unchecked.
  2. Optionally run the full suite of UI tests - If necessary, you can run the full suite. A comment will be posted on a PR, see example below, which will lead to CircleCI workflow where you can start Android and iOS jobs. I did this with peril-settings, similar to what we are using in other mobile projects. EDIT: Full suite will run every day against develop, per schedule [UI tests] Schedule runs for full UI tests suite #2115
  3. Increase CircleCI timeout - In the past, we were seeing error Too long with no output (exceeded 10m0s): context deadline exceeded. This is happening because some tests are taking too long (more than 10m) without any output during execution, and CircleCI job will fail. I increased the timeout to 20m to reduce noise.

To test:

  • Look at the jobs in this PR, compare times.
  • Optionally, add some dummy commit to trigger jobs. Open the link from the comment and trigger full suite jobs. Does it work as expected?

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@Stojdza Stojdza self-assigned this Apr 8, 2020
@Stojdza Stojdza added the Testing Anything related to automated tests label Apr 8, 2020
@peril-wordpress-mobile
Copy link
Copy Markdown

peril-wordpress-mobile bot commented Apr 8, 2020

Wanna run full suite of Android and iOS UI tests? Click here and 'Approve' CI job!

@Stojdza Stojdza changed the title [UI tests] Hold full suite execution while it's not approved [UI tests] Run canaries on a PR and optionally full suite Apr 13, 2020
@Stojdza Stojdza marked this pull request as ready for review April 13, 2020 16:29
@rachelmcr
Copy link
Copy Markdown
Contributor

@Stojdza There's a lot of repetition between the canary and full jobs in the CircleCI config. What do you think of using a more DRY approach with a single device test job per platform, using a parameter to determine whether it's a full run or just canaries?

That way, for example, we could have a single android-device-checks job in the config and just change the parameter in the workflows, instead of android-device-checks and android-device-checks-canary where most of the steps are the same.

(Sorry for the delay looking at this; I didn't realize until recently that it was still open and waiting for review.)

@rachelmcr
Copy link
Copy Markdown
Contributor

Also, do you know why ci/circleci: Test Android on Device and ci/circleci: Test iOS on Device still show up as expected checks on this PR? My guess is because they're marked as required in our branch protection rules, but I wanted to point that out in case there's something else involved. (We'll also want to make sure to update the branch protection rules to remove that required check and switch to the Canaries as the required check, I guess?)

@Stojdza
Copy link
Copy Markdown
Contributor Author

Stojdza commented May 12, 2020

Thanks for looking into this @rachelmcr. It's never too late 😄

What do you think of using a more DRY approach with a single device test job per platform, using a parameter to determine whether it's a full run or just canaries?

I agree! I know back then it was easier just to copy and paste, and test jobs. Later I forgot to solve it properly. I can take a look at it later this week if that works?

Also, do you know why ci/circleci: Test Android on Device and ci/circleci: Test iOS on Device still show up as expected checks on this PR?

Yes. If you take a look here, under Require status checks to pass before merging, you'll notice that Test Android on Device - Canaries and Test iOS on Device - Canaries are not checked/mandatory, and Test Android on Device and Test iOS on Device are mandatory. While I tested these changes, @hypest changed these settings for me (since I didn't have permissions) and it looked as expected. That's why I put this notice in the description:

@hypest once this PR is approved and ready to merge, we should change required jobs for develop branch - canaries should be marked as required and Test Android/iOS on Device should be unchecked.

@rachelmcr
Copy link
Copy Markdown
Contributor

I can take a look at it later this week if that works?

Works for me, thank you! Let me know if you can't fit it in with the other things you're working on now and I can take a look.

That's why I put this notice in the description

Ah yeah, thanks for confirming! I saw that the first time I read the description but overlooked it when I reread it for this review. :)

@Stojdza
Copy link
Copy Markdown
Contributor Author

Stojdza commented May 19, 2020

@rachelmcr I added agreed changes. Let me know what do you think. Tests are running as expected - only three tests as canaries and full suite upon approval.

Copy link
Copy Markdown
Contributor

@rachelmcr rachelmcr left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks for making that change. :shipit:

@Stojdza
Copy link
Copy Markdown
Contributor Author

Stojdza commented May 21, 2020

@maxme @hypest we should sync on this:

once this PR is approved and ready to merge, we should change required jobs for develop branch - canaries should be marked as required and Test Android/iOS on Device should be unchecked.

Once you're ready to change required jobs we can merge this PR.

@hypest
Copy link
Copy Markdown
Contributor

hypest commented May 21, 2020

Thanks for the ping @Stojdza, I made the change and now PRs against develop will only require the Canaries, not the full device testsuite.

Also, can you update the PR description to mention that the full suite will indeed run anyway, based on a schedule? Thanks!

@Stojdza Stojdza merged commit c38c98d into develop May 21, 2020
@Stojdza Stojdza deleted the try/e2e/optional-runs branch May 21, 2020 09:47
@Stojdza
Copy link
Copy Markdown
Contributor Author

Stojdza commented May 21, 2020

Thanks @hypest! I updated PR description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Testing Anything related to automated tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants