test(integration): port blob lifecycle suite to harperLifecycle #2015
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Integration Tests | |
| on: | |
| push: | |
| branches: [main, 'v[0-9]+.[0-9]+'] | |
| pull_request: | |
| workflow_dispatch: | |
| inputs: | |
| node-version: | |
| description: 'Node.js version' | |
| required: true | |
| type: choice | |
| default: 'all' | |
| options: | |
| - 'all' | |
| - '20' | |
| - '22' | |
| - '24' | |
| jobs: | |
| generate-node-version-matrix: | |
| name: Generate Node Version Matrix | |
| runs-on: ubuntu-latest | |
| outputs: | |
| node-versions: ${{ steps.set-node-versions.outputs.node-versions }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set Node versions | |
| id: set-node-versions | |
| run: | | |
| if [ "${{ github.event.inputs.node-version }}" == "all" ] || [ -z "${{ github.event.inputs.node-version }}" ]; then | |
| echo "node-versions=[20, 22, 24]" >> $GITHUB_OUTPUT | |
| else | |
| echo "node-versions=[${{ github.event.inputs.node-version }}]" >> $GITHUB_OUTPUT | |
| fi | |
| build: | |
| name: Build Harper (Node.js v${{ matrix.node-version }}) | |
| needs: generate-node-version-matrix | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: ${{ fromJSON(needs.generate-node-version-matrix.outputs.node-versions) }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| package-manager-cache: false | |
| - name: Install dependencies | |
| run: npm install --ignore-scripts | |
| - name: Build | |
| run: npm run build || true # we currently have type errors so just ignore that | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: harper-build-artifacts-node-${{ matrix.node-version }} | |
| path: | | |
| dist/ | |
| static/ | |
| node_modules/ | |
| package.json | |
| retention-days: 1 | |
| run-integration-apiTests: | |
| name: Integration API Tests (Node.js v${{ matrix.node-version }}) | |
| needs: [generate-node-version-matrix, build] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: ${{ fromJSON(needs.generate-node-version-matrix.outputs.node-versions) }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| package-manager-cache: false | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: harper-build-artifacts-node-${{ matrix.node-version }} | |
| - name: Setup Harper | |
| env: | |
| DEFAULTS_MODE: 'dev' | |
| HDB_ADMIN_USERNAME: 'admin' | |
| HDB_ADMIN_PASSWORD: 'password' | |
| ROOTPATH: '/tmp/hdb' | |
| OPERATIONSAPI_NETWORK_PORT: 9925 | |
| LOGGING_LEVEL: 'debug' | |
| LOGGING_STDSTREAMS: true | |
| THREADS_COUNT: 1 | |
| THREADS_DEBUG: false | |
| NODE_HOSTNAME: 'localhost' | |
| run: | | |
| mkdir -p /tmp/hdb/log | |
| node ./dist/bin/harper.js install > /tmp/hdb/log/install-stdout.log 2> /tmp/hdb/log/install-stderr.log | |
| sleep 10 | |
| node ./dist/bin/harper.js start > /tmp/hdb/log/start-stdout.log 2> /tmp/hdb/log/start-stderr.log & | |
| sleep 10 | |
| - name: Run API Tests | |
| id: run-api-tests | |
| env: | |
| HDB_ADMIN_USERNAME: 'admin' | |
| HDB_ADMIN_PASSWORD: 'password' | |
| run: npm run test:integration:api-tests | |
| - name: Upload Harper logs | |
| if: failure() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: harper-integration-api-test-logs-node-${{ matrix.node-version }} | |
| path: /tmp/hdb/log/ | |
| retention-days: 3 | |
| if-no-files-found: ignore | |
| run-integration-apiTests-bun: | |
| name: Integration API Tests (Bun) | |
| if: false | |
| needs: [build] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: 24 | |
| package-manager-cache: false | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: harper-build-artifacts-node-24 | |
| - name: Setup Harper | |
| env: | |
| DEFAULTS_MODE: 'dev' | |
| HDB_ADMIN_USERNAME: 'admin' | |
| HDB_ADMIN_PASSWORD: 'password' | |
| ROOTPATH: '/tmp/hdb' | |
| OPERATIONSAPI_NETWORK_PORT: 9925 | |
| LOGGING_LEVEL: 'debug' | |
| LOGGING_STDSTREAMS: true | |
| THREADS_COUNT: 1 | |
| THREADS_DEBUG: false | |
| NODE_HOSTNAME: 'localhost' | |
| run: | | |
| mkdir -p /tmp/hdb/log | |
| node ./dist/bin/harper.js install > /tmp/hdb/log/install-stdout.log 2> /tmp/hdb/log/install-stderr.log | |
| sleep 10 | |
| bun ./dist/bin/harper.js start > /tmp/hdb/log/start-stdout.log 2> /tmp/hdb/log/start-stderr.log & | |
| sleep 10 | |
| - name: Run API Tests | |
| id: run-api-tests | |
| env: | |
| HDB_ADMIN_USERNAME: 'admin' | |
| HDB_ADMIN_PASSWORD: 'password' | |
| run: npm run test:integration:api-tests | |
| - name: Upload Harper logs | |
| if: failure() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: harper-integration-api-test-logs-bun | |
| path: /tmp/hdb/log/ | |
| retention-days: 3 | |
| if-no-files-found: ignore | |
| run-integration-apiTests-windows: | |
| name: Integration API Tests (Windows, Node.js v24) | |
| needs: [build-windows] | |
| runs-on: windows-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup Node.js 24 | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: 24 | |
| package-manager-cache: false | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: harper-build-artifacts-windows | |
| - name: Setup Harper | |
| env: | |
| DEFAULTS_MODE: 'dev' | |
| HDB_ADMIN_USERNAME: 'admin' | |
| HDB_ADMIN_PASSWORD: 'password' | |
| ROOTPATH: ${{ runner.temp }}/hdb | |
| OPERATIONSAPI_NETWORK_PORT: 9925 | |
| LOGGING_LEVEL: 'debug' | |
| LOGGING_STDSTREAMS: true | |
| THREADS_COUNT: 1 | |
| THREADS_DEBUG: false | |
| NODE_HOSTNAME: 'localhost' | |
| run: | | |
| New-Item -ItemType Directory -Force -Path ${{ runner.temp }}/hdb/log | |
| node ./dist/bin/harper.js install > ${{ runner.temp }}/hdb/log/install-stdout.log 2> ${{ runner.temp }}/hdb/log/install-stderr.log | |
| sleep 10 | |
| Start-Process node -ArgumentList "./dist/bin/harper.js start" -RedirectStandardOutput "${{ runner.temp }}/hdb/log/start-stdout.log" -RedirectStandardError "${{ runner.temp }}/hdb/log/start-stderr.log" -PassThru | |
| sleep 10 | |
| - name: Run API Tests | |
| id: run-api-tests | |
| env: | |
| HDB_ADMIN_USERNAME: 'admin' | |
| HDB_ADMIN_PASSWORD: 'password' | |
| run: npm run test:integration:api-tests | |
| - name: Upload Harper logs | |
| if: failure() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: harper-integration-api-test-logs-windows | |
| path: ${{ runner.temp }}/hdb/log/ | |
| retention-days: 3 | |
| if-no-files-found: ignore | |
| run-integration-tests: | |
| name: Integration Tests ${{matrix.shard}}/4 (Node.js v${{ matrix.node-version }}) | |
| runs-on: ubuntu-latest | |
| needs: [generate-node-version-matrix, build] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: ${{ fromJSON(needs.generate-node-version-matrix.outputs.node-versions) }} | |
| shard: [1, 2, 3, 4] | |
| exclude: | |
| - node-version: 20 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| package-manager-cache: false | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| 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 | |
| npm install --ignore-scripts --prefix /tmp/harperdb-legacy harperdb@4 | |
| - name: Run Integration Test Shard ${{ matrix.shard }} | |
| env: | |
| HARPER_INTEGRATION_TEST_LOG_DIR: /tmp/harper-integration-test-logs | |
| HARPER_LEGACY_VERSION_PATH: /tmp/harperdb-legacy/node_modules/harperdb | |
| HARPER_INTEGRATION_TEST_INSTALL_SCRIPT: dist/bin/harper.js | |
| run: | | |
| npm run test:integration:all -- --shard=${{ matrix.shard }}/4 | |
| - name: Upload Harper server logs | |
| if: failure() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: harper-server-logs-node-${{ matrix.node-version }}-shard-${{ matrix.shard }} | |
| path: /tmp/harper-integration-test-logs/ | |
| retention-days: 3 | |
| if-no-files-found: ignore | |
| build-windows: | |
| name: Build Harper (Windows, Node.js v24) | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup Node.js 24 | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: 24 | |
| package-manager-cache: false | |
| - name: Install dependencies | |
| run: npm install --ignore-scripts | |
| - name: Build | |
| run: npm run build | |
| continue-on-error: true # we currently have type errors so just ignore that | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: harper-build-artifacts-windows | |
| path: | | |
| dist/ | |
| static/ | |
| node_modules/ | |
| package.json | |
| retention-days: 1 | |
| run-integration-tests-windows: | |
| name: Integration Tests ${{matrix.shard}}/4 (Windows, Node.js v24) | |
| runs-on: windows-latest | |
| needs: [build-windows] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| shard: [1, 2, 3, 4] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup Node.js 24 | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: 24 | |
| package-manager-cache: false | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: harper-build-artifacts-windows | |
| - name: Relink bin scripts | |
| run: npm install --ignore-scripts | |
| - name: Install harperdb@4 for legacy tests | |
| run: npm install --ignore-scripts --prefix "${{ runner.temp }}/harperdb-legacy" harperdb@4 | |
| - name: Run Integration Test Shard ${{ matrix.shard }} | |
| env: | |
| HARPER_INTEGRATION_TEST_LOG_DIR: ${{ runner.temp }}/harper-integration-test-logs | |
| HARPER_LEGACY_VERSION_PATH: ${{ runner.temp }}/harperdb-legacy/node_modules/harperdb | |
| HARPER_INTEGRATION_TEST_INSTALL_SCRIPT: dist/bin/harper.js | |
| # Windows runners are noticeably slower than the Linux pool — the | |
| # default 60s startHarper timeout is not enough for the per-test | |
| # install + start sequence (see CRL fail-closed-timeout suite). | |
| HARPER_INTEGRATION_TEST_STARTUP_TIMEOUT_MS: 180000 | |
| run: npm run test:integration:all -- --shard=${{ matrix.shard }}/4 | |
| - name: Upload Harper server logs | |
| if: failure() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: harper-server-logs-windows-shard-${{ matrix.shard }} | |
| path: ${{ runner.temp }}/harper-integration-test-logs/ | |
| retention-days: 3 | |
| if-no-files-found: ignore | |
| run-integration-tests-bun: | |
| name: Integration Tests ${{matrix.shard}}/4 (Bun) | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| shard: [1, 2, 3, 4] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: 24 | |
| package-manager-cache: false | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: harper-build-artifacts-node-24 | |
| - name: Relink bin scripts | |
| run: npm install --ignore-scripts | |
| - name: Run Integration Test Shard ${{ matrix.shard }} | |
| env: | |
| HARPER_INTEGRATION_TEST_LOG_DIR: /tmp/harper-integration-test-logs | |
| HARPER_RUNTIME: bun | |
| HARPER_INTEGRATION_TEST_INSTALL_SCRIPT: dist/bin/harper.js | |
| run: | | |
| npm run test:integration:all -- --shard=${{ matrix.shard }}/4 | |
| - name: Upload Harper server logs | |
| if: failure() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: harper-server-logs-bun-shard-${{ matrix.shard }} | |
| path: /tmp/harper-integration-test-logs/ | |
| retention-days: 3 | |
| if-no-files-found: ignore |