v0.7.2 Package Runners + CI Gate
Five package-level test runners validating extension API contracts: - notes-runner: CRUD, folders, tags, search, backlinks (12 tests) - chat-runner: conversations, messaging, search (9 tests) - schedules-runner: CRUD + run (5 tests) - workflow-runner: definitions, instances, stage progression (5 tests) - renderer-runner: registry contract, block matching (4 tests) Runner Result API (in-memory, 3 admin endpoints) stores results from browser runs for CI consumption. Test-runners surface v0.2.0 posts results after each run and fixes suite prefix matching. CI integration via Playwright: wait-for-healthy.sh, run-surface-tests.sh, surface-test-driver.js. New test-runners stage in Gitea CI pipeline. Verified: 169 passed, 0 failed, 9 warned, 8 skipped on fresh install. Go handler tests: 4/4 passing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
64
packages/notes-runner/js/main.js
Normal file
64
packages/notes-runner/js/main.js
Normal file
@@ -0,0 +1,64 @@
|
||||
/**
|
||||
* Notes Runner — Entry Point
|
||||
*
|
||||
* Boot SDK, load test modules in dependency order.
|
||||
* Each module is an IIFE that registers suites via sw.testing.suite().
|
||||
*/
|
||||
(async function () {
|
||||
'use strict';
|
||||
|
||||
try {
|
||||
var base = window.__BASE__ || '';
|
||||
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');
|
||||
var htmModule = await import(base + '/js/sw/vendor/htm.module.js');
|
||||
window.preact = { h, render };
|
||||
window.hooks = hooksModule;
|
||||
window.html = htmModule.default.bind(h);
|
||||
}
|
||||
var sdk = await import(base + '/js/sw/sdk/index.js?v=' + ver);
|
||||
await sdk.boot();
|
||||
} catch (e) {
|
||||
console.warn('[NotesRunner] SDK boot failed:', e.message);
|
||||
}
|
||||
|
||||
window.NR = {
|
||||
base: window.__BASE__ || '',
|
||||
api: sw.api.ext('notes')
|
||||
};
|
||||
|
||||
var surfaceId = 'notes-runner';
|
||||
var assetBase = '/surfaces/' + surfaceId + '/js/';
|
||||
if (window.NR.base) assetBase = window.NR.base + assetBase;
|
||||
|
||||
var modules = [
|
||||
'notes-crud.js',
|
||||
'folders.js',
|
||||
'tags-search.js'
|
||||
];
|
||||
|
||||
var loaded = 0;
|
||||
function loadNext() {
|
||||
if (loaded >= modules.length) { onReady(); return; }
|
||||
var script = document.createElement('script');
|
||||
script.src = assetBase + modules[loaded] + '?v=' + (window.__VERSION__ || '0') + '.' + Date.now();
|
||||
script.onload = function () { loaded++; loadNext(); };
|
||||
script.onerror = function () {
|
||||
console.error('[NotesRunner] Failed to load: ' + modules[loaded]);
|
||||
loaded++; loadNext();
|
||||
};
|
||||
document.body.appendChild(script);
|
||||
}
|
||||
|
||||
function onReady() {
|
||||
console.log('[NotesRunner] All modules loaded — ' + sw.testing.suites().length + ' suites registered');
|
||||
var manifest = window.__MANIFEST__ || {};
|
||||
if (manifest.id === surfaceId) {
|
||||
window.location.href = (window.__BASE__ || '') + '/s/test-runners';
|
||||
}
|
||||
}
|
||||
|
||||
loadNext();
|
||||
})();
|
||||
Reference in New Issue
Block a user