Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
c367156
Demo moving to vite for realm server tests
IanCal Feb 28, 2026
e1ecdc7
Auto convert tests
IanCal Mar 18, 2026
576a3aa
Move to vitest for realm server tests, point default commands to it
IanCal Mar 18, 2026
52c34a5
first pass vitest in ci
IanCal Mar 18, 2026
7b81346
Don't lint test shards any more
IanCal Mar 18, 2026
b161173
Try using the wait for servers command
IanCal Mar 18, 2026
1737f17
Cut down running for testing in ci
IanCal Mar 18, 2026
51b9679
just have waiting in the ci where it's needed for now
IanCal Mar 18, 2026
b5e0809
Fix artifact naming
IanCal Mar 18, 2026
5f48462
Don't care about the test realm
IanCal Mar 18, 2026
bb149d7
Pass through shard to test properly
IanCal Mar 18, 2026
138b394
Run all realm server tests even if a shard fails
IanCal Mar 18, 2026
b63ad49
try six shards
IanCal Mar 23, 2026
b2e3e41
Fixing codemod formatting issues
IanCal Mar 23, 2026
8a4d0be
More code formatting fixes after codemod
IanCal Mar 23, 2026
85cba38
Move shared tests into vitest
IanCal Mar 23, 2026
37279bd
Don't pass through asserts
IanCal Mar 23, 2026
2594305
Use vitest native mocking/stubbing
IanCal Mar 23, 2026
6f7d648
Assert and formatting fixes
IanCal Mar 23, 2026
32edb50
formatting and expect fix
IanCal Mar 23, 2026
d461704
Formatting issues
IanCal Mar 23, 2026
f52d59f
bump vitest to latest
IanCal Mar 23, 2026
862136b
use expect
IanCal Mar 23, 2026
6eb2d5f
improve assert
IanCal Mar 23, 2026
4b4933a
formatting
IanCal Mar 23, 2026
f55feab
This was never checking the actual error message coming back, strings…
IanCal Mar 23, 2026
8332cfd
lint fixes
IanCal Mar 23, 2026
3894492
lint, unused vars
IanCal Mar 23, 2026
52f10ae
Remove references to test realm
IanCal Mar 25, 2026
9c7a12d
Fix relative links for friends
IanCal Mar 25, 2026
f3593e4
Fix relative friends links
IanCal Mar 25, 2026
8ddb000
Improve gha integration
IanCal Mar 25, 2026
404008b
Try and merge blob reports
IanCal Mar 25, 2026
ac4186e
Merge reports correctly
IanCal Mar 25, 2026
5ce7fe9
Deliberate test error
IanCal Mar 25, 2026
5a71af4
break a vite test
IanCal Mar 25, 2026
43712b8
explicitly set reporter for ci realm server tests
IanCal Mar 25, 2026
523fb3c
correct folder
IanCal Mar 25, 2026
6dc648e
Only use gha reporter on the merged result
IanCal Mar 25, 2026
6dfc860
chore: regenerate pnpm-lock.yaml after rebase on main
Mar 30, 2026
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
10 changes: 0 additions & 10 deletions .github/workflows/ci-host.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@ on:
pull_request:
paths:
- "packages/host/**"
- "packages/base/**"
- "packages/boxel-icons/**"
- "packages/boxel-ui/**"
- "packages/catalog-realm/**"
- "packages/eslint-plugin-boxel/**"
- "packages/realm-server/**"
- "packages/runtime-common/**"
- ".github/workflows/ci-host.yaml"
- "package.json"
- "pnpm-lock.yaml"
workflow_dispatch:

permissions:
Expand Down
156 changes: 76 additions & 80 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -494,85 +494,13 @@ jobs:
if: needs.change-check.outputs.realm-server == 'true' || github.ref == 'refs/heads/main' || needs.change-check.outputs.run_all == 'true'
runs-on: ubuntu-latest
concurrency:
group: realm-server-test-${{ matrix.testModule }}-${{ github.head_ref || github.run_id }}
group: realm-server-test-${{ matrix.shardIndex }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
testModule:
[
"auth-client-test.ts",
"billing-test.ts",
"card-dependencies-endpoint-test.ts",
"card-endpoints-test.ts",
"card-reference-resolver-test.ts",
"card-source-endpoints-test.ts",
"definition-lookup-test.ts",
"file-watcher-events-test.ts",
"indexing-event-sink-test.ts",
"indexing-test.ts",
"runtime-dependency-tracker-test.ts",
"transpile-test.ts",
"module-syntax-test.ts",
"node-realm-test.ts",
"permissions/permission-checker-test.ts",
"prerendering-test.ts",
"prerender-server-test.ts",
"prerender-manager-test.ts",
"prerender-proxy-test.ts",
"remote-prerenderer-test.ts",
"queue-test.ts",
"realm-endpoints/cancel-indexing-job-test.ts",
"realm-endpoints/dependencies-test.ts",
"realm-endpoints/directory-test.ts",
"realm-endpoints/info-test.ts",
"realm-endpoints/invalidate-urls-test.ts",
"realm-endpoints/lint-test.ts",
"realm-endpoints/mtimes-test.ts",
"realm-endpoints/permissions-test.ts",
"realm-endpoints/publishability-test.ts",
"realm-endpoints/reindex-test.ts",
"realm-endpoints/search-test.ts",
"realm-endpoints/user-test.ts",
"realm-endpoints-test.ts",
"sanitize-head-html-test.ts",
"search-prerendered-test.ts",
"types-endpoint-test.ts",
"server-config-test.ts",
"server-endpoints/authentication-test.ts",
"server-endpoints/bot-commands-test.ts",
"server-endpoints/bot-registration-test.ts",
"server-endpoints/delete-realm-test.ts",
"server-endpoints/download-realm-test.ts",
"server-endpoints/index-responses-test.ts",
"server-endpoints/maintenance-endpoints-test.ts",
"server-endpoints/queue-status-test.ts",
"server-endpoints/realm-lifecycle-test.ts",
"server-endpoints/search-test.ts",
"server-endpoints/info-test.ts",
"server-endpoints/search-prerendered-test.ts",
"server-endpoints/stripe-session-test.ts",
"server-endpoints/stripe-webhook-test.ts",
"server-endpoints/user-and-catalog-test.ts",
"server-endpoints/incoming-webhook-test.ts",
"server-endpoints/webhook-commands-test.ts",
"server-endpoints/webhook-receiver-test.ts",
"server-endpoints/federated-types-test.ts",
"virtual-network-test.ts",
"atomic-endpoints-test.ts",
"request-forward-test.ts",
"publish-unpublish-realm-test.ts",
"boxel-domain-availability-test.ts",
"claim-boxel-domain-test.ts",
"command-parsing-utils-test.ts",
"delete-boxel-claimed-domain-test.ts",
"get-boxel-claimed-domain-test.ts",
"realm-auth-test.ts",
"run-command-task-test.ts",
"queries-test.ts",
"session-room-queries-test.ts",
"full-reindex-test.ts",
]
shardIndex: [1, 2, 3, 4, 5, 6]
shardTotal: [6]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/init
Expand All @@ -591,20 +519,44 @@ jobs:
- name: create realm users
run: pnpm register-realm-users
working-directory: packages/matrix
- name: Wait for realm servers to be ready
shell: bash
run: |
set -euo pipefail

wait_for_url() {
local name="$1"
local url="$2"
local max_attempts="${3:-180}"

for ((attempt=1; attempt<=max_attempts; attempt++)); do
if curl --silent --show-error --fail --output /dev/null "$url"; then
echo "$name is ready"
return 0
fi

echo "Waiting for $name ($attempt/$max_attempts): $url"
sleep 5
done

echo "Timed out waiting for $name: $url" >&2
return 1
}

wait_for_url "base realm" "http://localhost:4201/base/_readiness-check?acceptHeader=application%2Fvnd.api%2Bjson"
wait_for_url "synapse" "http://localhost:8008"
wait_for_url "smtp4dev" "http://localhost:5001"
- name: realm server test suite
run: pnpm test:wait-for-servers
run: pnpm test --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
working-directory: packages/realm-server
env:
TEST_MODULE: ${{matrix.testModule}}
- name: Print realm server logs
if: ${{ !cancelled() }}
run: cat /tmp/server.log
- name: Prepare artifact name
id: artifact_name
if: ${{ !cancelled() }}
run: |
export SAFE_ARTIFACT_NAME=$(echo ${{ matrix.testModule }} | sed 's/[/]/_/g')
echo "artifact_name=$SAFE_ARTIFACT_NAME" >> "$GITHUB_OUTPUT"
echo "artifact_name=shard_${{ matrix.shardIndex }}" >> "$GITHUB_OUTPUT"
- name: Extract worker and prerender logs
if: ${{ !cancelled() }}
run: |
Expand Down Expand Up @@ -671,6 +623,48 @@ jobs:
name: realm-server-test-host-dist-log-${{steps.artifact_name.outputs.artifact_name}}
path: /tmp/host-dist.log
retention-days: 30
- name: Upload blob report to GitHub Actions Artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # 4.6.1
with:
name: blob-report-${{ matrix.shardIndex }}
path: packages/realm-server/.vitest-reports/*
include-hidden-files: true
retention-days: 1
- name: Upload attachments to GitHub Actions Artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # 4.6.1
with:
name: blob-attachments-${{ matrix.shardIndex }}
path: packages/realm-server/.vitest-attachments/**
include-hidden-files: true
retention-days: 1
merge-realm-server-test-reports:
if: ${{ !cancelled() }}
needs: [realm-server-test]

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/init

- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@b14cf4c92620c250e1c074ab0a5800e37df86765 # 4.2.0
with:
path: packages/realm-server/.vitest-reports
pattern: blob-report-*
merge-multiple: true

- name: Download attachments from GitHub Actions Artifacts
uses: actions/download-artifact@b14cf4c92620c250e1c074ab0a5800e37df86765 # 4.2.0
with:
path: packages/realm-server/.vitest-attachments
pattern: blob-attachments-*
merge-multiple: true

- name: Merge reports
working-directory: packages/realm-server
run: pnpm vitest run --merge-reports --reporter='github-actions'

software-factory-test:
name: Software Factory Tests
Expand Down Expand Up @@ -836,3 +830,5 @@ jobs:
secrets: inherit
with:
environment: "staging"


11 changes: 7 additions & 4 deletions packages/realm-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,24 @@
"typescript-memoize": "catalog:",
"undici": "catalog:",
"uuid": "catalog:",
"vitest": "catalog:",
"wait-for-localhost-cli": "catalog:",
"yaml": "catalog:",
"yargs": "catalog:"
},
"scripts": {
"test": "./tests/scripts/run-qunit-with-test-pg.sh",
"test-module": "./tests/scripts/run-qunit-with-test-pg.sh --module ${TEST_MODULE}",
"test": "./tests-vitest/scripts/run-vitest-with-test-pg.sh",
"test:vitest": "./tests/scripts/prepare-test-pg.sh && LOG_LEVELS=\"*=error,prerenderer-chrome=silent,pg-adapter=warn,realm:requests=warn${LOG_LEVELS:+,}${LOG_LEVELS}\" NODE_NO_WARNINGS=1 PGPORT=55436 STRIPE_WEBHOOK_SECRET=stripe-webhook-secret STRIPE_API_KEY=stripe-api-key vitest run --config vitest.config.mjs",
"test:vitest:watch": "vitest --config vitest.config.mjs",
"test:vitest:sanitize-head-html": "vitest run --config vitest.config.mjs tests-vitest/sanitize-head-html.test.ts",
"test:vitest:realm-auth": "./tests/scripts/prepare-test-pg.sh && LOG_LEVELS=\"*=error,prerenderer-chrome=silent,pg-adapter=warn,realm:requests=warn${LOG_LEVELS:+,}${LOG_LEVELS}\" NODE_NO_WARNINGS=1 PGPORT=55436 STRIPE_WEBHOOK_SECRET=stripe-webhook-secret STRIPE_API_KEY=stripe-api-key vitest run --config vitest.config.mjs tests-vitest/realm-auth.test.ts",
"migrate": "NODE_NO_WARNINGS=1 ts-node --transpileOnly scripts/run-migrations.ts",
"start:matrix": "./scripts/start-matrix.sh",
"start:smtp": "cd ../matrix && pnpm assert-smtp-running",
"start:icons": "mise run services:icons",
"start:host-dist": "./scripts/start-host-dist.sh",
"start:pg": "./scripts/start-pg.sh",
"stop:pg": "./scripts/stop-pg.sh",
"test:wait-for-servers": "WAIT_ON_TIMEOUT=900000 NODE_NO_WARNINGS=1 start-server-and-test 'pnpm run wait' 'http-get://localhost:4201/base/_readiness-check?acceptHeader=application%2Fvnd.api%2Bjson' 'pnpm run wait' 'http-get://localhost:4202/node-test/_readiness-check?acceptHeader=application%2Fvnd.api%2Bjson|http://localhost:8008|http://localhost:5001' 'test-module'",
"setup:base-in-deployment": "mkdir -p /persistent/base && rsync --dry-run --itemize-changes --checksum --recursive --delete ../base/. /persistent/base/ && rsync --checksum --recursive --delete ../base/. /persistent/base/",
"setup:experiments-in-deployment": "mkdir -p /persistent/experiments && rsync --dry-run --itemize-changes --checksum --recursive ../experiments-realm/. /persistent/experiments/ && rsync --checksum --recursive ../experiments-realm/. /persistent/experiments/",
"setup:catalog-in-deployment": "mkdir -p /persistent/catalog && rsync --dry-run --itemize-changes --checksum --recursive --delete ../catalog-realm/. /persistent/catalog/ && rsync --checksum --recursive --delete ../catalog-realm/. /persistent/catalog/",
Expand Down Expand Up @@ -131,7 +134,7 @@
"lint:js": "eslint . --report-unused-disable-directives --cache",
"lint:js:fix": "eslint . --report-unused-disable-directives --fix",
"lint:glint": "glint",
"lint:test-shards": "ts-node --transpileOnly scripts/lint-test-shards.ts",
"codemod:qunit-to-vitest": "ts-node --transpileOnly scripts/codemods/qunit-to-vitest.ts",
"full-reset": "./scripts/full-reset.sh",
"full-reindex": "./scripts/full-reindex.sh",
"clear-modules-cache": "NODE_NO_WARNINGS=1 PGDATABASE=${PGDATABASE:-boxel} PGPORT=${PGPORT:-5435} ts-node --transpileOnly scripts/clear-modules-cache.ts",
Expand Down
Loading
Loading