Lime Accelerates Testing and Code Iteration in End-to-end Environments with Crafting
“Our engineers can preview their changes in the sandbox instantly and run integration with any version of the backend. It helps us iterate quickly and ship faster.”
Lime is a leading company in the micro-mobility market that offers electric scooters and bikes in cities worldwide including London, Paris, and Sydney. Riders unlock scooters and bikes using the Lime mobile app.
Using AWS and scalable infrastructure like Kubernetes, Lime is able to support more than 200 thousand vehicles, for more than 100 million yearly trips. Lime engineers must create numerous backend services and mobile apps for iOS and Android in order to produce this product. The backend services are managed by many teams working on different sections of the system and use multiple languages and frameworks, such as Ruby, Kotlin, Go, and Python.
The Challenges
To support a fast growing business, engineers at Lime must deliver highest productivity and velocity. “We need to let our engineers test their code end-to-end as they code, so that they can fix the bugs quickly.”, said Jianfeng Hu, Head of Infrastructure at Lime. “For our app, with many backend services and IoT stuff, it’s impossible to run the whole flow just on laptops.” However, as the team grows, testing on a cloud-based shared environment like staging quickly became a bottleneck. “Engineers need their own dedicated environments to be more effective”, he continued.
In addition, the testing environments are not developer friendly. They mainly include deployable artifacts and lack adequate development tools. As a result, it’s hard to make code changes there. When testing reveals a coding issue, even a simple one-line change would normally require the engineer to change the code locally, push the change to GitHub, wait for the rebuild and redeploy, and then test again. This significantly lowered the iteration speed and reduced velocity.
The Solution
We need several cloud services running in their own containers for our engineers to code and test end-to-end. Crafting meets our need perfectly to be the standard dev environment that supports more than a single online dev machine, unlike other solutions.
After evaluating a few solutions and attempting to build a version internally, Lime adopted Crafting as the standard PR (Pull Request) preview environment for end-to-end preview and testing. Specifically, engineers at Lime create sandboxes on-demand based on the version of their code in a PR by just clicking a link that is automatically posted to their PR on GitHub. “Our engineers can preview their changes in the sandbox instantly and run integration with any version of the backend by simply scanning a QR code from their App.”
Beyond just running the code for testing, Lime also uses Crafting to manage test data. With the built-in data snapshot functionality, all the test data are quickly loaded in as a snapshot into the environment for testing. It used to take over 15 minutes for the setup script to fill. Combining it with the saving from the in-workspace snapshots for required libraries, Lime achieves a 72% speedup for launching a new end-to-end environment.
Moreover, it’s much faster for fixing bugs for engineers at Lime. Instead of doing the traditional 3-step process of local coding, submitting a PR, and waiting for redeployment, “I can directly code in my sandbox and retest it there right away. It has everything I need”, said Marc Lo, an engineering lead at Lime. Directly coding on Crafting speeds up 87% for the iteration cycle of testing a new change.
In addition to previewing individual code changes, Lime engineers naturally developed more ways of leveraging the easy-to-manage, standardized dev environments, made available at their fingertips by Crafting. Cross functional team members collaborate remotely on sandbox for testing parties for a prototype, where engineers as well as product managers and designers can contribute, and live changes can be made after brainstorming. Backend engineers can use Crafting to run risky one-off experiments in a production-like environment without spending a long time to set up. On day one, new engineers can set up their sandbox and begin experimenting with the code, with assistance from veteran team members to help troubleshoot in context on their sandbox.
The Results
Lime engineers iterate and release more quickly with Crafting’s help. The time to launch a new environment for end-to-end testing was reduced by 72%. “I no longer need to switch to a different task when my code gets deployed for end-to-end testing”, “Now, I can wrap up my work faster without context switches”, said engineers at Lime.
At the same time, Crafting reduces 87% of the time needed for iterating code in the preview environment when a change is required. This reduction directly improves the debugging efficiency, which is often the most time consuming component in the development cycle. “Now I can test more stuff since testing and debugging is easier on Crafting”. By reducing the overhead for testing and debugging, engineers test more and overall quality of the product improves.
It helps us iterate quickly and ship faster, and facilitates sharing and collaboration. Plus, no more maintenance burden for the in-house system.
Lime enjoys a scalable system free of maintenance burden by using Crafting SaaS. Crafting handles the life cycles of the sandboxes under Lime’s configuration, automatically suspending idle sandboxes and cleaning up unused ones after a while. “We don’t need to worry about maintaining a separate cluster just for testing, making our lives easier”, said Jianfeng, “It’s easy for our engineers too.” Engineers can easily onboard Crafting with SSO and create sandboxes from GitHub Pull Requests or its UI with a single click.
“Overall we are very happy with how things are going, it’s a huge improvement in productivity, and we are finding more use cases with Crafting”, concluded Jianfeng, Head of Infrastructure at Lime.
Industry leader in micro-mobility, operating fleets of electric scooters and e-bikes in over 200 cities across five continents, serving over 100 million rides yearly with over 200,000 vehicles.
- Difficult to test mobile apps + many backend services pre-production
- Spinning up a fresh end-to-end environment takes a long time, hinders velocity
- Iterating code is slow on preview-only environments that are not dev-friendly
- Engineers at Lime use Crafting for end-to-end PR preview and testing
- Use data snapshots to manage testing data with Crafting
- Directly code and fix issues on Crafting Sandboxes and immediately see results.
- Testing parties and collaboration based on Crafting
- One-off experiments with special configs safely on Crafting