feat(reporting-governance): add package-first portability smoke
This commit is contained in:
@@ -163,12 +163,12 @@ test('leaf subpath export resolves and can execute through injected runtime bind
|
||||
import { runOrchestratorAdapter } from '@openclaw/plugin-reporting-governance/adapters/orchestrator';
|
||||
const payload = runOrchestratorAdapter({
|
||||
runtimeBinding: {
|
||||
cwd: ${JSON.stringify(path.resolve(packageRoot, '..', '..'))},
|
||||
cwd: ${JSON.stringify(path.resolve(packageRoot))},
|
||||
scripts: {
|
||||
orchestrator: ${JSON.stringify(path.resolve(packageRoot, '..', '..', 'scripts', 'watchdog_auto_notify_orchestrator.mjs'))},
|
||||
watchdog: ${JSON.stringify(path.resolve(packageRoot, '..', '..', 'scripts', 'long_task_watchdog.mjs'))},
|
||||
dispatcher: ${JSON.stringify(path.resolve(packageRoot, '..', '..', 'scripts', 'operator_notify_dispatcher.mjs'))},
|
||||
bridgeSupervisor: ${JSON.stringify(path.resolve(packageRoot, '..', '..', 'scripts', 'operator_notify_bridge_supervisor.mjs'))},
|
||||
orchestrator: ${JSON.stringify(path.resolve(packageRoot, 'scripts', 'watchdog_auto_notify_orchestrator.mjs'))},
|
||||
watchdog: ${JSON.stringify(path.resolve(packageRoot, 'scripts', 'long_task_watchdog.mjs'))},
|
||||
dispatcher: ${JSON.stringify(path.resolve(packageRoot, 'scripts', 'operator_notify_dispatcher.mjs'))},
|
||||
bridgeSupervisor: ${JSON.stringify(path.resolve(packageRoot, 'scripts', 'operator_notify_bridge_supervisor.mjs'))},
|
||||
},
|
||||
},
|
||||
state: ${JSON.stringify(statePath)},
|
||||
|
||||
@@ -25,7 +25,16 @@ const requiredPaths = [
|
||||
'src/reference/openclaw-watchdog-chain.md',
|
||||
'capabilities/openclaw-watchdog-reference.json',
|
||||
'examples/openclaw-watchdog-reference.descriptor.example.json',
|
||||
'profiles/strict-manager-mode.profile.json'
|
||||
'profiles/strict-manager-mode.profile.json',
|
||||
'profiles-src/strict-manager-mode.yaml',
|
||||
'schemas/reporting-governance/deployment-profile.schema.json',
|
||||
'schemas/reporting-governance/capability-descriptor.schema.json',
|
||||
'scripts/package-smoke.mjs',
|
||||
'scripts/watchdog_auto_notify_orchestrator.mjs',
|
||||
'scripts/long_task_watchdog.mjs',
|
||||
'scripts/operator_notify_dispatcher.mjs',
|
||||
'scripts/operator_notify_bridge_supervisor.mjs',
|
||||
'scripts/operator_notify_sender_binding.mjs'
|
||||
];
|
||||
|
||||
test('reporting-governance package skeleton paths exist', () => {
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
import { createRuntimeBinding } from '../src/adapters/index.mjs';
|
||||
|
||||
const packageRoot = path.resolve(import.meta.dirname, '..');
|
||||
const repoRoot = path.resolve(packageRoot, '..', '..');
|
||||
const repoRoot = path.resolve(packageRoot);
|
||||
|
||||
function createArtifact(overrides = {}) {
|
||||
return {
|
||||
|
||||
@@ -81,12 +81,12 @@ spec:
|
||||
`;
|
||||
|
||||
test('deployment profile yaml parser reads strict-manager-mode profile shape', () => {
|
||||
const artifact = generateDeploymentProfileArtifactFromFile(path.join(repoRoot, 'profiles', 'strict-manager-mode.yaml'));
|
||||
const artifact = generateDeploymentProfileArtifactFromFile(path.join(packageRoot, 'profiles-src', 'strict-manager-mode.yaml'));
|
||||
|
||||
assert.equal(artifact.metadata.id, 'strict-manager-mode');
|
||||
assert.equal(artifact.metadata.runtime, 'openclaw');
|
||||
assert.equal(artifact.spec.package.pluginVersion, '0.1.0-mainline');
|
||||
assert.equal(artifact.metadata.source_profile, 'profiles/strict-manager-mode.yaml');
|
||||
assert.equal(artifact.metadata.source_profile, 'profiles-src/strict-manager-mode.yaml');
|
||||
});
|
||||
|
||||
test('deployment profile schema validator rejects malformed profile', () => {
|
||||
@@ -385,7 +385,7 @@ test('yaml to artifact generation produces validator-compatible package artifact
|
||||
});
|
||||
|
||||
test('strict-manager YAML generation matches checked-in package artifact snapshot', () => {
|
||||
const generated = generateDeploymentProfileArtifactFromFile(path.join(repoRoot, 'profiles', 'strict-manager-mode.yaml'));
|
||||
const generated = generateDeploymentProfileArtifactFromFile(path.join(packageRoot, 'profiles-src', 'strict-manager-mode.yaml'));
|
||||
const checkedIn = validateDeploymentProfileArtifact(
|
||||
JSON.parse(
|
||||
fs.readFileSync(
|
||||
|
||||
@@ -127,7 +127,7 @@ test('orchestrator adapter can bootstrap from profile artifact loader path', ()
|
||||
|
||||
const result = runOrchestratorAdapter({
|
||||
profileId: 'strict-manager-mode',
|
||||
repoRootOverride: path.resolve(packageRoot, '..', '..'),
|
||||
repoRootOverride: path.resolve(packageRoot),
|
||||
state: statePath,
|
||||
evidenceDir: path.join(root, 'evidence'),
|
||||
eventDir: path.join(root, 'events'),
|
||||
@@ -160,7 +160,7 @@ test('orchestrator adapter can use artifact_roots.queueItems as the default queu
|
||||
|
||||
const result = runOrchestratorAdapter({
|
||||
profileId: 'strict-manager-mode',
|
||||
repoRootOverride: path.resolve(packageRoot, '..', '..'),
|
||||
repoRootOverride: path.resolve(packageRoot),
|
||||
state: statePath,
|
||||
evidenceDir: path.join(root, 'evidence'),
|
||||
eventDir: path.join(root, 'events'),
|
||||
@@ -183,7 +183,7 @@ test('orchestrator adapter fails closed at use time when artifact_roots.queueIte
|
||||
try {
|
||||
const fakeRepoRoot = path.join(sandbox, 'repo');
|
||||
const outsideRoot = path.join(sandbox, 'outside');
|
||||
const realRepoRoot = path.resolve(packageRoot, '..', '..');
|
||||
const realRepoRoot = path.resolve(packageRoot);
|
||||
fs.mkdirSync(path.join(fakeRepoRoot, 'scripts'), { recursive: true });
|
||||
fs.mkdirSync(path.join(fakeRepoRoot, 'state', 'operator-notify-queue'), { recursive: true });
|
||||
fs.mkdirSync(outsideRoot, { recursive: true });
|
||||
|
||||
Reference in New Issue
Block a user