Mercari uses microservices with each service running in its own container and namespace on a centralized Google Kubernetes Engine cluster. A microservices platform team provides tools to automate the setup and management of microservices through their development lifecycle. These include starter kits for initial setup, Spinnaker for continuous delivery, and monitoring tools for post-release support. The platform aims to simplify microservices for developers while handling the underlying complexity.
Microservice Development Using TelepresenceVishal Banthia
Telepresence allows developers to run microservices locally while still connecting to a Kubernetes cluster. It creates a bi-directional tunnel between the local development environment and the cluster. This allows the local process to access environment variables and DNS from the cluster pod. As a demo, the presenter shows running a front-end service locally using Telepresence while it connects to backend services in the cluster. However, Telepresence is still maturing and has some limitations like only supporting swapping one service and potential network and DNS issues.
Vishal talks about Mercari's Software Engineering in Test (SET) team and their work on improving productivity. The SET team provides tools and environments to help engineers and QA test efficiently. They work on local development environments, continuous integration, QA environments, and device farms. Some current focuses are improving tools for microservices development and mobile app testing given the growing code bases. The presentation encourages the audience to join the SET team if interested in these challenges.
This document summarizes Vishal Banthia's presentation on achieving reliable mobile test automation. It discusses the difficulties of flaky tests and inconsistent test execution environments. It then presents solutions like capturing comprehensive test reports with screenshots, videos, and logs to better diagnose flaky tests. It also recommends leveraging cloud services for scalable and accessible test execution. The presentation demonstrates these concepts through tools like Bitrise, OpenSTF, and CircleCI used in Mercari's mobile test automation pipeline.
1. マスター タイトルの書式設定
• マスター テキストの書式設定
Vishal
Android Test Night #1
Android e2e Testing at Mercari
2. マスター タイトルの書式設定
• マスター テキストの書式設定 Software Engineer in Test
Case Study (Mobile Automation)
SWET (past)
Core Member
Vishal Banthia @vbanthia @vbanthia_
4. マスター タイトルの書式設定
• マスター テキストの書式設定
In June, we had a major update in mercari US app.
mercari US app
Native Native Native React-Native
Not Just UI Changes, but complete architecture shift
5. マスター タイトルの書式設定
• マスター テキストの書式設定• While deciding new architecture, easy testability was always a priority
• One of the reason to use dependency-injection pattern is above and
we use Dagger2 for this. With this, mocking objects is pretty easy and
can increase UnitTest coverage
• We always try to keep low-level UnitTest coverage high following Test
Pyramid Principle
New Architecture
Note: More technical details can be read here (http://tech.mercari.com/entry/2017/07/19/123443)
6. マスター タイトルの書式設定
• マスター テキストの書式設定
But UITesting is always challenging
and was so for US
7. マスター タイトルの書式設定
• マスター テキストの書式設定
• After joining mercari, this was my first big project. Following objectives
were in mind:
• Adding new test scenarios and maintaining old ones should be painless
• High reliability so that flaky tests are not wasting developers and QA
engineers time
• Scalable architecture to minimize test run time
• Tests should run on real devices instead of emulators
• Minimum operational cost for infrastructure and CI management
• Test reports should have all the important information required for
debugging if test fails
• Super portable, should be easy to copy for other products
Android UITesting
8. マスター タイトルの書式設定
• マスター テキストの書式設定
UITest High Level Architecture
Ruby
RSpec
AppiumKit
Appium
UIAutomator2
Test Script Automation tool App Under Test
(MercariKit)
9. マスター タイトルの書式設定
• マスター テキストの書式設定
appium_kit (Ruby Library)
A simple ruby gem which extends famous selenium testing
ruby library such as Capybara, SitePrism for Appium
10. マスター タイトルの書式設定
• マスター テキストの書式設定
Selenium Web Testing in Ruby
selenium-webdriver
capybara watir
site_prism page-object
rspec cucumber test-unit
11. マスター タイトルの書式設定
• マスター テキストの書式設定
Quick Overview
● selenium-webdriver is the ruby binding for Selenium
● capybara provides DSL to help writing web tests easily
● page-object design pattern helps in maintaining test easily
● site_prism provides DSL to write pages easily
These libraries have proved themselves for so long, we wanted to use something which we can
rely and can also use same stack for web-testing that is why, simple appium_kit gem.
14. マスター タイトルの書式設定
• マスター テキストの書式設定
Overview
• Pages
• All the application related information such as ids, static text etc are tied
with Page Object. Test will talk to application using either helpers or
pages. Test can not access application directly.
• 1 Activity ~= 1 Page
• Helpers
• Helper binds pages together
• Utils
• Utilities such as RandomGen, AdbUtil etc. Not directly related to AUT
• Configs
• Static testdata
17. マスター タイトルの書式設定
• マスター テキストの書式設定
Dockerizing UITests
• Dockerizing tests helps in sandboxing environment.
• Deploying / Running tests becomes very easy. Do not
need to worry about run environment
• Many more benefits …
More Details: https://github.com/vbanthia/appium-docker-demo
21. マスター タイトルの書式設定
• マスター テキストの書式設定
Mercari Android CI (Tools & Service)
• Bitrise: To build application
• Google Cloud Storage: To store built apks
• Google Container Registry: To store docker images
• OpenSTF: For Android Device Farm
• CircleCI 2.0: Build docker image & run tests in parallel containers
• CircleCI Artifacts: To store test reports
• AWS Lambda: To trigger nightly builds
• Slack: Notification & manual triggers
22. マスター タイトルの書式設定
• マスター テキストの書式設定
Application Build Pipeline
Developer Github Bitrise GCS
1. Developer pushes code to Github
2. Github triggers Bitrise
3. Bitrise build app and upload it to GCS
This make sure that we have all the apks
in GCS with their build number linked
23. マスター タイトルの書式設定
• マスター テキストの書式設定
UITest docker image build pipeline
Developer Github CircleCI GCR
1. Developer pushes code to Github
2. Github triggers CircleCI
3. CircleCI build docker image for uitest
and pushed it to google container
registry
This make sure that we have all the
docker image of latest test code any time
27. マスター タイトルの書式設定
• マスター テキストの書式設定
UITests Pipeline
CircleCI Job
AWS Lambda
Slack
Connect remote deviceDownload apk
Run UITests
(device1)
Run UITests
(device2)
Run UITests
(device3)
Test reports
CircleCI Artifact
28. マスター タイトルの書式設定
• マスター テキストの書式設定
Benefits
• Everything is on cloud, we only have devices connected to
mac-mini which only needs adb to work
• Always ready to run
• No need to worry about on-premise infra (Jenkins etc...)
34. マスター タイトルの書式設定
• マスター テキストの書式設定
RSpec HTML Formatter2
● https://github.com/vbanthia/rspec_html_formatter2
● Features:
o Beautiful html report using Bootstrap css/js
o Supports screenshots & screenrecords