Skip to content
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ jobs:
with:
name: harper-build-artifacts-node-${{ matrix.node-version }}

- name: Relink bin scripts
run: npm install --ignore-scripts

- name: Install harperdb@4 for legacy tests
run: |
mkdir -p /tmp/harperdb-legacy
Expand All @@ -171,7 +174,7 @@ jobs:
HARPER_INTEGRATION_TEST_LOG_DIR: /tmp/harper-integration-test-logs
HARPER_LEGACY_VERSION_PATH: /tmp/harperdb-legacy/node_modules/harperdb
run: |
npm run test:integration -- --shard=${{ matrix.shard }}/4
npm run test:integration:all -- --shard=${{ matrix.shard }}/4

- name: Upload Harper server logs
if: failure()
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Install dependencies using `npm install`

Build the project using `npm run build` or `npm run build:watch` to automatically rebuild on file changes.

Run integration tests using `npm run test:integration`. Make sure to read the [integration test instructions](./integrationTests/README.md) for setup requirements (particularly the loopback address configuration).
Run integration tests using `npm run test:integration:all`. For targeted runs or additional options, use `npm run test:integration -- <pattern>`. Make sure to read the [integration test instructions](./integrationTests/README.md) for setup requirements (particularly the loopback address configuration).

Run unit tests using `npm run test:unit <unit-test-file>` or `npm run test:unit:all`, but make sure to build the project first since unit tests depend on the built source files.

Expand Down
296 changes: 54 additions & 242 deletions integrationTests/README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion integrationTests/deploy/deploy-from-github.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
import { suite, test, before, after } from 'node:test';
import { deepStrictEqual, ok, strictEqual } from 'node:assert/strict';
import { startHarper, teardownHarper, type ContextWithHarper } from '../utils/harperLifecycle.ts';
import { startHarper, teardownHarper, type ContextWithHarper } from '@harperfast/integration-testing';
import { join } from 'node:path';
import { existsSync } from 'node:fs';
import { readFile } from 'node:fs/promises';
Expand Down
3 changes: 1 addition & 2 deletions integrationTests/deploy/deploy-from-source.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import { join } from 'node:path';
import { existsSync } from 'node:fs';
import { setTimeout as sleep } from 'node:timers/promises';

import { startHarper, teardownHarper, type ContextWithHarper } from '../utils/harperLifecycle.ts';
import { targz } from '../utils/targz.ts';
import { startHarper, teardownHarper, targz, type ContextWithHarper } from '@harperfast/integration-testing';

suite('Local application deployment', (ctx: ContextWithHarper) => {
before(async () => {
Expand Down
2 changes: 1 addition & 1 deletion integrationTests/security/crl-verification.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { join } from 'node:path';
import { tmpdir } from 'node:os';
import * as https from 'node:https';

import { setupHarperWithFixture, teardownHarper, type ContextWithHarper } from '../utils/harperLifecycle.ts';
import { setupHarperWithFixture, teardownHarper, type ContextWithHarper } from '@harperfast/integration-testing';
import {
generateCrlCertificates,
setupCrlServerWithCerts,
Expand Down
2 changes: 1 addition & 1 deletion integrationTests/security/ocsp-verification.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { join } from 'node:path';
import { tmpdir } from 'node:os';
import * as https from 'node:https';

import { setupHarperWithFixture, teardownHarper, type ContextWithHarper } from '../utils/harperLifecycle.ts';
import { setupHarperWithFixture, teardownHarper, type ContextWithHarper } from '@harperfast/integration-testing';
import {
setupOcspResponderWithCerts,
stopOcspResponder,
Expand Down
2 changes: 1 addition & 1 deletion integrationTests/server/crash-replay.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* database, so replay needs to work for harper to startup.
*/
import { suite, test, before, after } from 'node:test';
import { startHarper, teardownHarper, sendOperation, type ContextWithHarper } from '../utils/harperLifecycle.ts';
import { startHarper, teardownHarper, sendOperation, type ContextWithHarper } from '@harperfast/integration-testing';
import { equal } from 'node:assert';

suite('Transaction log replay on crash', (ctx: ContextWithHarper) => {
Expand Down
2 changes: 1 addition & 1 deletion integrationTests/server/operation-user-rbac.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import { suite, test, before, after } from 'node:test';
import { strictEqual, ok } from 'node:assert/strict';

import { startHarper, teardownHarper, type ContextWithHarper } from '../utils/harperLifecycle.ts';
import { startHarper, teardownHarper, type ContextWithHarper } from '@harperfast/integration-testing';

const DATABASE = 'test_db';
const TABLE = 'dogs';
Expand Down
2 changes: 1 addition & 1 deletion integrationTests/server/operations-server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { ok, strictEqual } from 'node:assert/strict';
import { pack, unpack } from 'msgpackr';
import { encode, decode } from 'cbor-x';

import { startHarper, teardownHarper, type ContextWithHarper } from '../utils/harperLifecycle.ts';
import { startHarper, teardownHarper, type ContextWithHarper } from '@harperfast/integration-testing';

suite('Operations Server', (ctx: ContextWithHarper) => {
before(async () => {
Expand Down
2 changes: 1 addition & 1 deletion integrationTests/server/storage-reclamation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { suite, test, before, after } from 'node:test';
import { ok, strictEqual } from 'node:assert/strict';
import { setTimeout as sleep } from 'node:timers/promises';

import { startHarper, teardownHarper, type ContextWithHarper } from '../utils/harperLifecycle.ts';
import { startHarper, teardownHarper, type ContextWithHarper } from '@harperfast/integration-testing';

const TEST_DATABASE = 'test';
const TEST_TABLE = 'reclaim';
Expand Down
2 changes: 1 addition & 1 deletion integrationTests/server/thread-management.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { suite, test, before, after } from 'node:test';
import { strictEqual } from 'node:assert/strict';

import { startHarper, teardownHarper, type ContextWithHarper } from '../utils/harperLifecycle.ts';
import { startHarper, teardownHarper, type ContextWithHarper } from '@harperfast/integration-testing';

suite('Thread Management', (ctx: ContextWithHarper) => {
before(async () => {
Expand Down
7 changes: 3 additions & 4 deletions integrationTests/upgrade/4.x-upgrade.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ import {
sendOperation,
type ContextWithHarper,
killHarper,
} from '../utils/harperLifecycle.ts';
} from '@harperfast/integration-testing';
import { ok } from 'node:assert';
import { join } from 'node:path';

suite('Start 4.x server and test upgrade', (ctx: ContextWithHarper) => {
const legacyPath = process.env.HARPER_LEGACY_VERSION_PATH;
suite('Start 4.x server and test upgrade', { skip: !legacyPath }, (ctx: ContextWithHarper) => {
before(async () => {
const legacyPath = process.env.HARPER_LEGACY_VERSION_PATH;
if (!legacyPath) return;
await startHarper(ctx, {
config: {},
env: {
Expand Down
Loading
Loading