()
| 286 | tmp, |
| 287 | '--write', |
| 288 | ], { |
| 289 | cwd: CITADEL_ROOT, |
| 290 | stdio: 'pipe', |
| 291 | encoding: 'utf8', |
| 292 | timeout: 20000, |
| 293 | }); |
| 294 | const result = JSON.parse(output); |
| 295 | assert.equal(result.fetchedItems, 1); |
| 296 | assert.equal(result.result.codexItems, 1); |
| 297 | assert(fs.existsSync(path.join(tmp, '.planning', 'pr-review', 'owner-repo-7.json'))); |
| 298 | } finally { |
| 299 | fs.rmSync(tmp, { recursive: true, force: true }); |
| 300 | } |
| 301 | } |
| 302 | |
| 303 | function testArtifactVerification() { |
| 304 | const tmp = tempProject('citadel-artifacts-'); |
| 305 | try { |
| 306 | const screenshot = path.join(tmp, '.planning', 'screenshots', 'qa.png'); |
| 307 | fs.mkdirSync(path.dirname(screenshot), { recursive: true }); |
| 308 | fs.writeFileSync(screenshot, 'fake-png', 'utf8'); |
| 309 | recordAppArtifact({ |
| 310 | projectRoot: tmp, |
| 311 | workflow: 'qa', |
| 312 | kind: 'screenshot', |
| 313 | path: '.planning/screenshots/qa.png', |
| 314 | status: 'pass', |
| 315 | }); |
| 316 | const pass = verifyAppArtifacts({ projectRoot: tmp, requireExistingPaths: true }); |
| 317 | assert(pass.pass, JSON.stringify(pass, null, 2)); |
| 318 | |
| 319 | recordAppArtifact({ |
| 320 | projectRoot: tmp, |
| 321 | workflow: 'qa', |
| 322 | kind: 'screenshot', |
| 323 | path: '.planning/screenshots/missing.png', |
| 324 | status: 'pass', |
| 325 | }); |
| 326 | const fail = verifyAppArtifacts({ projectRoot: tmp, requireExistingPaths: true }); |
no test coverage detected