Plateforme

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

Partager cet article

Cela pourrait également vous intéresser

Diane Radley

Diane était associée chez PriceWaterhouse Coopers, où elle dirigeait le groupe « Transaction Services », chargé de fournir des conseils en matière d’introductions en bourse et d’opérations d’entreprise. Elle a occupé le poste de directrice financière chez Altron, société cotée à la Bourse de Johannesburg (JSE), puis chez Old Mutual, avant de prendre les rênes d’Old Mutual Investment Group en tant que PDG pendant six ans. Elle siège actuellement au conseil d’administration de plusieurs sociétés cotées à l’international.

Bradwin Roper

Un dirigeant visionnaire dans les domaines de la banque, des technologies financières et des télécommunications. Fort de 17 ans d’expérience diversifiée dans ces secteurs, Bradwin est reconnu pour sa vision stratégique, son sens aigu des finances et ses qualités de dirigeant. Sa capacité à dialoguer avec les parties prenantes à différents niveaux lui a régulièrement permis d’obtenir des résultats significatifs dans des situations complexes.

Nous nous engageons à développer des outils financiers qui soient non seulement rapides et accessibles, mais aussi personnalisés et responsables.
Joseph Mucheru

Joseph Mucheru

Joe a occupé le poste de secrétaire d'État kenyan au ministère des Technologies de l'information et de la communication de 2015 à 2022. Il apporte à l'équipe de direction et au conseil d'administration de JUMO une grande expérience du secteur public ainsi qu'une connaissance approfondie du secteur technologique africain.

Joe a également occupé auparavant le poste de directeur de Google pour l'Afrique subsaharienne, où il était en charge de la stratégie, de la planification commerciale et des opérations.

Les organisations telles que JUMO n’ont jamais été aussi importantes pour protéger les moyens de subsistance, favoriser l’inclusion financière et stimuler la croissance économique.
Joseph Mucheru

Fábio Matos

Fábio travaille dans le domaine du développement de systèmes et de logiciels depuis plus de 18 ans. Son expérience en matière de direction technique couvre les secteurs du commerce électronique et de la banque. Il a contribué à la mise en place de l'équipe d'ingénierie de la néobanque N26 et développe actuellement pour JUMO une plateforme de classe mondiale, conforme aux réglementations et évolutive.

JUMO s'est dotée d'une solide base technologique et propose sans cesse de nouvelles fonctionnalités. Nous sommes prêts à relever tous les défis qui se présenteront à nous.
Paul Whelpton

Paul Whelpton

Paul est PDG de JUMO et un leader reconnu du secteur de l'intelligence artificielle. Auparavant, il a dirigé pendant sept ans des équipes d'analyse au sein d'une banque de premier plan. Son expérience couvre les secteurs de la distribution, des affaires et du commerce, avec pour objectif principal de générer de la rentabilité à partir de systèmes de gestion de l'information à grande échelle.
JUMO est une entreprise spécialisée dans la mise à disposition d'informations qui crée de la valeur tant pour ses partenaires que pour le grand public. Ses clients peuvent accéder à des crédits en temps réel, avec un faible coût de risque.
Paul Whelpton

Susie Squire

Susie a rejoint JUMO après avoir passé cinq ans et demi chez Woolworths Holdings Limited, où elle occupait le poste de directrice de la communication du groupe. Avant de rejoindre Woolworths, elle était attachée de presse du Premier ministre britannique, David Cameron, et était chargée de coordonner la communication et les campagnes à l’échelle du gouvernement. Auparavant, Susie travaillait au ministère du Travail et des Retraites, au sein d’une équipe chargée de superviser la réforme en profondeur du système de protection sociale. Susie possède plus de 12 ans d’expérience en communication internationale et en affaires générales, acquise sur les marchés africains et européens.

Nous disposons d'une capacité inégalée à proposer à grande échelle des produits financiers de haute qualité et à faible coût à nos clients sur les marchés émergents.

Andrew Watkins-Ball

Andrew est le fondateur de JUMO, dont il a été le PDG pendant plus d'une décennie. Il a créé plusieurs entreprises, dont Gateway Telecoms, un fournisseur de services par satellite cédé à Vodafone pour 675 millions de dollars. Il a travaillé pendant sept ans chez Salomon Brothers à Londres et à New York, et est aujourd'hui associé dans un fonds spécialisé dans le secteur de l'énergie.

Tout le monde devrait avoir accès aux meilleures options financières. Nous avons mis au point le « cerveau » et les « canaux » qui stockent et acheminent les informations pour les systèmes bancaires.
Andrew Watkins-Ball

Michael Ball

Michael possède plus de 20 ans d’expérience à des postes de directeur financier et a fait ses preuves en matière de développement et de création de valeur. Il est reconnu dans l’ensemble du secteur pour son efficacité opérationnelle, sa capacité à transformer les entreprises, sa gestion des liquidités, ses compétences en structuration financière, en refinancement, ainsi que dans la préparation et la mise en œuvre d’introductions en bourse. Au cours de ses précédents mandats en tant que PDG du groupe Zepz/WorldRemit et de Sysco, ses responsabilités financières englobaient également la stratégie et les fusions-acquisitions. Michael vit dans le nord de Londres avec sa femme, Éloïse, sa jeune fille, Amélie, et ses deux chiens. Il aime rester en forme, joue au golf de manière tout à fait moyenne et est abonné au Manchester United.

JUMO stimule sa croissance en renforçant sans cesse son envergure et sa valeur.