Skip to content

Commit c8bed2a

Browse files
committed
feat: integrate with consolidated go-utils package
- Update dependency to @go-corp/utils@^1.7.0 for consolidated utilities - Remove duplicate utilities now available in the shared package - Update imports to use consolidated structured logger and environment utilities - Add new CLI configuration and logging capabilities - Improve test runner with better error handling and configuration loading This update aligns with the new shared package architecture where go-utils serves as the single source of truth for common utilities.
1 parent 95052a3 commit c8bed2a

File tree

11 files changed

+1220
-289
lines changed

11 files changed

+1220
-289
lines changed

.gotestsuiterc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"runtime": "bun",
3+
"database": "memory",
4+
"verbose": true,
5+
"parallel": true,
6+
"maxWorkers": 2,
7+
"timeout": 15000,
8+
"reporter": "verbose",
9+
"telemetry": {
10+
"enabled": false
11+
},
12+
"notifications": {
13+
"enabled": false
14+
}
15+
}

.gotestsuiterc.example

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# @go-corp/test-suite Configuration Example
2+
#
3+
# This file shows all available configuration options for the test runner.
4+
# Copy this to .gotestsuiterc, .gotestsuiterc.json, or add to package.json under "gotestsuite" key.
5+
6+
{
7+
# Runtime Configuration
8+
"runtime": "node",
9+
"database": "sqlite",
10+
11+
# Test Selection
12+
"categories": ["unit", "integration"],
13+
"patterns": ["**/*.{test,spec}.{js,ts,jsx,tsx}"],
14+
"exclude": ["**/node_modules/**", "**/dist/**"],
15+
16+
# Execution Options
17+
"watch": false,
18+
"verbose": false,
19+
"parallel": true,
20+
"maxWorkers": 4,
21+
"timeout": 30000,
22+
23+
# Output Configuration
24+
"reporter": "default",
25+
"outputFile": "./test-results.json",
26+
"coverage": false,
27+
28+
# Environment Variables
29+
"env": {
30+
"NODE_ENV": "test",
31+
"DEBUG": "false"
32+
},
33+
"envFile": ".env.test",
34+
35+
# Test Discovery
36+
"testDir": "./tests",
37+
"testMatch": [
38+
"**/*.test.{js,ts,jsx,tsx}",
39+
"**/*.spec.{js,ts,jsx,tsx}"
40+
],
41+
"testIgnore": [
42+
"**/node_modules/**",
43+
"**/dist/**",
44+
"**/.git/**"
45+
],
46+
47+
# Advanced Options
48+
"bail": false,
49+
"silent": false,
50+
"detectOpenHandles": true,
51+
"forceExit": false,
52+
53+
# Enterprise Features
54+
"telemetry": {
55+
"enabled": false,
56+
"endpoint": "https://api.example.com/telemetry",
57+
"apiKey": "your-api-key-here"
58+
},
59+
60+
"notifications": {
61+
"enabled": false,
62+
"slack": {
63+
"webhook": "https://hooks.slack.com/services/...",
64+
"channel": "#test-results"
65+
},
66+
"email": {
67+
"smtp": "smtp.example.com",
68+
"from": "tests@example.com",
69+
"to": ["dev-team@example.com"]
70+
}
71+
}
72+
}

README.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,116 @@ factoryTest('consistent test data', async (factory) => {
116116
}, 12345) // Custom seed
117117
```
118118

119+
## 🔧 Configuration
120+
121+
The test runner supports enterprise-level configuration through multiple formats:
122+
123+
### Configuration Files
124+
125+
The test runner automatically searches for configuration in:
126+
- `.gotestsuiterc` (JSON)
127+
- `.gotestsuiterc.json`
128+
- `.gotestsuiterc.yaml` or `.gotestsuiterc.yml`
129+
- `.gotestsuiterc.js`, `.gotestsuiterc.mjs`, `.gotestsuiterc.cjs`
130+
- `gotestsuite.config.js`, `gotestsuite.config.mjs`, `gotestsuite.config.cjs`
131+
- `package.json` under the `"gotestsuite"` key
132+
133+
### Example Configuration
134+
135+
```json
136+
{
137+
"runtime": "node",
138+
"database": "sqlite",
139+
"categories": ["unit", "integration"],
140+
"parallel": true,
141+
"maxWorkers": 4,
142+
"timeout": 30000,
143+
"reporter": "default",
144+
"coverage": false,
145+
"telemetry": {
146+
"enabled": false
147+
},
148+
"notifications": {
149+
"enabled": false,
150+
"slack": {
151+
"webhook": "https://hooks.slack.com/services/...",
152+
"channel": "#test-results"
153+
}
154+
}
155+
}
156+
```
157+
158+
### Enterprise Features
159+
160+
#### Telemetry
161+
Track test runner usage and performance metrics:
162+
163+
```json
164+
{
165+
"telemetry": {
166+
"enabled": true,
167+
"endpoint": "https://api.yourcompany.com/telemetry",
168+
"apiKey": "your-api-key"
169+
}
170+
}
171+
```
172+
173+
#### Notifications
174+
Get notified when tests complete:
175+
176+
```json
177+
{
178+
"notifications": {
179+
"enabled": true,
180+
"slack": {
181+
"webhook": "https://hooks.slack.com/services/...",
182+
"channel": "#test-results"
183+
},
184+
"email": {
185+
"smtp": "smtp.yourcompany.com",
186+
"from": "tests@yourcompany.com",
187+
"to": ["dev-team@yourcompany.com"]
188+
}
189+
}
190+
}
191+
```
192+
193+
### CLI Options
194+
195+
All configuration options can be overridden via CLI flags:
196+
197+
```bash
198+
# Runtime and database
199+
bun run test-runner --runtime node --database sqlite
200+
201+
# Test selection
202+
bun run test-runner --categories unit,integration --reporter verbose
203+
204+
# Execution control
205+
bun run test-runner --parallel --max-workers 8 --timeout 60000
206+
207+
# Output control
208+
bun run test-runner --verbose --coverage --bail
209+
210+
# Watch mode for development
211+
bun run test-runner --watch --categories unit
212+
```
213+
214+
### Environment Variables
215+
216+
Set environment variables for test execution:
217+
218+
```json
219+
{
220+
"env": {
221+
"NODE_ENV": "test",
222+
"DEBUG": "app:*",
223+
"DATABASE_URL": "test.db"
224+
},
225+
"envFile": ".env.test"
226+
}
227+
```
228+
119229
## Core Testing Utilities
120230

121231
### Request Helpers

WARP.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@ This file provides guidance to WARP (warp.dev) when working with code in this re
5454
- Node/Bun-only interactive runner that discovers test files, groups by category (unit/integration/e2e/etc.), selects runtime/database, then shells out to `npx vitest` with the selected files and flags.
5555
- Not exported from the main index to maintain Cloudflare Workers compatibility (avoids Node-only APIs; see CHANGELOG note).
5656

57+
## Shared packages
58+
- go-test-suite: /Users/johnnymathis/Developer/go-test-suite
59+
- go-workflow-v2: /Users/johnnymathis/Developer/go-workflow-v2
60+
- go-utils: /Users/johnnymathis/Developer/go-utils
61+
62+
## Guidance for Warp
63+
- Before adding utilities/runners/workflows, check these repos for an existing implementation.
64+
- Consolidation rules:
65+
- go-utils: generic helpers/types/logging/config
66+
- go-test-suite: testing/Vitest helpers, runners, fixtures, factories
67+
- go-workflow-v2: workflow orchestration/execution, release pipelines
68+
- When duplication is detected, propose an extraction plan and PR outline to move code to the right package.
69+
5770
## Notes for Warp
5871

5972
- Prefer Bun for local development; all commands use bun.

0 commit comments

Comments
 (0)