Skip to content

Commit 726f466

Browse files
authored
Merge pull request #217 from HarperFast/integration-test-upd
updating integration test action versions, minor integration test uti…
2 parents b8a574e + e98f397 commit 726f466

3 files changed

Lines changed: 30 additions & 20 deletions

File tree

.github/workflows/integration-tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
run: npm run build || true # we currently have type errors so just ignore that
6565

6666
- name: Upload build artifacts
67-
uses: actions/upload-artifact@v4
67+
uses: actions/upload-artifact@v7
6868
with:
6969
name: harper-build-artifacts-node-${{ matrix.node-version }}
7070
path: |
@@ -95,7 +95,7 @@ jobs:
9595
package-manager-cache: false
9696

9797
- name: Download build artifacts
98-
uses: actions/download-artifact@v4
98+
uses: actions/download-artifact@v8
9999
with:
100100
name: harper-build-artifacts-node-${{ matrix.node-version }}
101101

@@ -126,7 +126,7 @@ jobs:
126126

127127
- name: Upload Harper logs
128128
if: steps.run-api-tests.outcome == 'failure'
129-
uses: actions/upload-artifact@v4
129+
uses: actions/upload-artifact@v7
130130
with:
131131
name: harper-integration-api-test-logs-node-${{ matrix.node-version }}
132132
path: /tmp/hdb/log/hdb.log
@@ -155,7 +155,7 @@ jobs:
155155
package-manager-cache: false
156156

157157
- name: Download build artifacts
158-
uses: actions/download-artifact@v4
158+
uses: actions/download-artifact@v8
159159
with:
160160
name: harper-build-artifacts-node-${{ matrix.node-version }}
161161

@@ -167,7 +167,7 @@ jobs:
167167
168168
- name: Upload Harper server logs
169169
if: failure()
170-
uses: actions/upload-artifact@v4
170+
uses: actions/upload-artifact@v7
171171
with:
172172
name: harper-server-logs-node-${{ matrix.node-version }}-shard-${{ matrix.shard }}
173173
path: /tmp/harper-integration-test-logs/

integrationTests/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,30 @@ This option is used by the CI workflow and is useful for executing the same subs
118118

119119
This option can be overridden using the `HARPER_INTEGRATION_TEST_SHARD` environment variable.
120120

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+
121145
#### `--only`
122146

123147
> Equivalent to Node.js Test Runner's [`--test-only`](https://nodejs.org/docs/latest-v24.x/api/cli.html#--test-only) option.

integrationTests/utils/README.md

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -68,33 +68,19 @@ suite('My test suite', (ctx: ContextWithHarper) => {
6868

6969
Configuration options for `setupHarper()`.
7070

71-
**Interface Definition:**
72-
7371
```typescript
7472
export interface SetupHarperOptions {
75-
/**
76-
* Timeout in milliseconds to wait for Harper to start.
77-
* @default 30000
78-
*/
7973
startupTimeoutMs?: number;
80-
/**
81-
* Additional configuration options to pass to the Harper CLI.
82-
*/
8374
config: any;
84-
/**
85-
* Environment variables to set when running Harper.
86-
*/
8775
env: any;
8876
}
8977
```
9078

9179
**Properties:**
9280

93-
30000 (5 seconds), or the value of the `HARPER_INTEGRATION_TEST_STARTUP_TIMEOUT_MS` environment variable if set.
94-
9581
- **`config`** - `object` (optional) - Additional configuration options to pass to the Harper CLI.
9682
- **`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.
9884

9985
**Environment Variables:**
10086

0 commit comments

Comments
 (0)