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

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:
2026-04-01 22:49:55 +00:00
parent e916ed41ea
commit f1c47002aa
59 changed files with 2509 additions and 6525 deletions

View File

@@ -88,10 +88,10 @@
// ── Tests ────────────────────────────────────────────────
T.registerDomain('composition', async function () {
sw.testing.suite('sdk/composition', async function (s) {
if (!window.sw || !sw.isAdmin) {
await T.test('composition', 'guard', 'skip — not admin', async function () {
s.test('guard: skip — not admin', async function (t) {
T.assert(true, 'skipped (user is not admin)');
});
return;
@@ -105,7 +105,7 @@
// ── 1. Install library with connection type ────────────
await T.test('composition', 'install-library', 'install library with connection type declaration', async function () {
s.test('install-library: install library with connection type declaration', async function (t) {
var manifest = {
id: libId,
title: 'Composition Test Library',
@@ -138,14 +138,14 @@
// ── 2. Grant library permissions ────────────
await T.test('composition', 'grant-permissions', 'grant library declared permissions', async function () {
s.test('grant-permissions: grant library declared permissions', async function (t) {
var r = await sw.api.post('/api/v1/admin/extensions/' + libId + '/permissions/grant-all', {});
T.assert(true, 'permissions granted (or already granted)');
});
// ── 3. Connection type appears in discovery endpoint ────
await T.test('composition', 'types-include-library', 'connection-types endpoint includes library type', async function () {
s.test('types-include-library: connection-types endpoint includes library type', async function (t) {
var types = await sw.api.connectionTypes.list();
T.assert(Array.isArray(types), 'should be array');
var found = types.find(function (t) { return t.type === connType; });
@@ -158,7 +158,7 @@
// ── 4. Create connection of library's type ────────────
await T.test('composition', 'create-connection', 'create connection of library connection type', async function () {
s.test('create-connection: create connection of library connection type', async function (t) {
var r = await sw.api.admin.connections.create({
type: connType,
package_id: libId,
@@ -176,7 +176,7 @@
// ── 5. Install consumer with dependency on library ────
await T.test('composition', 'install-consumer', 'install consumer depending on library', async function () {
s.test('install-consumer: install consumer depending on library', async function (t) {
var manifest = {
id: consumerId,
title: 'Composition Test Consumer',
@@ -201,28 +201,28 @@
// ── 6. Verify dependency recorded ────────────
await T.test('composition', 'dependency-recorded', 'consumer depends on library', async function () {
s.test('dependency-recorded: consumer depends on library', async function (t) {
var r = await sw.api.admin.packages.dependencies(consumerId);
T.assert(r && r.data, 'should return data');
var dep = r.data.find(function (d) { return d.library_id === libId; });
var deps = Array.isArray(r) ? r : (r && r.data) || [];
var dep = deps.find(function (d) { return d.library_id === libId; });
T.assert(dep, 'dependency on library should exist');
});
// ── 7. Cleanup: consumer, connection, library ────────────
await T.test('composition', 'cleanup-consumer', 'uninstall consumer', async function () {
s.test('cleanup-consumer: uninstall consumer', async function (t) {
await sw.api.admin.packages.del(consumerId);
consumerId = null;
T.assert(true, 'consumer uninstalled');
});
await T.test('composition', 'cleanup-connection', 'delete connection', async function () {
s.test('cleanup-connection: delete connection', async function (t) {
await sw.api.admin.connections.del(connId);
connId = null;
T.assert(true, 'connection deleted');
});
await T.test('composition', 'cleanup-library', 'uninstall library', async function () {
s.test('cleanup-library: uninstall library', async function (t) {
await sw.api.admin.packages.del(libId);
libId = null;
T.assert(true, 'library uninstalled');
@@ -230,7 +230,7 @@
// ── 8. Verify type removed after uninstall ────────────
await T.test('composition', 'types-removed', 'connection type removed after library uninstall', async function () {
s.test('types-removed: connection type removed after library uninstall', async function (t) {
var types = await sw.api.connectionTypes.list();
var found = types.find(function (t) { return t.type === connType; });
T.assert(!found, 'type should not appear after library uninstall');