Skip to content

[e2e] improve e2e iOS tests#1649

Merged
dratwas merged 4 commits intodevelopfrom
fix/e2e-improvements
Feb 18, 2020
Merged

[e2e] improve e2e iOS tests#1649
dratwas merged 4 commits intodevelopfrom
fix/e2e-improvements

Conversation

@dratwas
Copy link
Copy Markdown
Contributor

@dratwas dratwas commented Dec 4, 2019

I think we have a few redundant actions in test:e2e:ios:local, they increase the time of build steps.

the flow of script to run local e2e tests for iOS:
"test:e2e:ios:local": "yarn test:e2e:build-app:ios && yarn test:e2e:install-app:ios && TEST_RN_PLATFORM=ios yarn device-tests:local"

  • yarn test:e2e:build-app:ios does :
  1. Build the app by the react-native run-ios script with --no-packager flag and --configuration Release (it builds JS bundle and copy it to the app in Build Phases script)
  2. Build the JS bundle by react-native bundle one more time and copy it to the app (it is already there from step 1)
  3. Run cd ./ios/build/gutenberg/Build/Products/Release-iphonesimulator && zip -r $WORK_DIR/ios/Gutenberg.app.zip gutenberg.app it is needed only for CI to upload the app to the sauce labs (this scripts from package.json is not used in ci config https://github.com/wordpress-mobile/gutenberg-mobile/blob/develop/.circleci/config.yml#L137)
  • yarn test:e2e:install-app:ios runs only yarn test:e2e:build-app:ios under the hood, so basically runs steps 1, 2, 3 one more time.

  • TEST_RN_PLATFORM=ios yarn device-tests:local runs appium tests

I think we could make it much faster by removing points 2 and 3 from yarn test:e2e:build-app:ios and remove the yarn test:e2e:install-app:ios

Since we use caching of app builds on CI but we want to build JS bundle each time, I also set the flag SKIP_BUNDLING in CI config to skip creating of JS bundle during the build step. JS bundle is created in the next step

To test:

  1. Local tests
  • remove ios/build directory (just to be sure)
  • run yarn test:e2e:ios:local
  • the app should be built and all tests should pass
  1. Green CI

Update release notes:

  • If there are user facing changes, I have added an item to RELEASE-NOTES.txt.

@dratwas dratwas changed the title [e2e] improve e2e tests [e2e] improve e2e iOS tests Dec 4, 2019
@dratwas dratwas marked this pull request as ready for review December 4, 2019 17:37
@dratwas dratwas requested review from Tug and hypest December 5, 2019 08:46
@hypest hypest requested a review from mchowning December 6, 2019 14:40
@SergioEstevao
Copy link
Copy Markdown
Contributor

@dratwas thanks for this! Do you mind to update with the latest develop? We just merged some changes that upgrade the version of Appium and some configuration and it will good to make sure these changes play well together.

@SergioEstevao SergioEstevao self-requested a review December 10, 2019 14:57
@dratwas
Copy link
Copy Markdown
Contributor Author

dratwas commented Feb 13, 2020

Hi @SergioEstevao sorry for the delay. Today I checked all my PRs and found this one. I updated it with the develop branch and should be still valid :) Could you please review it one more time?

@SergioEstevao
Copy link
Copy Markdown
Contributor

@dratwas Because we now are using CocodPods for the build process should we add: yarn preios to yarn test:e2e:build-app:ios to make sure we have the right pods and workspace setup?

@dratwas
Copy link
Copy Markdown
Contributor Author

dratwas commented Feb 17, 2020

Yes! You're right it should be run before. Let me add it :)

Btw. WDYT about changing the preios to

cd ios && (bundle check --path=vendor/bundle > /dev/null || bundle install) && bundle exec pod install --repo-update

to use the --repo-update flag instead of running bundle exec pod repo update

Edit: Maybe we could do it even better. Change the yarn test:e2e:build-app:ios

yarn ios --configuration Release --no-packager

and the preios will be run out of the box

Copy link
Copy Markdown
Contributor

@SergioEstevao SergioEstevao left a comment

Choose a reason for hiding this comment

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

Great work! Thanks for this!

@dratwas dratwas merged commit 6c67d47 into develop Feb 18, 2020
@SergioEstevao SergioEstevao deleted the fix/e2e-improvements branch February 18, 2020 09:46
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.

2 participants