Pull request testing on Kubernetes

Imagine an organization with the following practices: Commits code on GitHubRuns its CI/CD pipelines with GitHub ActionsRuns its production workload on KubernetesUses Google Cloud A new engineer manager arrives and asks for the following: On every PR, run integration tests in a Kubernetes cluster similar to the production one. It sounds reasonable.

Imagine an organization with the following practices:

  • Commits code on GitHub
  • Runs its CI/CD pipelines with GitHub Actions
  • Runs its production workload on Kubernetes
  • Uses Google Cloud

A new engineer manager arrives and asks for the following:

On every PR, run integration tests in a Kubernetes cluster similar to the production one.

It sounds reasonable.

Engineering manager: I want #integrationtests to run on the app deployed on #Cloud infra for each #GitHub PR ✅ Me, thinking it's a no-brainer: sure thing! 🤦‍♂️ Me, after 85 runs: I have content for my next blog post/talk 😅

[image or embed]

— Nicolas Fränkel 🇺🇦🇬🇪 (@frankel.ch) December 20, 2024 at 10:52 AM

In this series of posts, I’ll show how you can do it.

  1. Testing locally and on GitHub workflows
  2. Working with GitHub Actions and GKE
  3. vCluster for isolation and costs control