mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-12 06:06:37 +03:00
[codex] Improve CI test coverage (#212)
* Improve CI test coverage * Stabilize live E2E harness * Shard live E2E CI * Cache live E2E CI dependencies * Stabilize live E2E smoke CI * Update generated live browser bundles * Tighten live E2E smoke runtime * Prevent live E2E smoke hangs * Stabilize live E2E CI coverage * Fix stale accept DOM cleanup * Regenerate live browser outputs
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
import { execSync } from 'node:child_process';
|
||||
import { existsSync, readFileSync, readdirSync, statSync, lstatSync, unlinkSync, mkdirSync, writeFileSync, rmSync, renameSync, createWriteStream, realpathSync, symlinkSync, readlinkSync } from 'node:fs';
|
||||
import { existsSync, readFileSync, readdirSync, statSync, lstatSync, unlinkSync, mkdirSync, writeFileSync, rmSync, renameSync, createWriteStream, realpathSync, symlinkSync, readlinkSync, cpSync } from 'node:fs';
|
||||
import { join, resolve, dirname, relative, isAbsolute } from 'node:path';
|
||||
import { createInterface } from 'node:readline';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
@@ -134,6 +134,9 @@ function hashSkillsDir(skillsDir) {
|
||||
* Caller is responsible for cleanup.
|
||||
*/
|
||||
async function downloadAndExtractBundle() {
|
||||
const localBundle = process.env.IMPECCABLE_BUNDLE_PATH;
|
||||
if (localBundle) return copyOrExtractLocalBundle(localBundle);
|
||||
|
||||
const tmpZip = join(tmpdir(), `impeccable-update-${Date.now()}.zip`);
|
||||
const tmpDir = join(tmpdir(), `impeccable-update-${Date.now()}`);
|
||||
await downloadFile(`${API_BASE}/api/download/bundle/universal`, tmpZip);
|
||||
@@ -143,6 +146,24 @@ async function downloadAndExtractBundle() {
|
||||
return tmpDir;
|
||||
}
|
||||
|
||||
async function copyOrExtractLocalBundle(sourceValue) {
|
||||
const source = resolve(sourceValue);
|
||||
if (!existsSync(source)) {
|
||||
throw new Error(`Local bundle not found: ${source}`);
|
||||
}
|
||||
|
||||
const tmpDir = join(tmpdir(), `impeccable-local-bundle-${process.pid}-${Date.now()}`);
|
||||
mkdirSync(tmpDir, { recursive: true });
|
||||
|
||||
if (statSync(source).isDirectory()) {
|
||||
cpSync(source, tmpDir, { recursive: true });
|
||||
return tmpDir;
|
||||
}
|
||||
|
||||
await extract(source, { dir: tmpDir });
|
||||
return tmpDir;
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize a SKILL.md's content for comparison by stripping
|
||||
* provider-specific paths. Different install methods (npx skills add
|
||||
|
||||
Reference in New Issue
Block a user