Integrate Testing into Your Container Pipeline

A closer look at testing within container pipelines, CI/CD, software delivery, and containerization.
Faith Kilonzi
Feb 03, 2022

Photo by Christopher Burns on Unsplash

The Software Delivery Life Cycle (SDLC) is composed of a series of iterations guided by development best practices. This is because software development and delivery requires a great deal of trial and error, and confidence in the final product is built upon making continuous improvements through a process called Continuous Integration and Continuous Development (CI/CD). The emerging trend of the CI/CD pipeline is becoming a core part of the process of software iteration because it allows for systemic builds and tests before the actual artifact is completed and deployed. Unlike traditional SDLC processes, which do not focus on real-time testing as part of the process, CI/CD pipelines guarantee consistency since the application is deployable and able to interact with all relevant tools at every development milestone.

Testing is an essential part of the development process, especially when using CI/CD pipelines. With the rise of containerization, the demand for container-native integration test codebase coverage keeps increasing due to the need to run the same test on different operating systems. The different software modules combined in a container need to work seamlessly as a unit, which could be made easier by integration testing. The main challenge faced in integration testing is that it tends to consume a lot of resources due to the underlying application dependencies. This article will explore the effectiveness of integration testing in container-native applications while using minimal workload resources.

What Is a Container Pipeline?

Containerization has changed the way applications are built and delivered, resulting in isolated, dependency-managed, and immutable software that can be deployed anywhere. All of these advancements, along with a smaller resource footprint, contribute to cutting operating costs and management overhead. A container is a standard unit of software that contains code and all of the application's dependencies, allowing it to function independently and efficiently in a single computing environment. With containerization, applications are isolated in a secure space with their dependencies installed, then stored as single container image files (locally or remotely) so that they can run independently. The primary benefits of containerization include application isolation, improved operational agility, and process consistency.

With the advent of Agile software methodology, IT industries are embracing DevOps technology, which prioritizes high efficiency through the widespread use of automation tools. Two of the main pillars of DevOps are continuous integration (CI) and continuous delivery (CD), and with the utility of the CI/CD pipeline, coupled with the rise of containerization, container pipelines are becoming more and more popular. A container pipeline is essentially an automated SDLC for containerization, wherein every stage is iteratively tested and improved upon continuously – from image creation to integration, testing, and production deployment. Some of the container pipeline options available today include Heroku, Azure DevOps, AWS Elastic Beanstalk, GitLab CI/CD, Jenkins, and Google Cloud Build.

Typically, the container pipeline consists of the following stages:

  • Development: The application is created and saved in the code repository.
  • Code review: Manual or automatic code review tests are performed.
  • Build stage: The code is built and packaged.
  • Testing stage: Comprehensive acceptance testing is performed on the container to verify functionality within the testing environment.
  • Deployment: A fully tested container image is deployed to the production environment.

.

Integrate Testing into Container Pipelines

The CI/CD pipeline is based on automation wherein the building process vets the artifacts at every stage of continuous integration, deployment, and delivery. Since software engineering is an iterative process, the project goes through several quality control steps (such as finding bugs and identifying fixes) before engineers achieve a viable release candidate. The end product of the CI/CD pipeline (the viable candidate) is then packaged, distributed, and configured before deployment. In a nutshell, the goal of a CI/CD pipeline is to improve the quality of the release, reduce risk, and enable consistent collaboration between engineers, operations teams, and quality assurance teams.

One of the primary cornerstones of continuous integration (CI) is the ability to build consistently. As the team's CI procedures evolve, they become more consistent and efficient, which also allows for the possibility of having more builds available with more consistency. Combining containerization with automated pipelines using CI/CD tools offers more flexibility to software delivery teams while also speeding up the development process. Using container pipelines not only ensures consistency during the development process, but also makes the application more robust and available since it eliminates the potential for human error. This is because automated container pipelines prioritize repeatability in testing, which means that image containers become more and more user-friendly at every stage of the CI/CD software delivery process.

Testing starts once a container image has been built and deployed into the application staging environment. At this point, extensive testing is carried out to ensure that the application functions and performs as expected, and that the container is robust and secure. Some of the container pipeline tests that are integrated at this stage include:

  • Functional testing: This tests the overall functionality of the application to ensure that it behaves as required.
  • Regression testing: Since different versions of the same container are built during an iterative development process, you must carry out regressive tests to ensure that the new containerized application integrates with the previous versions without changing the functionality.
  • Stress testing: Stress tests ensure that containers can handle stress by assessing their behavior when put in less optimal conditions.
  • Security tests: At this stage, the vulnerability of the containers and the overall application is tested through either penetration testing or vulnerability scanning to make sure that it is secure.
  • Acceptance testing: Finally, end-users test the container for overall functionality and provide real-time feedback before the release candidate is deployed to production.

.

Where to Start with Container Pipelines

One of the main challenges faced during container pipeline testing is the lack of standardized dependencies for clustered or dependent containers. The main goal of containerization is to avoid infrastructural complexity by ensuring that every container version is fault-tolerant and does not affect the underlying orchestration platform. This way, developers do not have to worry about having the correct dependencies since every container image version already contains the corresponding packages. To ensure seamless container pipeline testing, the initial container pipeline setup should be oriented toward achieving end-to-end container independence, proper configurations, and an automated pipeline while maintaining observability, security, and policy management.

As stated above, working with cloud-native containerized applications makes it easier to take advantage of the CI/CD framework with container pipelines. With technology like Kubernetes or Docker, you can set up containerized pipelines that control the complete life cycle of microservices and container cluster applications. Slim AI has created an end-to-end platform to help DevOps teams with their software delivery process through the creation of production-ready containers and optimized images. Container pipelines solve integration challenges through testing and CI/CD delivery processes. To get started or to learn more about containerized pipelines, you can sign up for the Slim Developer Platform here.

.

Bio

Faith Kilonzi is a full-stack software engineer, technical writer, and a DevOps enthusiast, with a passion for problem-solving through implementation of high-quality software products.

She holds a bachelor’s degree in Computer Science from Ashesi University. She has experience working in academia, fin-tech, healthcare, research, technology, and consultancy industries in both Kenya, Ghana, and in the USA. Driven by intellectual curiosity, she combines her passion for teaching, technology, and research to create technical digital content.

Related Articles

5 Most Commonly Asked DockerSlim Questions

We enlisted DockerSlim expert and Slim.AI Developer Experience Engineer to dive into how container slimming works.

Primož Ajdišek

Technical Staff

5 Ways Slim Containers Save You Money

Do slim containers really save you money on your cloud bill? Are there cost advantages to smaller containers? Find out here.

Chris Tozzi

Automating DockerSlim in Your CICD Pipeline

Using GitHub Actions, you can refine container images automatically making them smaller, faster to load, and more secure by default – all without sacrificing any capabilities.

Nicolas Bohorquez

Contributor

Building Apps Using Cloud Native Buildpacks

Getting started with this innovative technique

Vince Power

Contributor

Building DockerSlim into a Jenkins Pipeline

A step by step tutorial on building DockerSlim into your CI/CD pipeline.

Clarifying the Complex: Meet Ivan Velichko, Container Dude at Slim.AI

Ivan recently joined the team at Slim.AI, and we sat down with him to learn more about the path that led him here.

Ivan Velichko

Container Dude

Container Insights: Dissecting the World's Most Popular Containers

Join Ayse Kaya in this series, as she creates her 2022 Container Report Chalk Full of Important Security Findings for Developers.

Ayse Kaya

Analytics & Strategy

Container of the Week: Python & Flask

Our weekly breakdown of a popular container

What We Discovered Analyzing the Top 100 Public Container Images

Complexity abounds in modern development

Ayse Kaya

Analytics & Strategy

2022 Public Container Report

Vulnerabilities continue to increase and developers are struggling to keep up.

Ayse Kaya

Analytics & Strategy

Containerizing Python Apps for Lambda

A tutorial on deploying AWS Lambda using containers, Python edition.

Docker Containers for Your Raspberry Pi

Compact PCs need compact apps

Martin Wimpress

Community

Explore and analyze a Docker container with DockerSlim X-Ray

Understanding container composition

Martin Wimpress

Community

Five Proven Ways to Debug a Container

When Things Just Are Not Working

Theofanis Despoudis

Contributor

Five Things You Should Never Ship to Production in a Container

Here is our take on five things to avoid when creating a container or shipping it to production.

Chris Tozzi

Increasing Your CI/CD Velocity with Slim Containers

We’ll explain what Slim Containers are, how they speed up the build process, and how they can improve the efficiency of your testing.

Mike Mackrory

Contributor

Reducing Docker Image Size - Slimming vs Compressing

Know the difference

Pieter van Noordennen

Growth

Serverless Applications and Docker

How to Scale the Latest Trend in Infrastructure

Pieter van Noordennen

Growth

Slim.AI Docker Extension for Docker Desktop

How to access our Docker Extension and try it for yourself.

Josh Viney

Product

Slimming a Rails Application with DockerSlim

Dissect a simple Rails application container using DockerSlim to analyze, optimize, and deploy your product more quickly.

Theofanis Despoudis

Contributor

Where Do You Store Your Container Images?

Container Registry Options are Growing in Number and Complexity

Pieter van Noordennen

Growth

Using AppArmor and SecComp Profiles for Security Audits

Conduct better container security audits using tools like SecComp, NGINX, and Docker.

What’s in your container?

Why Docker Layers matter for container optimization

Pieter van Noordennen

Growth

Why Developers Shouldn't Have to Be Infrastructure Experts, Too

Simplifying processes required to containerize and deploy cloud-native apps.

Chris Tozzi

A New Workflow for Cloud Development

Leverage the benefits of containerization without the headaches & hassle

John Amaral

CEO

Why Don’t We Practice Container Best Practices?

Container best practices are easy to understand, hard to do

John Amaral

CEO

Better Security Audits with AppArmor and SecComp via DockerSlim

Combine the power of tools like SecComp, NGINX, and Docker.

Cloud Development Is Still Too Manual & Complex

Lessons we learned from interviewing more than 30 developers

John Amaral

CEO

Improving the Developer Experience When Adopting Cloud-Native Best Practices

PaymentWorks Case Study

Josh Viney

Product

Creating a Container Pipeline with GitLab CI

Shipping containers the easy way

Nicolas Bohorquez

Contributor