-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy path.coderabbit.yaml
More file actions
82 lines (70 loc) · 3.28 KB
/
Copy path.coderabbit.yaml
File metadata and controls
82 lines (70 loc) · 3.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
language: en-US
early_access: false
enable_free_tier: false
reviews:
profile: chill
request_changes_workflow: false
high_level_summary: true
poem: false
in_progress_fortune: false
review_status: true
collapse_walkthrough: false
path_filters:
- "!**/vendor/**"
- "!vendor/**"
- "!**/zz_generated*"
- "!boilerplate/**"
auto_review:
enabled: true
drafts: true
pre_merge_checks:
custom_checks:
- name: "Stable and Deterministic Test Names"
mode: error
instructions: |
Ginkgo test names MUST be stable and deterministic. They must never contain dynamic
information that changes between runs.
Flag any test title (It(), Describe(), Context(), When(), etc.) that includes:
- Pod names with generated suffixes (e.g., "test-pod-abc123")
- Timestamps or dates
- Random UUIDs or generated identifiers
- Node names
- Namespace names with random suffixes
- IP addresses
- Any value that could change between test runs
Do not apply subjective style judgments (for example, "overly specific").
Only flag deterministic violations of the dynamic-data rules above.
Test names should use descriptive, static strings that clearly indicate what
the test validates.
❌ Bad examples:
- `It("should create pod test-pod-xyz123 with custom security context")`
- `It(fmt.Sprintf("should run on node %s", nodeName))`
- `It("should create namespace " + ns.Name)`
- `It(fmt.Sprintf("should complete initialization within %s", timeout))`
✅ Good examples:
- `It("should create a pod with custom security context")`
- `It("should schedule workloads to labeled nodes")`
- `It("should enforce network policy between namespaces")`
- `It("should complete initialization within 30s")`
Dynamic values belong in test BODIES (assertions, setup), never in test TITLES.
- name: "Test Structure and Quality"
mode: warning
instructions: |
Review Ginkgo test code for these quality requirements:
1. **Single responsibility**: Each test (It block) should test one specific behavior.
Flag tests that assert multiple unrelated behaviors.
2. **Setup and cleanup**: Tests should use BeforeEach/AfterEach for setup and cleanup.
Flag tests that create resources without cleanup, especially cluster-scoped resources.
3. **Timeouts**: Operations that interact with the cluster (pod creation, deployments,
waiting for conditions) must include appropriate timeouts. Flag indefinite waits
or missing timeouts on Eventually/Consistently calls.
4. **Assertion messages**: Assertions should include meaningful failure messages
that help diagnose what went wrong.
❌ `Expect(err).NotTo(HaveOccurred())`
✅ `Expect(err).NotTo(HaveOccurred(), "failed to create test pod")`
5. **Consistency with codebase**: Tests should follow existing patterns in the
repository for how fixtures are created, how clients are obtained, and how
waits are structured.
chat:
auto_reply: true
art: false