Responsive

The Intersection of GitOps and TestOps in a Platform Engineering Context

The Intersection of GitOps and TestOps in a Platform Engineering Context

Last updated
December 9, 2024
Ole Lensmar
CTO
Kubeshop
Share on X
Share on LinkedIn
Share on Reddit
Share on HackerNews
Copy URL

Table of Contents

Start Using Testkube with a Free Trial Today

Subscribe to our monthly newsletter to stay up to date with all-things Testkube.

Last updated
December 9, 2024
Ole Lensmar
CTO
Kubeshop
Share on X
Share on LinkedIn
Share on Reddit
Share on HackerNews
Copy URL

Table of Contents

As Platform Engineering teams strive to build self-service platforms for their teams, GitOps and TestOps are two common cornerstones for these initiatives. Let’s see what these are and how they intersect in a Platform Engineering context, to help you understand how to combine them for maximum efficiency.

Understanding TestOps for Platform Engineering

TestOps designates the operational aspects of testing-related activities in modern and often automated software delivery pipelines and workflows. TestOps can be broken down into many parts, including:

  • Using an SCM like Git for storing test definitions to allow for automation and version control
  • Defining how to execute your tests from an operational aspect
  • Provisioning (ephemeral) environments for running tests
  • Triggering your test executions from your CI/CD pipelines and workflows
  • Scaling your test executions both vertically and horizontally
  • Facilitating troubleshooting of failed tests by automatically collecting logs, artifacts, metrics, etc.
  • Automated reporting and feedback, including integrations with tooling for collaboration, defect tracking, etc.

Although the actual requirements for TestOps will vary across teams, they are usually put forward by Dev/QA who are responsible for testing at a higher level. The actual people setting up these operations are traditionally DevOps and/or Platform Engineering teams, and while a CI/CD tool might be at the heart of a TestOps approach, many adjacent tools are needed to bring all the above pieces together.

Implementing GitOps for Platform Engineering

While TestOps could be seen as a somewhat vague term when it comes to actual implementation, GitOps has a more clear designation; using Git as the source of truth for the state of your application infrastructure. While not entirely new, the adoption of GitOps has been accelerated by the declarative approach embraced by Kubernetes. Using Git (or any other SCM) as the source of truth brings for your infrastructure several benefits:

  • Collaboration - Git providers like GitHub and GitLab provide an extensive collaborative platform.
  • Auditability - Changes in Git are easily auditable, making it easy to link the impact of specific updates on 
  • Resilience - recreating infrastructure is 
  • Scale - reusing 

Thanks to open-source tools like ArgoCD and Flux, Platform and DevOps teams can manage  complex infrastructures with Git at the center of the continuous deployment pipelines..

What do TestOps and GitOps have in common?

At a higher level, the intersection of GitOps and TestOps lies in their shared goal of improving the reliability, scalability, and automation of the software delivery process.

  1. Version-Controlled Automation:  In both TestOps and GitOps, testing and delivery pipelines are version-controlled (Git), allowing for auditable, reproducible tests and deployments.
  2. CI/CD Integration: TestOps facilitates the integration of testing activities directly into GitOps pipelines by embedding automated tests at critical stages of GitOps reconciliation processes.
  3. Declarative Configuration and Infrastructure Testing: Using TestOps practices, teams can automate testing of infrastructure configurations applied by GitOps reconciliation, providing a layer of validation before and after infrastructure changes are applied.
  4. Feedback Loops and Monitoring: By combining GitOps and TestOps, teams can use testing results as feedback loops in deployment pipelines. For instance, if post-deployment tests fail, a Git-based rollback can be triggered in the corresponding GitOps platform.

In essence, GitOps and TestOps converge on a DevOps pipeline that is entirely automated, observable, and continuously validated—driving faster, safer, and more reliable releases.

The following image attempts to illustrate the overlap - numbers corresponding to the items above:

Integrating TestOps and GitOps for Platform Engineering

Platform engineering aims to create a unified environment where teams can independently develop, test, and deploy code safely and consistently. In this context, the intersection of GitOps and TestOps facilitates the platform team's ability to deliver infrastructure and test-tooling as a service to their engineering teams. As discussed above, GitOps and TestOps enable this by introducing automated, reliable, and observable workflows for both infrastructure management and continuous testing.

Highlights of TestOps and GitOps in a Platform engineering context are:

  • Self-Service Infrastructure with Built-In Testing: Developers can request and deploy environments (like staging or testing) by committing changes to a repository, which triggers GitOps workflows. TestOps steps embedded in these workflows validate configurations and run automated tests before deploying infrastructure, ensuring consistent environments across teams.
  • Standardized Pipelines with Continuous Feedback: Platform engineers can set up CI/CD templates with GitOps for developers to use, including TestOps facets like test execution for automated quality checks, giving developers continuous feedback on their code’s readiness for production. 
  • Automated Rollbacks and Incident Management: In a platform engineering setup, GitOps controllers continuously monitor for state drift or test failures. If a deployment fails due to a TestOps-automated quality check (e.g., failing performance or security tests), GitOps can trigger an automated rollback. This rapid rollback minimizes downtime and impacts, streamlining incident management.
  • Scalability and Observability: Platform engineers can set up dashboards that consolidate results from GitOps controllers and TestOps tools. These dashboards provide visibility into both deployment and testing related metrics and artifacts, making it easier to monitor the platform’s health and stability across teams.

In essence, the GitOps-TestOps intersection creates a foundation for a self-service, highly automated, and reliable platform that allows platform engineering teams to focus on building efficient workflows and maintaining infrastructure stability, while development teams benefit from streamlined, self-service environments with built-in quality checks. Check out our GitOps tutorial for setting up testing in GitOps using ArgoCD and Testkube.

Testkube as your TestOps Control Plane

While tooling for GitOps is abundant and standardized (ArgoCD, Flux, etc), tooling for TestOps has not been equally prevalent - and teams usually end up cobbling together a fragile mesh of various testing-related tools to solve for the above described workflows in a holistic manner. Testkube fills this gap - providing a single TestOps Control Plane for test execution, troubleshooting and reporting that is built from the ground up to fit in with modern GitOps pipelines and TestOps practices. In line with the above reasoning, Testkube

  • Is compatible with any Testing tool and CI/CD solution, including GitOps tools like ArgoCD
  • Provides a powerful test-execution engine that Integrates test triggering and execution into any modern CI/CD pipeline
  • Automatically aggregates all logs, results and artifacts into a single pane-of-glass for test troubleshooting and reporting

Read our related content on how Testkube integrates with ArgoCD, and check out the testkube.io website to get started.

About Testkube

Testkube is a test execution and orchestration framework for Kubernetes that works with any CI/CD system and testing tool you need, empowering teams to deliver on the promise of agile, efficient, and comprehensive testing programs by leveraging all the capabilities of K8s to eliminate CI/CD bottlenecks, perfecting your testing workflow. Get started with Testkube's free trial today!