From 9c7010a49ea2e9579cf78f284d8c0aaa1ded9075 Mon Sep 17 00:00:00 2001 From: Nick Shirokov Date: Sun, 19 Jul 2026 20:31:45 +0300 Subject: [PATCH] =?UTF-8?q?test(platform-dump-modes):=20=D0=BF=D0=BE=D0=BA?= =?UTF-8?q?=D1=80=D1=8B=D1=82=D1=8C=20db-dump-xml=20Full/Changes/UpdateInf?= =?UTF-8?q?o=20=D0=BD=D0=B0=20=D1=80=D0=B5=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE?= =?UTF-8?q?=D0=B9=201=D0=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Постусловие непустого каталога валидировалось только на Full/Partial. Новый 1cv8-тест гоняет Changes (в существующий дамп) и UpdateInfo (в свежий каталог) → подтверждает, что режимы дают реальный выход и постусловие не даёт ложного падения. UpdateInfo проверяется ассертом наличия ConfigDumpInfo.xml. Co-Authored-By: Claude Opus 4.8 --- .../integration/platform-dump-modes.test.mjs | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 tests/skills/integration/platform-dump-modes.test.mjs diff --git a/tests/skills/integration/platform-dump-modes.test.mjs b/tests/skills/integration/platform-dump-modes.test.mjs new file mode 100644 index 00000000..2d5a52a8 --- /dev/null +++ b/tests/skills/integration/platform-dump-modes.test.mjs @@ -0,0 +1,68 @@ +// platform-dump-modes.test.mjs — db-dump-xml Full / Changes / UpdateInfo on a real base. +// Guards the artifact postcondition (non-empty output dir) against false-fail in the +// less-common dump modes: each step succeeding proves the mode produces real output. +// 1cv8-only: ibcmd config export does not support Mode UpdateInfo. + +export const name = 'Режимы выгрузки конфигурации (Full/Changes/UpdateInfo)'; +export const setup = 'none'; +export const requiresPlatform = true; + +export const steps = [ + // ── 1. Build + load a minimal base ── + { + name: 'cf-init: пустая конфигурация', + script: 'cf-init/scripts/cf-init', + args: { '-Name': 'РежимыВыгрузки', '-OutputDir': '{workDir}/config' }, + }, + { + name: 'meta-compile: Справочник Товары', + script: 'meta-compile/scripts/meta-compile', + input: { type: 'Catalog', name: 'Товары', codeLength: 9, descriptionLength: 100 }, + args: { '-JsonPath': '{inputFile}', '-OutputDir': '{workDir}/config' }, + }, + { + name: 'cf-edit: регистрация справочника', + script: 'cf-edit/scripts/cf-edit', + input: [{ operation: 'add-childObject', value: 'Catalog.Товары' }], + args: { '-ConfigPath': '{workDir}/config', '-DefinitionFile': '{inputFile}' }, + }, + { + name: 'db-create: файловая ИБ', + script: 'db-create/scripts/db-create', + args: { '-V8Path': '{v8path}', '-InfoBasePath': '{workDir}/testdb' }, + }, + { + name: 'db-load-xml: загрузка конфигурации (Full)', + script: 'db-load-xml/scripts/db-load-xml', + args: { '-V8Path': '{v8path}', '-InfoBasePath': '{workDir}/testdb', '-ConfigDir': '{workDir}/config' }, + }, + { + name: 'db-update: обновление БД', + script: 'db-update/scripts/db-update', + args: { '-V8Path': '{v8path}', '-InfoBasePath': '{workDir}/testdb' }, + }, + + // ── 2. Full dump (baseline) → postcondition must pass on a real export ── + { + name: 'db-dump-xml: Full', + script: 'db-dump-xml/scripts/db-dump-xml', + args: { '-V8Path': '{v8path}', '-InfoBasePath': '{workDir}/testdb', '-ConfigDir': '{workDir}/dumpA', '-Mode': 'Full' }, + }, + // ── 3. Changes dump into the same dir → must not false-fail ── + { + name: 'db-dump-xml: Changes', + script: 'db-dump-xml/scripts/db-dump-xml', + args: { '-V8Path': '{v8path}', '-InfoBasePath': '{workDir}/testdb', '-ConfigDir': '{workDir}/dumpA', '-Mode': 'Changes' }, + }, + // ── 4. UpdateInfo into a FRESH dir → proves the mode alone yields non-empty output ── + { + name: 'db-dump-xml: UpdateInfo', + script: 'db-dump-xml/scripts/db-dump-xml', + args: { '-V8Path': '{v8path}', '-InfoBasePath': '{workDir}/testdb', '-ConfigDir': '{workDir}/dumpB', '-Mode': 'UpdateInfo' }, + }, + { + name: 'assert: UpdateInfo записал ConfigDumpInfo.xml', + assertContains: '{workDir}/dumpB/ConfigDumpInfo.xml', + expect: 'ConfigDumpInfo', + }, +];