Table Driven Tests

Review that tests covering multiple scenarios use table-driven style instead of inline sequential blocks.

kubernetes-sigs Updated 3.2k repo stars

File contents

Skill: Table-Driven Tests

Flag: A Go test function that covers multiple scenarios inline as a single sequential block.

Ask: Refactor to use table-driven style — tests := map[string]struct{ ... }{ ... } with for name, tc := range tests. A monolithic test that grows one if block per case is a "spaghetti test" and makes it hard to add new scenarios.

kubernetes-sigs/kueue commit a13cc5b51a

Frequently asked questions

npx get-skill add kubernetes-sigs-kueue/table-driven-tests