From aaadbd295e90b9f9e62159889a8ad62b21685f20 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Wed, 21 Oct 2026 12:34:38 +0900 Subject: [PATCH] =?UTF-8?q?test(506-2):=20=EC=8B=9C=ED=97=98=20=EC=A0=95?= =?UTF-8?q?=EB=B9=84=20=E2=80=94=20=EB=82=A1=EC=9D=80=20=EB=91=90=20?= =?UTF-8?q?=EC=8B=9C=ED=97=98=20=EA=B8=80=20=EB=A7=9E=EC=B6=A4=20=C2=B7=20?= =?UTF-8?q?vitest=20=EC=8B=A4=ED=96=89=20=EC=84=A4=EC=A0=95=20=C2=B7=20liv?= =?UTF-8?q?e=20=EC=8B=9C=ED=97=98=20=EC=BC=9C=EB=8A=94=20=ED=91=9C?= =?UTF-8?q?=EC=8B=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - test_b06_draft_pipe_replay · test_269_panel_form 단언 글을 현재 코드에 맞춤 - vitest.tmp.config.ts: include resources/tester/cad · xstate 별칭 · node 꼴 시험 제외 · dxf-clip 픽스처 경로 import.meta.url - test_472_6_route_save · design_save: live 는 AISLO_LIVE_DB=1 일 때만 Co-Authored-By: Claude Sonnet 5.5 --- B07_DesignDetail/openwebcad/vitest.tmp.config.ts | 12 +++++++++--- resources/tester/cad/dxf-clip.test.ts | 2 +- resources/tester/test_269_panel_form.py | 2 +- resources/tester/test_472_6_design_save.py | 14 ++++++++------ resources/tester/test_472_6_route_save.py | 14 ++++++++------ resources/tester/test_b06_draft_pipe_replay.py | 2 +- 6 files changed, 28 insertions(+), 18 deletions(-) diff --git a/B07_DesignDetail/openwebcad/vitest.tmp.config.ts b/B07_DesignDetail/openwebcad/vitest.tmp.config.ts index 07da1a270..b7f0952e9 100644 --- a/B07_DesignDetail/openwebcad/vitest.tmp.config.ts +++ b/B07_DesignDetail/openwebcad/vitest.tmp.config.ts @@ -1,7 +1,7 @@ /** - * 저장소 tmp/tests에 있는 CAD 테스트 실행용 설정 (테스트 코드는 git 추적 제외). + * 저장소 resources/tester/cad 의 CAD 테스트 실행용 설정. * npx vitest run --config vitest.tmp.config.ts - * tmp에는 node_modules가 없어 라이브러리를 openwebcad 쪽으로 이어 준다. + * 저장소 뿌리에는 node_modules가 없어 라이브러리를 openwebcad 쪽으로 이어 준다. */ import { resolve } from 'node:path'; import { defineConfig } from 'vitest/config'; @@ -13,9 +13,15 @@ export default defineConfig({ '@flatten-js/core': resolve('node_modules/@flatten-js/core'), 'es-toolkit/compat': resolve('node_modules/es-toolkit/dist/compat/index.mjs'), 'es-toolkit': resolve('node_modules/es-toolkit'), + xstate: resolve('node_modules/xstate'), }, }, test: { - include: ['tmp/tests/cad/**/*.test.ts'], + include: ['resources/tester/cad/**/*.test.ts'], + // node 꼴(describe 없음 · `node --experimental-strip-types` 로 돎) 넷 + `@ui` 별칭 쓰는 하나(vitest.ui.config.ts) + exclude: [ + '**/node_modules/**', + 'resources/tester/cad/{dxf-clip,table-from-drawing,theme-auto-color,random-uuid-polyfill,ctrl-shortcut-sheet}.test.ts', + ], }, }); diff --git a/resources/tester/cad/dxf-clip.test.ts b/resources/tester/cad/dxf-clip.test.ts index 2af4d47b6..d278313e0 100644 --- a/resources/tester/cad/dxf-clip.test.ts +++ b/resources/tester/cad/dxf-clip.test.ts @@ -10,7 +10,7 @@ import { prepareClip, } from '../../../B07_DesignDetail/openwebcad/src/integration/dxf-clip.ts'; -const sample = readFileSync('resources/tester/fixtures/b07_webclip_sample.dxf', 'utf-8'); +const sample = readFileSync(new URL('../fixtures/b07_webclip_sample.dxf', import.meta.url), 'utf-8'); assert.equal(isDxfText(sample), true, '견본 DXF 알아봄'); assert.equal(isDxfText(sample.replace(/\n/g, '\r\n')), true, 'CRLF DXF 도 알아봄'); assert.equal(isDxfText('0\nSECTION\n'), true, '앞 공백 없는 DXF'); diff --git a/resources/tester/test_269_panel_form.py b/resources/tester/test_269_panel_form.py index aa8d31a3b..4926a7c3a 100644 --- a/resources/tester/test_269_panel_form.py +++ b/resources/tester/test_269_panel_form.py @@ -57,7 +57,7 @@ def test_공용_양식_칸_라벨_단추_규칙(): label = _block(OVERLAY, ".ui-panel-form .ui-field,\n.ui-panel-form .b05-route__field") assert "gap: var(--panel-label-gap);" in label assert "display: none;" in _block(OVERLAY, ".ui-panel-form .ui-field__error:not(.is-visible)") - button = _block(OVERLAY, ".ui-panel-form .ui-btn:not(.ui-help-btn)") + button = _block(OVERLAY, ".ui-panel-form .ui-btn:not(.ui-help-btn, .ui-step-nav-btn)") # 「구조물 배치」 단추(b05-route__irregular-btn)와 같은 크기 assert "padding: var(--spacing-8);" in button assert "font-size: var(--text-caption);" in button diff --git a/resources/tester/test_472_6_design_save.py b/resources/tester/test_472_6_design_save.py index 63355dce9..76a30acc3 100644 --- a/resources/tester/test_472_6_design_save.py +++ b/resources/tester/test_472_6_design_save.py @@ -3,7 +3,7 @@ ① storage 떠 두기 · 되돌림 — 바뀐 · 새로 생긴 · 지운 파일만 되씀(안 바뀐 파일 그대로). ② 실제 창구(검증_sub8 · DB · storage) — 중간 차례 실패 → DB 7 표 행 · storage 해시 시작 그대로 · 차례 이름 · 까닭 · restored. 같은 본문 정상 = 옛 차례(안쪽 창구 차례로 부름)와 행 · 파일 같음. -검증 프로젝트가 없는 자리(다른 PC · DB 없음)는 ② 건너뜀. +실DB(②)는 `AISLO_LIVE_DB=1` 일 때만 · 검증 프로젝트가 없는 자리(다른 PC · DB 없음)도 건너뜀. ② 는 살아 있는 검증_sub8 DB · storage 는 임시 사본(492 · `helper_temp_storage`) · 노선 바뀌어도 됨 (최신 노선 id · 추가 측점 자리를 그때 읽음). @@ -15,6 +15,7 @@ from __future__ import annotations import asyncio import hashlib import json +import os import sys from pathlib import Path from uuid import UUID @@ -79,7 +80,8 @@ def _db_ready() -> Path | None: return None -SHARED_ROOT = _db_ready() +#: 켤 때만 — `AISLO_LIVE_DB=1`(공유 검증 DB 행을 실제로 씀 · 기본 건너뜀 · DB 도 안 열음) +SHARED_ROOT = _db_ready() if os.environ.get("AISLO_LIVE_DB") == "1" else None #: 시험이 쓰는 뿌리 = 공유 storage 의 임시 사본(492 · `sandbox` 가 세움 · Synology 로 안 번지게) ROOT_DIR: Path | None = None @@ -96,10 +98,10 @@ def sandbox(): def live(test): - """실DB · 사본 storage 시험 — 검증 프로젝트 없으면 건너뜀.""" - return pytest.mark.skipif(SHARED_ROOT is None, reason="검증_sub8 · DB 없음")( - pytest.mark.usefixtures("sandbox")(test) - ) + """실DB · 사본 storage 시험 — `AISLO_LIVE_DB=1` 이고 검증 프로젝트가 있을 때만.""" + return pytest.mark.skipif( + SHARED_ROOT is None, reason="AISLO_LIVE_DB=1 일 때만(검증_sub8 · DB 필요)" + )(pytest.mark.usefixtures("sandbox")(test)) def _state(root: Path) -> tuple[dict, dict]: diff --git a/resources/tester/test_472_6_route_save.py b/resources/tester/test_472_6_route_save.py index 1260de817..8d94247d6 100644 --- a/resources/tester/test_472_6_route_save.py +++ b/resources/tester/test_472_6_route_save.py @@ -9,7 +9,7 @@ ④ 실제 창구(검증_sub8 DB · storage 는 임시 사본) — 노선 차례 뒤 실패(시험 갈래 · 넘김 실패) = 노선 행 · 자식 표 · storage(초기값 사본 포함) 그대로 · 정상 한 본문(교점 끌기) = 옛 차례 (노선 저장 → 다시 얹기 → 횡단 저장)와 행 · 파일 같음 · 시설 수 그대로 · 초기값 그대로(493). -검증 프로젝트가 없는 자리(다른 PC · DB 없음)는 ④ 건너뜀. +실DB(④)는 `AISLO_LIVE_DB=1` 일 때만 · 검증 프로젝트가 없는 자리(다른 PC · DB 없음)도 건너뜀. ./venv/Scripts/python.exe -m pytest resources/tester/test_472_6_route_save.py -q """ @@ -18,6 +18,7 @@ from __future__ import annotations import asyncio import json +import os import re import shutil import subprocess @@ -176,7 +177,8 @@ def _db_ready() -> Path | None: return None -SHARED_ROOT = _db_ready() +#: 켤 때만 — `AISLO_LIVE_DB=1`(공유 검증 DB 행을 실제로 씀 · 기본 건너뜀 · DB 도 안 열음) +SHARED_ROOT = _db_ready() if os.environ.get("AISLO_LIVE_DB") == "1" else None #: 시험이 쓰는 뿌리 = 공유 storage 의 임시 사본(492 · `sandbox` 가 세움 · Synology 로 안 번지게) ROOT_DIR: Path | None = None @@ -193,10 +195,10 @@ def sandbox(): def live(test): - """실DB · 사본 storage 시험 — 검증 프로젝트 없으면 건너뜀.""" - return pytest.mark.skipif(SHARED_ROOT is None, reason="검증_sub8 · DB 없음")( - pytest.mark.usefixtures("sandbox")(test) - ) + """실DB · 사본 storage 시험 — `AISLO_LIVE_DB=1` 이고 검증 프로젝트가 있을 때만.""" + return pytest.mark.skipif( + SHARED_ROOT is None, reason="AISLO_LIVE_DB=1 일 때만(검증_sub8 · DB 필요)" + )(pytest.mark.usefixtures("sandbox")(test)) def _rows() -> dict: diff --git a/resources/tester/test_b06_draft_pipe_replay.py b/resources/tester/test_b06_draft_pipe_replay.py index 6dd6c3dd3..c94abb017 100644 --- a/resources/tester/test_b06_draft_pipe_replay.py +++ b/resources/tester/test_b06_draft_pipe_replay.py @@ -42,7 +42,7 @@ def test_draft_pipe_options_are_replayed_onto_the_cache(): cross = _read("A00_Common", "design", "design_view_cross.ts") assert "replayDraftPipeOptions" not in cross store = _read("B06_Section", "B06_Section_Section_Store.ts") - assert "await withDraftShapes(detail, projectId);" in store + assert "await withDraftShapes(detail, projectId, false, frame);" in store shared = _read("A00_Common", "design", "design_shared.ts") assert "shared.lastPipes = pipes" in shared profile = _read("A00_Common", "design", "design_view_profile.ts")