You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: integrationTests/README.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,6 +118,30 @@ This option is used by the CI workflow and is useful for executing the same subs
118
118
119
119
This option can be overridden using the `HARPER_INTEGRATION_TEST_SHARD` environment variable.
120
120
121
+
### Server Log Capture
122
+
123
+
When `HARPER_INTEGRATION_TEST_LOG_DIR` is set, each Harper instance writes its logs (`hdb.log`, `stdout.log`, `stderr.log`) to a per-suite subdirectory under the specified path. Directory names are derived from the suite name and loopback address (e.g. `Operations_Server-127_0_0_2/`).
124
+
125
+
This is primarily designed for CI, where Harper's child process output is not visible in the GitHub Actions UI. On test failure, the log directory is uploaded as an artifact for debugging.
126
+
127
+
**Important:** When this setting is active, it overrides any `logging.root` value in the Harper config passed via `options.config`. The suite log directory takes precedence so that logs are captured in a known, per-suite location.
128
+
129
+
Logs from passing suites are automatically cleaned up on process exit. Only logs from failed suites are preserved.
130
+
131
+
```sh
132
+
# Local usage
133
+
HARPER_INTEGRATION_TEST_LOG_DIR=/tmp/harper-test-logs npm run test:integration
134
+
135
+
# Inspect logs after a failure
136
+
ls /tmp/harper-test-logs/
137
+
# Operations_Server-127_0_0_2/
138
+
# hdb.log
139
+
# stdout.log
140
+
# stderr.log
141
+
```
142
+
143
+
---
144
+
121
145
#### `--only`
122
146
123
147
> Equivalent to Node.js Test Runner's [`--test-only`](https://nodejs.org/docs/latest-v24.x/api/cli.html#--test-only) option.
* Timeout in milliseconds to wait for Harper to start.
77
-
* @default30000
78
-
*/
79
73
startupTimeoutMs?:number;
80
-
/**
81
-
* Additional configuration options to pass to the Harper CLI.
82
-
*/
83
74
config:any;
84
-
/**
85
-
* Environment variables to set when running Harper.
86
-
*/
87
75
env:any;
88
76
}
89
77
```
90
78
91
79
**Properties:**
92
80
93
-
30000 (5 seconds), or the value of the `HARPER_INTEGRATION_TEST_STARTUP_TIMEOUT_MS` environment variable if set.
94
-
95
81
-**`config`** - `object` (optional) - Additional configuration options to pass to the Harper CLI.
96
82
-**`env`** - `object` (optional) - Additional environment variables to set when starting Harper.
97
-
-**`startupTimeoutMs`** - `number` (optional) - Timeout in milliseconds to wait for Harper to start. Defaults to
83
+
-**`startupTimeoutMs`** - `number` (optional) - Timeout in milliseconds to wait for Harper to start. Defaults to 30000, or the value of the `HARPER_INTEGRATION_TEST_STARTUP_TIMEOUT_MS` environment variable if set.
0 commit comments