Lightning Talk: Fake it Until You Make it: Unit Tests with Go-Client Fake Client
summary
Shows how to use the client-go Fake Client (the object-tracker-backed fake that implements the clientset interface) to unit test Kubernetes calls. Walks through a concrete getSecrets function that returns a map of secretName → key/value pairs, programmatically creates two secrets on the fake.Clientset, calls the function, and asserts specific values. Includes runnable code and a GitHub link so tests actually run and verify behavior.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 0:10Overview
- 0:30What is the Fake Client
- 1:28Benefits
- 1:42Example
- 2:00Get Secrets
- 2:48Unit Test
- 3:11Create Function
- 3:36Demo
related talks
05mLightning Talk: Unit Testing in Go With K8s Clients & APIs: An Intern’s POV on Why I...
31mFake It to Make It! - TDD of gRPC Microservices
48mClimbing the Testing Pyramid: From Real Service to Interface Mocks in Go
30mFaking It - The Art of Testing Using Verified Fakes
01h 32mTesting in Go: 101
20mWriting Microservice Integration Tests in Go (Finally)
35mTest like a ninja with Go
04mLightning Talks – Martin Schurrer
