Skip to content

Commit 6875e54

Browse files
committed
Revert runtime param and just skip upgrade test for bun
1 parent 730fc88 commit 6875e54

4 files changed

Lines changed: 13 additions & 21 deletions

File tree

integrationTests/security/crl-verification.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ suite(
3636
let crlServer: CrlServerContext | null = null;
3737
let certsPath: string; // Track separately for cleanup even if server is stopped
3838
if (testsBun) return; // no Bun testing for now
39+
3940
before(async () => {
4041
// 1. Create temp directory for certificates
4142
certsPath = await mkdtemp(join(tmpdir(), 'harper-crl-test-'));
@@ -174,6 +175,7 @@ suite(
174175
suite('CRL Certificate Verification - Disabled', (ctx: ContextWithHarper) => {
175176
let certsPath: string;
176177
let certs: CrlCertificates;
178+
if (testsBun) return; // no Bun testing for now
177179

178180
before(async () => {
179181
certsPath = await mkdtemp(join(tmpdir(), 'harper-crl-disabled-'));
@@ -233,6 +235,7 @@ suite('CRL Certificate Verification - Disabled', (ctx: ContextWithHarper) => {
233235
suite('CRL Certificate Verification - Fail-Open Mode', (ctx: ContextWithHarper) => {
234236
let certsPath: string;
235237
let certs: CrlCertificates;
238+
if (testsBun) return; // no Bun testing for now
236239

237240
before(async () => {
238241
certsPath = await mkdtemp(join(tmpdir(), 'harper-crl-failopen-'));
@@ -291,6 +294,7 @@ suite('CRL Certificate Verification - Fail-Open Mode', (ctx: ContextWithHarper)
291294
suite('CRL Certificate Verification - Fail-Closed with Timeout', (ctx: ContextWithHarper) => {
292295
let certsPath: string;
293296
let certs: CrlCertificates;
297+
if (testsBun) return; // no Bun testing for now
294298

295299
before(async () => {
296300
certsPath = await mkdtemp(join(tmpdir(), 'harper-crl-timeout-'));

integrationTests/security/ocsp-verification.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ suite(
167167
suite('OCSP Certificate Verification - Disabled', (ctx: ContextWithHarper) => {
168168
let certsPath: string;
169169
let certs: OcspCertificates;
170+
if (testsBun) return; // no Bun testing for now
170171

171172
before(async () => {
172173
certsPath = await mkdtemp(join(tmpdir(), 'harper-ocsp-disabled-'));
@@ -226,6 +227,7 @@ suite('OCSP Certificate Verification - Disabled', (ctx: ContextWithHarper) => {
226227
suite('OCSP Certificate Verification - Fail-Open Mode', (ctx: ContextWithHarper) => {
227228
let certsPath: string;
228229
let certs: OcspCertificates;
230+
if (testsBun) return; // no Bun testing for now
229231

230232
before(async () => {
231233
certsPath = await mkdtemp(join(tmpdir(), 'harper-ocsp-failopen-'));
@@ -284,6 +286,7 @@ suite('OCSP Certificate Verification - Fail-Open Mode', (ctx: ContextWithHarper)
284286
suite('OCSP Certificate Verification - Fail-Closed with Timeout', (ctx: ContextWithHarper) => {
285287
let certsPath: string;
286288
let certs: OcspCertificates;
289+
if (testsBun) return; // no Bun testing for now
287290

288291
before(async () => {
289292
certsPath = await mkdtemp(join(tmpdir(), 'harper-ocsp-timeout-'));

integrationTests/upgrade/4.x-upgrade.test.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,20 @@ import {
1212
} from '../utils/harperLifecycle.ts';
1313
import { ok } from 'node:assert';
1414
import { join } from 'node:path';
15-
import { setTimeout as delay } from 'node:timers/promises';
15+
const testsBun = process.env.HARPER_RUNTIME === 'bun';
1616

1717
suite('Start 4.x server and test upgrade', (ctx: ContextWithHarper) => {
18+
const legacyPath = process.env.HARPER_LEGACY_VERSION_PATH;
19+
if (!legacyPath || testsBun) return;
1820
before(async () => {
19-
const legacyPath = process.env.HARPER_LEGACY_VERSION_PATH;
20-
if (!legacyPath) return;
2121
await startHarper(ctx, {
2222
config: {},
2323
env: {
2424
TC_AGREEMENT: 'yes',
2525
REPLICATION_HOSTNAME: 'localhost',
2626
},
2727
harperBinPath: join(legacyPath, 'bin', 'harperdb.js'),
28-
harperRuntime: 'node', // legacy harperdb.js is node only
2928
});
30-
console.log('Started legacy harper on node', ctx.harper);
3129
await sendOperation(ctx.harper, {
3230
operation: 'create_table',
3331
table: 'test',
@@ -59,10 +57,7 @@ suite('Start 4.x server and test upgrade', (ctx: ContextWithHarper) => {
5957

6058
test('upgrade and start', async () => {
6159
await killHarper(ctx); // kill old 4.x harper
62-
console.log('Killed legacy harper on node', ctx.harper);
63-
6460
await startHarper(ctx, { config: {}, env: {} }); // start on v5
65-
console.log('Starting new harper on node', ctx.harper);
6661
let response = await sendOperation(ctx.harper, {
6762
operation: 'search_by_conditions',
6863
table: 'test',

integrationTests/utils/harperLifecycle.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@ export interface StartHarperOptions {
4545
* Version of Harper to install and use for this test suite.
4646
*/
4747
harperBinPath?: string;
48-
/**
49-
* Runtime environment for Harper ('node' or 'bun').
50-
* Set via the HARPER_RUNTIME environment variable ('node' or 'bun').
51-
* Defaults to 'node'.
52-
*/
53-
harperRuntime?: string;
5448
}
5549

5650
export interface HarperContext {
@@ -120,7 +114,6 @@ interface RunHarperCommandOptions {
120114
/** When set, stdout and stderr are written to files in this directory */
121115
logDir?: string;
122116
harperBinPath?: string; // an explicit location installation of a harper package's bin module
123-
harperRuntime?: string;
124117
}
125118

126119
/**
@@ -137,16 +130,14 @@ function runHarperCommand({
137130
completionMessage,
138131
logDir,
139132
harperBinPath,
140-
harperRuntime,
141133
}: RunHarperCommandOptions): Promise<ChildProcess> {
142134
const harperScript = getHarperScript(harperBinPath);
143-
harperRuntime ??= HARPER_RUNTIME;
135+
const runtime = HARPER_RUNTIME;
144136
const runtimeArgs =
145-
harperRuntime === 'bun'
137+
runtime === 'bun'
146138
? [harperScript, ...args]
147139
: ['--trace-warnings', '--force-node-api-uncaught-exceptions-policy=true', harperScript, ...args];
148-
console.log('running', harperRuntime, runtimeArgs);
149-
const proc = spawn(harperRuntime, runtimeArgs, {
140+
const proc = spawn(runtime, runtimeArgs, {
150141
env: { ...process.env, ...env },
151142
});
152143

@@ -336,7 +327,6 @@ export async function startHarper(ctx: ContextWithHarper, options?: StartHarperO
336327
env: harperEnv,
337328
completionMessage: 'successfully started',
338329
logDir,
339-
harperRuntime: options?.harperRuntime,
340330
harperBinPath: options?.harperBinPath,
341331
});
342332

0 commit comments

Comments
 (0)