Commit b594b57
test: complete test parallelization for improved performance (#451)
## Summary
This PR completes the test suite optimization by adding parallel execution to all tests (both unit and integration), reducing the DatabaseExists timeout, and parallelizing CI jobs for improved performance.
## Changes
### Test Parallelization
- Added `t.Parallel()` to all unit test functions (~180 tests)
- Integration tests already had `t.Parallel()` at top level from previous commits
- Excluded tests using `t.Setenv()` due to Go testing constraints:
- TestFlagSystemVariablePrecedence
- TestDetermineInitialDatabase
- TestComplexFlagInteractions
### CI Workflow Optimization
- Split `lint` and `test` into independent jobs that run in parallel
- Added proper permissions for golangci-lint job (contents: read, pull-requests: read)
- Following golangci-lint best practices for parallel execution
### DatabaseExists Improvements
- Made context-aware by accepting context parameter
- Reduced timeout from 30s → 5s (more reasonable for simple API call)
- Fixed non-existent database test to use real instance
## Performance Impact
- TestRunMCP/database_does_not_exist: 34.87s → 5.63s (84% improvement)
- CI pipeline now runs tests and linting in parallel
- Overall test suite: ~26-28s (limited by intentional delays in timeout tests)
## Technical Details
- Tests with intentional 10s delays (TestReadWriteTransaction, TestReadOnlyTransaction) run in parallel
- Default `-parallel` (GOMAXPROCS) is optimal due to emulator concurrency limits
- All tests properly isolated with instance-level separation
Co-authored-by: Claude <noreply@anthropic.com>1 parent 790e4dd commit b594b57
File tree
51 files changed
+253
-18
lines changed- .github/workflows
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
51 files changed
+253
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | | - | |
| 28 | + | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
39 | 53 | | |
40 | 54 | | |
41 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
| 108 | + | |
107 | 109 | | |
108 | 110 | | |
109 | 111 | | |
| |||
225 | 227 | | |
226 | 228 | | |
227 | 229 | | |
| 230 | + | |
228 | 231 | | |
229 | 232 | | |
230 | 233 | | |
| |||
262 | 265 | | |
263 | 266 | | |
264 | 267 | | |
| 268 | + | |
265 | 269 | | |
266 | 270 | | |
267 | 271 | | |
| |||
296 | 300 | | |
297 | 301 | | |
298 | 302 | | |
| 303 | + | |
299 | 304 | | |
300 | 305 | | |
301 | 306 | | |
| |||
373 | 378 | | |
374 | 379 | | |
375 | 380 | | |
| 381 | + | |
376 | 382 | | |
377 | 383 | | |
378 | 384 | | |
| |||
446 | 452 | | |
447 | 453 | | |
448 | 454 | | |
| 455 | + | |
449 | 456 | | |
450 | 457 | | |
451 | 458 | | |
| |||
555 | 562 | | |
556 | 563 | | |
557 | 564 | | |
| 565 | + | |
558 | 566 | | |
559 | 567 | | |
560 | 568 | | |
| |||
657 | 665 | | |
658 | 666 | | |
659 | 667 | | |
| 668 | + | |
660 | 669 | | |
661 | 670 | | |
662 | 671 | | |
| |||
727 | 736 | | |
728 | 737 | | |
729 | 738 | | |
| 739 | + | |
730 | 740 | | |
731 | 741 | | |
732 | 742 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| 82 | + | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
| |||
131 | 133 | | |
132 | 134 | | |
133 | 135 | | |
| 136 | + | |
134 | 137 | | |
135 | 138 | | |
136 | 139 | | |
| |||
170 | 173 | | |
171 | 174 | | |
172 | 175 | | |
| 176 | + | |
173 | 177 | | |
174 | 178 | | |
175 | 179 | | |
| |||
226 | 230 | | |
227 | 231 | | |
228 | 232 | | |
| 233 | + | |
229 | 234 | | |
230 | 235 | | |
231 | 236 | | |
| |||
272 | 277 | | |
273 | 278 | | |
274 | 279 | | |
| 280 | + | |
275 | 281 | | |
276 | 282 | | |
277 | 283 | | |
| |||
298 | 304 | | |
299 | 305 | | |
300 | 306 | | |
| 307 | + | |
301 | 308 | | |
302 | 309 | | |
303 | 310 | | |
| |||
312 | 319 | | |
313 | 320 | | |
314 | 321 | | |
| 322 | + | |
315 | 323 | | |
316 | 324 | | |
317 | 325 | | |
| |||
352 | 360 | | |
353 | 361 | | |
354 | 362 | | |
| 363 | + | |
355 | 364 | | |
356 | 365 | | |
357 | 366 | | |
| |||
434 | 443 | | |
435 | 444 | | |
436 | 445 | | |
| 446 | + | |
437 | 447 | | |
438 | 448 | | |
439 | 449 | | |
| |||
511 | 521 | | |
512 | 522 | | |
513 | 523 | | |
| 524 | + | |
514 | 525 | | |
515 | 526 | | |
516 | 527 | | |
| |||
573 | 584 | | |
574 | 585 | | |
575 | 586 | | |
| 587 | + | |
576 | 588 | | |
577 | 589 | | |
578 | 590 | | |
| |||
634 | 646 | | |
635 | 647 | | |
636 | 648 | | |
| 649 | + | |
637 | 650 | | |
638 | 651 | | |
639 | 652 | | |
| |||
716 | 729 | | |
717 | 730 | | |
718 | 731 | | |
| 732 | + | |
719 | 733 | | |
720 | 734 | | |
721 | 735 | | |
| |||
853 | 867 | | |
854 | 868 | | |
855 | 869 | | |
| 870 | + | |
856 | 871 | | |
857 | 872 | | |
858 | 873 | | |
| |||
1014 | 1029 | | |
1015 | 1030 | | |
1016 | 1031 | | |
| 1032 | + | |
1017 | 1033 | | |
1018 | 1034 | | |
1019 | 1035 | | |
| |||
1104 | 1120 | | |
1105 | 1121 | | |
1106 | 1122 | | |
| 1123 | + | |
1107 | 1124 | | |
1108 | 1125 | | |
1109 | 1126 | | |
| |||
0 commit comments