DEV Community

Cover image for Improving image-specific testing with actual examples
Toby Bellwood for Lagoon

Posted on

1

Improving image-specific testing with actual examples

In Lagoon 1.x, Lagoon ran a full battery of tests for every pull request submitted to the GitHub repository. Not only was this inefficient, but unrelated errors also added false negatives to the testing process. In addition, running these tests required a full local instance of Lagoon to be created, which presented a significant technical and resource hurdle for contributions. With the addition of Kubernetes, this hurdle was reduced, but still significant.

At the same time as completing the work on Lagoon 2, we have been working hard on a set of example projects for Lagoon – covering a wider range of frameworks, content management systems, and situations than previously. We have gathered these examples over at https://github.com/uselagoon/lagoon-examples as Git submodules to the source repositories and branches.

We will be taking advantage of these example projects to test our images. We have built a CI process that will build our images, clone, build, and test the relevant example projects using the images being modified. With the introduction of automated dependency resolution triggering CI builds, we have automated a large portion of the image production process.

The tests we will be using for the process have been written in Markdown, and are parsed into Mocha tests by the excellent Leia parser from the Lando team. These tests are human-readable and easy to contribute to. You can see an example at https://github.com/amazeeio/drupal-example-simple/blob/9.x-advanced/TESTING_dockercompose.md.

Likewise, we will be running the same set of tests inside these example projects to ensure the projects work with the latest and edge releases of the images prior to any changes being merged.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay