mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-27 07:01:02 +03:00
test(verify-snapshots): поддержка caseFiles и навыков xdto
Харнесс платформенной верификации не знал про caseFiles — механизм файлового входа кейса, добавленный в runner.mjs. Та же функция перенесена сюда, xdto-compile и xdto-edit добавлены в список проверяемых навыков. Первый прогон отвергает 4 кейса из 9 — разбор в debug/xdto/FINDINGS.md §15. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
49d7204385
commit
8232cbeaaa
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
import { execFileSync } from 'child_process';
|
import { execFileSync } from 'child_process';
|
||||||
import { existsSync, mkdirSync, mkdtempSync, rmSync, readFileSync, writeFileSync,
|
import { existsSync, mkdirSync, mkdtempSync, rmSync, readFileSync, writeFileSync,
|
||||||
readdirSync, statSync, cpSync } from 'fs';
|
readdirSync, statSync, cpSync, copyFileSync } from 'fs';
|
||||||
import { join, resolve, dirname, basename } from 'path';
|
import { join, resolve, dirname, basename } from 'path';
|
||||||
import { tmpdir } from 'os';
|
import { tmpdir } from 'os';
|
||||||
|
|
||||||
@@ -686,6 +686,15 @@ async function verifyCase(skillName, caseName, skillConfig, caseData, opts) {
|
|||||||
const workDir = mkdtempSync(join(tmpdir(), `verify-${skillName}-${caseName}-`));
|
const workDir = mkdtempSync(join(tmpdir(), `verify-${skillName}-${caseName}-`));
|
||||||
result.workDir = workDir;
|
result.workDir = workDir;
|
||||||
|
|
||||||
|
// caseFiles — файловый вход кейса (напр. XSD для xdto-compile), как в runner.mjs
|
||||||
|
for (const rel of caseData.caseFiles || []) {
|
||||||
|
const src = join(CASES, skillName, rel);
|
||||||
|
if (!existsSync(src)) throw new Error(`caseFiles: файл не найден: ${src}`);
|
||||||
|
const dst = rel.includes('/') ? join(workDir, rel) : join(workDir, basename(rel));
|
||||||
|
mkdirSync(dirname(dst), { recursive: true });
|
||||||
|
copyFileSync(src, dst);
|
||||||
|
}
|
||||||
|
|
||||||
const log = (step, ok, detail) => {
|
const log = (step, ok, detail) => {
|
||||||
result.steps.push({ step, ok, detail: detail?.substring(0, 2000) });
|
result.steps.push({ step, ok, detail: detail?.substring(0, 2000) });
|
||||||
if (opts.verbose) {
|
if (opts.verbose) {
|
||||||
@@ -1286,6 +1295,7 @@ const DEFAULT_SKILLS = [
|
|||||||
'epf-init', 'erf-init', 'template-add', 'help-add',
|
'epf-init', 'erf-init', 'template-add', 'help-add',
|
||||||
'cfe-init', 'cfe-borrow', 'cfe-patch-method',
|
'cfe-init', 'cfe-borrow', 'cfe-patch-method',
|
||||||
'skd-compile', 'skd-edit', 'mxl-compile',
|
'skd-compile', 'skd-edit', 'mxl-compile',
|
||||||
|
'xdto-compile', 'xdto-edit',
|
||||||
];
|
];
|
||||||
|
|
||||||
function discoverCases(skillFilter, caseFilter) {
|
function discoverCases(skillFilter, caseFilter) {
|
||||||
|
|||||||
Reference in New Issue
Block a user