v0.7.1 Surface Runner Framework
All checks were successful
CI/CD / detect-changes (pull_request) Successful in 23s
CI/CD / test-frontend (pull_request) Successful in 26s
CI/CD / test-go-pg (pull_request) Successful in 2m35s
CI/CD / test-sqlite (pull_request) Successful in 3m19s
CI/CD / build-and-deploy (pull_request) Successful in 1m46s
All checks were successful
CI/CD / detect-changes (pull_request) Successful in 23s
CI/CD / test-frontend (pull_request) Successful in 26s
CI/CD / test-go-pg (pull_request) Successful in 2m35s
CI/CD / test-sqlite (pull_request) Successful in 3m19s
CI/CD / build-and-deploy (pull_request) Successful in 1m46s
sw.testing SDK module — structured test framework for surface runners: - suite/test registration, lifecycle hooks (beforeAll/afterAll/beforeEach/afterEach) - Assertion library (ok/eq/neq/gt/match/throws/status/shape/arrayOf) - Auto-cleanup via track(type, id) with LIFO deletion - Three result statuses: passed/failed/warned - Structured JSON results with timing, warnings, cleanup stats test-runner manifest type: - ValidateManifest accepts "test-runner" packages - Excluded from sidebar nav (extensionNavItems filters surface/full only) - DB migrations: SQLite 013, Postgres 014 (CHECK constraint) ICD runner migration (kernel-only): - Migrated from T.test()/T.assert() to sw.testing.suite() - Stripped extension-dependent tests (channels, notes, personas, etc.) - Kernel suites: smoke, crud, authz, security, providers, packaging, sdk - Deleted ui.js + css (rendering delegated to registry surface) SDK runner migration (kernel-only): - Migrated from T.dualTest()/T.domains to sw.testing.suite() - Stripped extension domains (belong in v0.7.2 package runners) - Kernel suites: misc, workflows, admin, packages, connections, deps, composition Runner registry surface (/s/test-runners): - Admin-only dashboard discovering test-runner packages - Run All / per-runner Run buttons, real-time results - Export Failures / Export Full Results (JSON download) - Dark mode styling using kernel CSS variables - Suite count polling for async runner script loading 141 passed, 0 failed on fresh minimal install. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,25 +1,21 @@
|
||||
/**
|
||||
* SDK Test Runner — Entry Point
|
||||
*
|
||||
* Boot SDK, set up SDKR namespace, load modules via script tags,
|
||||
* then redirect to the test-runners registry surface.
|
||||
*
|
||||
* Load order:
|
||||
* 1. framework.js — dual-path harness, assertions, raw fetch
|
||||
* 2. shapes.js — ICD response shapes
|
||||
* 3. domains/*.js — per-domain test suites (register on T.domains)
|
||||
* 4. ui.js — render functions
|
||||
* 5. (this file) — boot
|
||||
* 1. framework.js — dual-path utilities, assertions, raw fetch
|
||||
* 2. shapes.js — ICD response shapes
|
||||
* 3. fixtures.js — provision/teardown helpers
|
||||
* 4. domains/*.js — per-domain suites (register via sw.testing.suite())
|
||||
*/
|
||||
(async function () {
|
||||
'use strict';
|
||||
|
||||
var mount = document.getElementById('extension-mount');
|
||||
if (!mount) return;
|
||||
|
||||
// ─── Boot SDK ──────────────────────────────────────────────
|
||||
|
||||
try {
|
||||
var base = window.__BASE__ || '';
|
||||
var ver = window.__VERSION__ || '0';
|
||||
|
||||
var ver = window.__VERSION__ || '0';
|
||||
if (!window.preact) {
|
||||
var { h, render } = await import(base + '/js/sw/vendor/preact.module.js');
|
||||
var hooksModule = await import(base + '/js/sw/vendor/hooks.module.js');
|
||||
@@ -28,66 +24,44 @@
|
||||
window.hooks = hooksModule;
|
||||
window.html = htmModule.default.bind(h);
|
||||
}
|
||||
|
||||
var sdk = await import(base + '/js/sw/sdk/index.js?v=' + ver);
|
||||
await sdk.boot();
|
||||
console.log('[SDKR] SDK booted — window.sw ready');
|
||||
} catch (e) {
|
||||
console.warn('[SDKR] SDK boot failed:', e.message);
|
||||
}
|
||||
|
||||
// ─── Shared Namespace ──────────────────────────────────────
|
||||
|
||||
window.SDKR = {
|
||||
mount: mount,
|
||||
manifest: window.__MANIFEST__ || {},
|
||||
base: window.__BASE__ || '',
|
||||
// Populated by framework.js
|
||||
results: [],
|
||||
cleanup: [],
|
||||
stats: {},
|
||||
domains: {},
|
||||
S: {}
|
||||
user: window.sw?.auth?.user || {},
|
||||
base: window.__BASE__ || '',
|
||||
S: {},
|
||||
fixtures: { ready: false, users: [], team: null, group: null }
|
||||
};
|
||||
|
||||
// ─── Script Loader ─────────────────────────────────────────
|
||||
|
||||
var surfaceId = window.SDKR.manifest.id || 'sdk-test-runner';
|
||||
// Always use own package ID — when loaded by the registry,
|
||||
// __MANIFEST__ belongs to the registry surface, not this runner.
|
||||
var surfaceId = 'sdk-test-runner';
|
||||
var assetBase = '/surfaces/' + surfaceId + '/js/';
|
||||
|
||||
if (window.SDKR.base) {
|
||||
assetBase = window.SDKR.base + assetBase;
|
||||
}
|
||||
if (window.SDKR.base) assetBase = window.SDKR.base + assetBase;
|
||||
|
||||
var modules = [
|
||||
'framework.js',
|
||||
'shapes.js',
|
||||
'fixtures.js',
|
||||
// Domain test suites
|
||||
'domains/channels.js',
|
||||
'domains/notes.js',
|
||||
'domains/projects.js',
|
||||
'domains/personas.js',
|
||||
'domains/knowledge.js',
|
||||
'domains/workflows.js',
|
||||
'domains/workspaces.js',
|
||||
'domains/tasks.js',
|
||||
// Domain test files — each registers sw.testing.suite()
|
||||
'domains/misc.js',
|
||||
'domains/workflows.js',
|
||||
'domains/admin.js',
|
||||
'domains/packages.js',
|
||||
'domains/connections.js',
|
||||
'domains/dependencies.js',
|
||||
'domains/composition.js',
|
||||
'domains/git-board.js',
|
||||
// UI (must come last)
|
||||
'ui.js'
|
||||
'domains/composition.js'
|
||||
];
|
||||
|
||||
var loaded = 0;
|
||||
|
||||
function loadNext() {
|
||||
if (loaded >= modules.length) {
|
||||
boot();
|
||||
onReady();
|
||||
return;
|
||||
}
|
||||
var script = document.createElement('script');
|
||||
@@ -100,11 +74,13 @@
|
||||
document.body.appendChild(script);
|
||||
}
|
||||
|
||||
function boot() {
|
||||
if (typeof window.SDKR.renderShell === 'function') {
|
||||
window.SDKR.renderShell();
|
||||
} else {
|
||||
mount.innerHTML = '<p style="color:var(--danger);padding:24px;">SDK Test Runner failed to load modules. Check console.</p>';
|
||||
function onReady() {
|
||||
console.log('[SDKR] All modules loaded — ' + sw.testing.suites().length + ' suites registered');
|
||||
// If loaded as standalone surface (not via registry), redirect to registry
|
||||
var manifest = window.__MANIFEST__ || {};
|
||||
if (manifest.id === 'sdk-test-runner') {
|
||||
var base = window.__BASE__ || '';
|
||||
window.location.href = base + '/s/test-runners';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user