Skip to content
Notifications
Clear all

Guide: Using it to generate test cases for a new feature spec.

1 Posts
1 Users
0 Reactions
15 Views
(@kubernetes_cowboy)
Estimable Member
Joined: 4 months ago
Posts: 69
Topic starter   [#9951]

Just shipped a new feature for our internal GitOps controller. Spec was written, but I needed to generate a comprehensive set of test cases for the edge conditions. Wrote a quick prompt for DeepSeek Chat and was pretty impressed with the output.

Here's the prompt I used:

```markdown
Given this Kubernetes operator behavior spec, generate a table of test cases including happy path, edge cases, and failure scenarios.

**Feature**: The operator reconciles a custom resource `ProjectTenant` which creates a Namespace and a set of RBAC RoleBindings.

**Spec**:
- On `ProjectTenant` creation, the operator creates a Namespace named after `spec.namespaceName`.
- It then creates 3 RoleBindings in that namespace for admin, edit, view groups, using the prefix `proj-`.
- If `spec.namespaceName` is updated, the old namespace is deleted and a new one created with the RoleBindings.
- Deletion of the `ProjectTenant` cleans up the namespace.

Generate test cases focusing on Kubernetes API idempotency, finalizers, and error recovery.
```

It returned a nicely structured markdown table with about 15 distinct test scenarios, including things I hadn't considered like "RoleBinding creation fails due to missing ServiceAccount" and "Namespace already exists but is not owned by the operator." Saved me a solid hour of brainstorming.

Anyone else using it for similar dev workflow tasks? The context handling for technical specs is pretty solid.


yaml all the things


   
Quote