Commit 71b4141
test: improve CLI test determinism and remove redundant test logic (#1123)
## Summary
Improves test determinism, consistency, and reliability across CLI,
uninstall, and blueprint test suites by standardizing shell invocation,
tightening execution patterns, and removing redundant or outdated test
code.
---
## Related Issue
Fixes #977 (part 1)
---
## Changes
- Normalize shell invocation:
- Replace `bash -lc` with `bash -c` in uninstall tests to avoid shell
initialization side effects
- Improve CLI test stability:
- Increase timeouts for long-running commands
- Standardize usage of `runWithEnv(..., timeout)`
- Remove redundant / outdated test code:
- Clean up unused or deprecated test logic in `runner.test.ts`
- Improve test consistency:
- Align execution patterns across CLI and uninstall tests
- Preserve security coverage:
- Maintain regression protections (e.g., path validation and credential
handling)
---
## Verification
- `npm test` passes locally
- `npx prek run --all-files` passes in CI
- No changes to CLI behavior or runtime logic
- Existing security and regression tests continue to pass
---
## Rationale
Some tests relied on shell initialization behavior (`bash -lc`) and
inconsistent execution patterns, leading to flakiness and
non-deterministic outcomes.
These updates:
- eliminate shell-dependent variability
- standardize execution across test suites
- improve reliability without impacting functionality
Additionally, minor cleanup removes redundant or outdated test code to
improve maintainability.
---
## Risk Assessment
**Low risk**
- Changes are limited to test code and execution behavior
- No production code paths modified
- Security and regression coverage preserved
**Rollback**
- Fully reversible by reverting test changes
---
## Type of Change
- [x] Test / infrastructure improvement (no behavioral change)
- [x] Code cleanup / maintenance
---
## Testing
- [x] `npm test` passes
- [x] `npx prek run --all-files` passes (CI)
---
## Checklist
### General
- [x] Contributing guide followed
### Code Changes
- [x] Formatters applied
- [x] No user-facing behavior changes
- [x] No secrets committed
---
## Summary by CodeRabbit (updated)
* **Tests**
* Improved CLI and uninstall test determinism by standardizing shell
invocation
* Increased timeouts to reduce flakiness in long-running test cases
* Removed redundant or outdated test logic for improved maintainability
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Tests**
* Improved TypeScript typing inside test mocks for safer compilation.
* Added a shared snapshot constant and strengthened a null-check
assertion.
* Simplified test environment handling by explicitly setting HOME and
adjusting shell invocation semantics.
* Removed redundant inline comment assertions and tightened output
checks.
* Minor formatting and clarity tweaks across test suites for easier
maintenance.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Signed-off-by: Krish Sapru <ksapru@bu.edu>
---------
Co-authored-by: Carlos Villela <cvillela@nvidia.com>1 parent 72e0d4e commit 71b4141
File tree
4 files changed
+58
-32
lines changed- nemoclaw/src/blueprint
- test
4 files changed
+58
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
30 | | - | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
123 | 125 | | |
124 | 126 | | |
125 | 127 | | |
| 128 | + | |
126 | 129 | | |
| 130 | + | |
127 | 131 | | |
128 | 132 | | |
129 | 133 | | |
| |||
140 | 144 | | |
141 | 145 | | |
142 | 146 | | |
143 | | - | |
144 | | - | |
| 147 | + | |
| 148 | + | |
145 | 149 | | |
146 | 150 | | |
147 | 151 | | |
148 | | - | |
| 152 | + | |
149 | 153 | | |
150 | 154 | | |
151 | | - | |
| 155 | + | |
152 | 156 | | |
153 | 157 | | |
154 | | - | |
| 158 | + | |
155 | 159 | | |
156 | 160 | | |
157 | 161 | | |
158 | 162 | | |
159 | 163 | | |
160 | | - | |
| 164 | + | |
161 | 165 | | |
162 | 166 | | |
163 | | - | |
| 167 | + | |
164 | 168 | | |
165 | 169 | | |
166 | 170 | | |
167 | | - | |
| 171 | + | |
168 | 172 | | |
169 | 173 | | |
170 | | - | |
| 174 | + | |
171 | 175 | | |
172 | 176 | | |
173 | 177 | | |
| |||
207 | 211 | | |
208 | 212 | | |
209 | 213 | | |
210 | | - | |
211 | | - | |
| 214 | + | |
| 215 | + | |
212 | 216 | | |
213 | 217 | | |
214 | 218 | | |
215 | | - | |
216 | | - | |
| 219 | + | |
| 220 | + | |
217 | 221 | | |
218 | | - | |
| 222 | + | |
219 | 223 | | |
220 | 224 | | |
221 | 225 | | |
| |||
225 | 229 | | |
226 | 230 | | |
227 | 231 | | |
228 | | - | |
229 | | - | |
| 232 | + | |
| 233 | + | |
230 | 234 | | |
231 | | - | |
| 235 | + | |
232 | 236 | | |
233 | 237 | | |
234 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
39 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
44 | | - | |
45 | 47 | | |
46 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
47 | 55 | | |
48 | 56 | | |
49 | 57 | | |
| |||
58 | 66 | | |
59 | 67 | | |
60 | 68 | | |
61 | | - | |
62 | 69 | | |
63 | 70 | | |
64 | 71 | | |
| |||
72 | 79 | | |
73 | 80 | | |
74 | 81 | | |
75 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
76 | 86 | | |
77 | 87 | | |
78 | 88 | | |
| |||
84 | 94 | | |
85 | 95 | | |
86 | 96 | | |
87 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
88 | 100 | | |
89 | 101 | | |
90 | 102 | | |
| 103 | + | |
91 | 104 | | |
92 | 105 | | |
93 | 106 | | |
94 | 107 | | |
95 | 108 | | |
96 | 109 | | |
97 | 110 | | |
98 | | - | |
| 111 | + | |
99 | 112 | | |
100 | 113 | | |
101 | 114 | | |
| |||
108 | 121 | | |
109 | 122 | | |
110 | 123 | | |
111 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
112 | 127 | | |
113 | 128 | | |
| 129 | + | |
114 | 130 | | |
115 | 131 | | |
116 | 132 | | |
117 | 133 | | |
118 | 134 | | |
119 | | - | |
| 135 | + | |
120 | 136 | | |
121 | 137 | | |
122 | 138 | | |
| |||
126 | 142 | | |
127 | 143 | | |
128 | 144 | | |
129 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
130 | 148 | | |
131 | 149 | | |
132 | 150 | | |
133 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
134 | 154 | | |
135 | 155 | | |
| 156 | + | |
136 | 157 | | |
137 | 158 | | |
138 | 159 | | |
139 | 160 | | |
140 | 161 | | |
141 | | - | |
| 162 | + | |
142 | 163 | | |
143 | 164 | | |
144 | 165 | | |
| 166 | + | |
145 | 167 | | |
146 | 168 | | |
147 | 169 | | |
| |||
0 commit comments