Platform

Launching our automated E2E testing framework

Launching our automated E2E testing framework

16 May 2023

18-Launching-our-automated-E2E-testing-framework

As a Senior Software Engineer for JUMO, Anes Djebbar had the opportunity to lead the implementation of an End-to-End (E2E) testing framework for our microservice architecture. 

We all know the absolute importance of testing code, so we won’t get into the details of the advantages of well tested applications, however, we will share Anes’s experience of automating the often arduous process.

Why E2E Testing? 

Back in 2019, we were in the process of migrating from a monolithic architecture to a microservice architecture, and we needed a way to verify that the integration between services would remain stable at all times.

It was also crucial to test our services in production-like deployment clusters, adjacent to actual infrastructure, to gain confidence about progressing changes to production, and to ensure the quality of our code as well as the quality of the financial products our code supports.

Continuous Deployment often comes with a microservice architecture, which means that we want to deploy code changes to production as soon as they are ready,  which requires a high level of trust in our code.

That’s when we realised: what we need is an automated end-to-end (E2E) testing framework.

What Framework? 

The mission was clear: build a framework that could take advantage of existing tech skills in the company, be simple to use and maintain, easy to integrate with a deployment pipeline, and open to everyone in engineering.

We considered several third-party options, but ultimately we decided to build our own using Kotlin so we could tailor it to our specific needs. 

Long story short, we went with a single repository containing all the tests, divided by suites, and a few packages for common code, network calls, infrastructure tools etc. Each team would have their own tests to maintain, and due to the nature of the E2E tests, each test can reuse other components instead of having to re-invent the wheel every time. The tests would be executed by a job on Kubernetes, after the deployment to our development Kubernetes cluster. Each job would run a specific suite of tests based on the service being deployed and either fail the deployment or let it go through if successful.

How

After the design came the hardest challenge of all: how to convince all the engineering teams to take part in the project instead of relying on their own solutions, if any.

We were basically asking teams with different priorities and working processes to change over and to start doing more. It required a cultural shift within the organisation. We had to make a strong case for the benefits of E2E testing and how it would ultimately make the development process more efficient and reliable.

They say that a picture is worth a thousand words, and a proof of concept a million!  

So, we decided to actually build a first version of the tool, and test the interaction with a new service planned for release soon, integrate it in the new deployment pipeline and eventually make it the first service to have a full Continuous Integration/Continuous Deployment pipeline in the company.

The service works by ingesting some data from AWS S3 files, then persists them in PostgreSQL and makes them available through a REST API.

The E2E test was quite simple:
  1. Generate and upload a file on an AWS S3 bucket containing some data
  2. Wait a few seconds
  3. Query the API of the service
  4. Assert that the response is correct and contains the data previously uploaded

We ran it, and… epic fail! While the file on S3 was ingested by the service, the data could not be persisted in the database due to a mis-configuration of the permissions in AWS.

The first automated E2E tests in JUMO helped us discover an infrastructure bug before reaching production. Massive win!

Who

Once we proved it was useful, not that we ever doubted it, people started adding new tests, which was great! But what about ownership? As mentioned previously, this was a single repository, owned by everyone in engineering (so Pull Requests/merge permissions were not restricted). And if everyone owns it, then generally nobody is responsible.

We quickly started to have situations where one team makes a change to a reusable component that inadvertently breaks another team’s use-case, making their test fail and blocking their pipeline. Not cool.

We therefore decided to create a virtual team, with at least one representative member from each engineering team, to be responsible for approving and merging new PRs. This helped to ensure that each team was held accountable for their own tests, while also providing a forum for collaboration, feedback and improvement. There are two simple rules:

  1. Anybody in JUMO can create PRs
  2. Merge is only allowed for members of the virtual team, if approved

This acts as an open-source model within the company, having a set of maintainers with full context and contributors that branch the code and open PRs.

Final thoughts on E2E testing 

I think the most important lesson gleaned from this exercise is that there are no one-size-fits-all solutions. We had to make a model that could evolve on a regular basis. And ultimately, implementing an E2E testing framework for our microservice architecture has been a significant improvement in our development process. It has helped us achieve Continuous Deployment and to ensure that our system is functioning correctly before deploying to production ✅.’

Connect with Anes on LinkedIn: https://linkedin.com/in/anesdjebbar

Share this article

You may also like

Diane Radley

Diane was a partner at PriceWaterhouse Coopers where she led their Transaction Services group advising on listings and corporate transactions. She served as CFO on JSE listed Altron and then Old Mutual after which she took the reins at Old Mutual Investment Group as CEO for 6 years. She currently serves on various international listed boards.

Bradwin Roper

A visionary leader inbanking, fintech and telecommunications. Bradwin has 17 years of diversified experience across these sectors and is renowned for his strategic vision, financial acumen, and leadership.His proficiency in engaging with stakeholders at multiple levels has consistently resulted in delivering impactful outcomes in complex scenarios.

We're committed to building financial tools that are not only fast and accessible, but also personalised and responsible.
Joseph Mucheru

Joseph Mucheru

Joe was the former Kenyan Cabinet Secretary in the Ministry of ICT from 2015 to 2022. He brings a wealth of government experience and knowledge of African tech to the JUMO exec team and board.

Joe was also previously the head of Sub-Saharan Africa for Google, where he led strategy, business planning & operations.

Organisations like JUMO have never been more important for protecting livelihoods, facilitating financial inclusion, and driving economic growth.
Joseph Mucheru

Fábio Matos

Fábio has worked in systems and software development for over 18 years. His tech leadership experience covers e-commerce and banking. He helped build the engineering team for neobank N26, and is building a world-class, compliant and scalable platform for JUMO.

JUMO has built a strong technology base with new features and functionality constantly on the horizon. We are ready for whatever comes our way.
Paul Whelpton

Paul Whelpton

Paul is CEO of JUMO and a recognised industry leader in AI. He previously spent seven years leading analytics teams at a top tier Bank. His experience spans retail, business and commerce with a focus on creating yield from large scale information management systems.
JUMO is an information enablement company that’s creating value for partners, and ordinary people. Customers can access credit in real time at a low cost of risk.
Paul Whelpton

Susie Squire

Susie joined JUMO after five and a half years at Woolworths Holdings Limited, where she was Group Head of Communications. Before joining Woolworths, she was the Press Secretary to the British Prime Minister, David Cameron, and was responsible for coordinating cross government communications and campaigns. Before that, Susie was at the Department for Work and Pensions, working as part of a team that oversaw wholesale reform of the welfare system. Susie has over 12 years’ international communications and corporate affairs experience spanning markets across Africa and Europe.

We have an unmatched ability to serve high quality, low cost financial products to customers at scale in emerging markets.

Andrew Watkins-Ball

Andrew is founder of JUMO and served as the CEO for over a decade. He’s built various businesses including Gateway Telecoms, a satellite service provider sold to Vodafone for $675M. He spent seven years at Salomon Brothers in London and New York and is partner in a fund focused on the energy sector.

Everyone should have access to the best financial choices. We’ve built the brain and pipes that hold and carry information for banking systems.
Andrew Watkins-Ball

Michael Ball

Michael has over 20 years’ experience in CFO roles and a successful track record for building scale and value. He is recognised industry-wide for operational efficiency, business transformation, liquidity management, financial structuring, refinancing and IPO preparation and execution. During his previous tenures as Group CEO for Zepz/WorldRemit and Sysco, his financial responsibilities also included strategy and M&A. Michael lives in North London with his wife, Eloise, young daughter, Amelie and two dogs. He likes to keep fit, plays very average golf and is a season ticket holder at Manchester United.

JUMO is powering growth by constantly building scale and value.