4. About Mercari
Mercari, Inc. is a Japanese e-commerce company that operates a mobile marketplace app. The company was
founded in 2013 by Shintaro Yamada.
Mercari's platform is based on a simple, user-friendly interface that allows users to easily list and sell their items.
The app features a number of tools and features that make it easy to manage and track sales, including the ability
to set prices, track shipping, and handle payment and refunds. Additionally, Mercari offers a number of services to
help users with their sales, such as advice on pricing and shipping, and assistance with disputes and refunds.
5. OBJECTIVE
The objective of this project was to research the possible scope of E2E testing that
needs to be added to merwork, weight different routes of implementations along
with security considerations and write a design doc.
After this using the design doc E2E Testing Framework is integrated to Merwork.
This includes all the build system, boilerplate and helper code.
6. Languages and Technologies Used
● Go : Backend Language
● Bash : Scripting Language
● Make : Part of build toolchain
● NodeJS : Web BFF Language
● TestDeck: Mercari’s E2E Testing Framework
● Kubernetes: Deployment environment
8. Design Overview
● When a PR is created, that is when the E2E flow will be initiated.
● Using a Bash script we would identify the changed microservices, and build their docker images which will be
pushed to GCR (Google Container Registry).
● Use a label system to determine which microservices are to be deployed in prrc environment, and using this
Dynamic Service Routing headers are given to the binary.
● Then when we add label to initiate the E2E testing, Build and Deploy tester service to dev environment using
Spinnaker.
● Tester Service Initiates and begin tests after making sure PRRC pods are up
10. Security Consideration
If we ran the tester on github itself, the process can be simplified a lot, but that’s not
safe as then we’ll have to provide some sort of access key in github so that it can
connect to dev kubernetes cluster.
It was deemed unsafe as github can be compromised due to usage of other tools,
and thus the tester also has to be deployed in kubernetes cluster
11. TestDeck Overview
Testdeck is a framework for integration, end-to-end (E2E), and security testing of gRPC
microservices written in Golang and deployed in Google Kubernetes Engine (GKE). Its features
include:
● Integration/E2E testing for gRPC and HTTP endpoints
● Fuzz testing
● Injection of malicious payloads (similar to Burp Suite’s Intruder)
● Utility methods for gRPC/HTTP requests
12. TestDeck Design
● The microservice is deployed into a
Kubernetes pod using Spinnaker
● Tests for the microservice are deployed to a
different pod, also using Spinnaker. The tests
run as a Kubernetes job
● Test results are saved to a database
● The team receives a Slack notification with
Pass or Fail, and a link to the full test run report
● The team can view the full test run report on
the dashboard (which reads test result data
from the database)
13. Dynamic Service Routing (DSR)
Dynamic Service Routing (DSR) is a feature that can route the traffic between
microservices dynamically. This helps the tester service to access the PRRC pods
instead of actual dev pods since they are under test.
14. CONCLUSION
TestDeck, Mercari’s Inhouse E2E testing framework was successfully integrated
into Merwork MonoRepo with extensible testcasex and a small library to use for
ease of writing new test cases.
All the setup and initiation logic of E2E tests was nicely abstracted so that test
writers don’t have to worry about that. The project was successfully designed and
implemented and peer reviewed with Merwork team members.