Add unit tests for skill capabilities, skill planner, and UV setup
- Implement tests for random ID generation, ensuring preference for crypto.randomUUID. - Create tests for runtime context capabilities, validating the injection of enabled skill capabilities. - Add tests for skill capability parsing, including classification and command example extraction. - Introduce tests for the skill planner, verifying tool call planning based on user requests and attachment requirements. - Establish tests for UV setup, ensuring proper handling of Python installation scenarios and environment checks.
This commit is contained in:
@@ -53,11 +53,15 @@ async function setupTarget(id) {
|
||||
const tempDir = path.join(ROOT_DIR, 'temp_uv_extract');
|
||||
const archivePath = path.join(ROOT_DIR, target.filename);
|
||||
const downloadUrl = `${BASE_URL}/${target.filename}`;
|
||||
const outputBinary = path.join(targetDir, target.binName);
|
||||
|
||||
echo(chalk.blue`\n📦 Setting up uv for ${id}...`);
|
||||
|
||||
// Cleanup & Prep
|
||||
await fs.remove(targetDir);
|
||||
// Only remove the target binary, not the entire directory,
|
||||
// so uv downloads do not wipe other bundled runtime files like node.exe.
|
||||
if (await fs.pathExists(outputBinary)) {
|
||||
await fs.remove(outputBinary);
|
||||
}
|
||||
await fs.remove(tempDir);
|
||||
await fs.ensureDir(targetDir);
|
||||
await fs.ensureDir(tempDir);
|
||||
@@ -96,7 +100,7 @@ async function setupTarget(id) {
|
||||
// uv archives usually contain a folder named after the target
|
||||
const folderName = target.filename.replace('.tar.gz', '').replace('.zip', '');
|
||||
const sourceBin = path.join(tempDir, folderName, target.binName);
|
||||
const destBin = path.join(targetDir, target.binName);
|
||||
const destBin = outputBinary;
|
||||
|
||||
if (await fs.pathExists(sourceBin)) {
|
||||
await fs.move(sourceBin, destBin, { overwrite: true });
|
||||
@@ -171,4 +175,4 @@ try {
|
||||
echo(chalk.yellow` Packaging will continue without uv binary.`);
|
||||
// Exit with code 0 to allow packaging to continue
|
||||
process.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user