diff --git a/.DS_Store b/.DS_Store index 6c74ac20..849956c6 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/scripts/verify-param-config.sh b/scripts/verify-param-config.sh deleted file mode 100644 index ed4809f9..00000000 --- a/scripts/verify-param-config.sh +++ /dev/null @@ -1,253 +0,0 @@ -#!/bin/bash - -# 模型参数配置 - 快速功能验证脚本 -# 用于手动验证端到端功能 - -echo "======================================" -echo "模型参数配置 - 功能验证" -echo "======================================" -echo "" - -# 颜色定义 -GREEN='\033[0;32m' -RED='\033[0;31m' -YELLOW='\033[1;33m' -NC='\033[0m' # No Color - -# 测试计数 -PASS=0 -FAIL=0 - -# 测试函数 -test_case() { - local name=$1 - local expected=$2 - local actual=$3 - - if [ "$expected" == "$actual" ]; then - echo -e "${GREEN}✓${NC} $name" - ((PASS++)) - else - echo -e "${RED}✗${NC} $name" - echo " 预期: $expected" - echo " 实际: $actual" - ((FAIL++)) - fi -} - -echo "1️⃣ 检查前端代码" -echo "-------------------------------------------" - -# 检查文件是否存在 -if [ -f "ruoyi-ui/src/views/ccdi/modelParam/index.vue" ]; then - echo -e "${GREEN}✓${NC} 全局配置页面文件存在" - ((PASS++)) -else - echo -e "${RED}✗${NC} 全局配置页面文件不存在" - ((FAIL++)) -fi - -if [ -f "ruoyi-ui/src/views/ccdiProject/components/detail/ParamConfig.vue" ]; then - echo -e "${GREEN}✓${NC} 项目配置页面文件存在" - ((PASS++)) -else - echo -e "${RED}✗${NC} 项目配置页面文件不存在" - ((FAIL++)) -fi - -# 检查API方法 -if grep -q "listAllParams" ruoyi-ui/src/api/ccdi/modelParam.js; then - echo -e "${GREEN}✓${NC} listAllParams API方法存在" - ((PASS++)) -else - echo -e "${RED}✗${NC} listAllParams API方法不存在" - ((FAIL++)) -fi - -if grep -q "saveAllParams" ruoyi-ui/src/api/ccdi/modelParam.js; then - echo -e "${GREEN}✓${NC} saveAllParams API方法存在" - ((PASS++)) -else - echo -e "${RED}✗${NC} saveAllParams API方法不存在" - ((FAIL++)) -fi - -echo "" -echo "2️⃣ 检查loading状态" -echo "-------------------------------------------" - -# 检查loading变量 -if grep -q "loading: false" ruoyi-ui/src/views/ccdi/modelParam/index.vue; then - echo -e "${GREEN}✓${NC} loading状态变量已定义" - ((PASS++)) -else - echo -e "${RED}✗${NC} loading状态变量未定义" - ((FAIL++)) -fi - -# 检查v-loading指令 -if grep -q "v-loading=\"loading\"" ruoyi-ui/src/views/ccdi/modelParam/index.vue; then - echo -e "${GREEN}✓${NC} v-loading指令已使用" - ((PASS++)) -else - echo -e "${RED}✗${NC} v-loading指令未使用" - ((FAIL++)) -fi - -# 检查空状态 -if grep -q "暂无参数配置数据" ruoyi-ui/src/views/ccdi/modelParam/index.vue; then - echo -e "${GREEN}✓${NC} 空状态提示已添加" - ((PASS++)) -else - echo -e "${RED}✗${NC} 空状态提示未添加" - ((FAIL++)) -fi - -echo "" -echo "3️⃣ 检查修改追踪" -echo "-------------------------------------------" - -# 检查markAsModified方法 -if grep -q "markAsModified" ruoyi-ui/src/views/ccdi/modelParam/index.vue; then - echo -e "${GREEN}✓${NC} markAsModified方法存在" - ((PASS++)) -else - echo -e "${RED}✗${NC} markAsModified方法不存在" - ((FAIL++)) -fi - -# 检查$set使用 -if grep -q "\$set" ruoyi-ui/src/views/ccdi/modelParam/index.vue; then - echo -e "${GREEN}✓${NC} 使用$set确保响应式" - ((PASS++)) -else - echo -e "${RED}✗${NC} 未使用$set" - ((FAIL++)) -fi - -# 检查修改计数 -if grep -q "modifiedCount" ruoyi-ui/src/views/ccdi/modelParam/index.vue; then - echo -e "${GREEN}✓${NC} modifiedCount计算属性存在" - ((PASS++)) -else - echo -e "${RED}✗${NC} modifiedCount计算属性不存在" - ((FAIL++)) -fi - -echo "" -echo "4️⃣ 检查保存功能" -echo "-------------------------------------------" - -# 检查保存方法 -if grep -q "handleSaveAll" ruoyi-ui/src/views/ccdi/modelParam/index.vue; then - echo -e "${GREEN}✓${NC} handleSaveAll方法存在" - ((PASS++)) -else - echo -e "${RED}✗${NC} handleSaveAll方法不存在" - ((FAIL++)) -fi - -# 检查saving状态 -if grep -q "saving: false" ruoyi-ui/src/views/ccdi/modelParam/index.vue; then - echo -e "${GREEN}✓${NC} saving状态变量已定义" - ((PASS++)) -else - echo -e "${RED}✗${NC} saving状态变量未定义" - ((FAIL++)) -fi - -# 检查按钮loading -if grep -q ":loading=\"saving\"" ruoyi-ui/src/views/ccdi/modelParam/index.vue; then - echo -e "${GREEN}✓${NC} 保存按钮绑定loading状态" - ((PASS++)) -else - echo -e "${RED}✗${NC} 保存按钮未绑定loading状态" - ((FAIL++)) -fi - -echo "" -echo "5️⃣ 检查后端接口" -echo "-------------------------------------------" - -# 检查Mapper方法 -if grep -q "selectByProjectId" ccdi-project/src/main/java/com/ruoyi/ccdi/project/mapper/CcdiModelParamMapper.java 2>/dev/null; then - echo -e "${GREEN}✓${NC} selectByProjectId Mapper方法存在" - ((PASS++)) -else - echo -e "${RED}✗${NC} selectByProjectId Mapper方法不存在" - ((FAIL++)) -fi - -# 检查Service方法 -if grep -q "selectAllParams" ccdi-project/src/main/java/com/ruoyi/ccdi/project/service/ICcdiModelParamService.java 2>/dev/null; then - echo -e "${GREEN}✓${NC} selectAllParams Service方法存在" - ((PASS++)) -else - echo -e "${RED}✗${NC} selectAllParams Service方法不存在" - ((FAIL++)) -fi - -# 检查Controller接口 -if grep -q "listAll" ccdi-project/src/main/java/com/ruoyi/ccdi/project/controller/CcdiModelParamController.java 2>/dev/null; then - echo -e "${GREEN}✓${NC} listAll Controller接口存在" - ((PASS++)) -else - echo -e "${RED}✗${NC} listAll Controller接口不存在" - ((FAIL++)) -fi - -if grep -q "saveAll" ccdi-project/src/main/java/com/ruoyi/ccdi/project/controller/CcdiModelParamController.java 2>/dev/null; then - echo -e "${GREEN}✓${NC} saveAll Controller接口存在" - ((PASS++)) -else - echo -e "${RED}✗${NC} saveAll Controller接口不存在" - ((FAIL++)) -fi - -echo "" -echo "6️⃣ 检查测试文件" -echo "-------------------------------------------" - -# 检查测试文件 -if [ -f "ruoyi-ui/tests/e2e/model-param-config.test.js" ]; then - echo -e "${GREEN}✓${NC} 端到端测试文件存在" - ((PASS++)) -else - echo -e "${RED}✗${NC} 端到端测试文件不存在" - ((FAIL++)) -fi - -# 检查测试计划 -if [ -f "docs/test-plans/2026-03-09-e2e-test-plan.md" ]; then - echo -e "${GREEN}✓${NC} 测试计划文档存在" - ((PASS++)) -else - echo -e "${RED}✗${NC} 测试计划文档不存在" - ((FAIL++)) -fi - -echo "" -echo "======================================" -echo -e "测试结果: ${GREEN}通过 $PASS${NC} / ${RED}失败 $FAIL${NC}" -echo "======================================" -echo "" - -if [ $FAIL -eq 0 ]; then - echo -e "${GREEN}✅ 所有检查项通过!${NC}" - echo "" - echo "📋 下一步:" - echo "1. 启动后端服务: mvn spring-boot:run" - echo "2. 启动前端服务: cd ruoyi-ui && npm run dev" - echo "3. 访问页面: http://localhost:80/ccdi/modelParam" - echo "4. 手动验证功能:" - echo " - 查看loading效果" - echo " - 修改参数,查看修改数量" - echo " - 保存参数,查看保存状态" - echo "" - exit 0 -else - echo -e "${RED}❌ 有 $FAIL 项检查未通过${NC}" - echo "" - echo "请检查上述失败项并修复" - exit 1 -fi diff --git a/tests/deploy/test_deploy_to_nas.py b/tests/deploy/test_deploy_to_nas.py deleted file mode 100644 index 8a3918ac..00000000 --- a/tests/deploy/test_deploy_to_nas.py +++ /dev/null @@ -1,97 +0,0 @@ -import subprocess -from pathlib import Path - - -REPO_ROOT = Path(__file__).resolve().parents[2] -DEPLOY_PS1 = REPO_ROOT / "deploy" / "deploy.ps1" -DEPLOY_BAT = REPO_ROOT / "deploy" / "deploy-to-nas.bat" -DOCKER_COMPOSE = REPO_ROOT / "docker-compose.yml" -ENV_EXAMPLE = REPO_ROOT / ".env.example" -LSFX_MOCK_COMPOSE = REPO_ROOT / "lsfx-mock-server" / "docker-compose.yml" - - -def run_powershell(*args): - return subprocess.run( - [ - "powershell", - "-NoProfile", - "-ExecutionPolicy", - "Bypass", - "-File", - str(DEPLOY_PS1), - *args, - ], - cwd=REPO_ROOT, - capture_output=True, - text=True, - encoding="utf-8", - ) - - -def run_bat(*args): - return subprocess.run( - [ - "cmd.exe", - "/c", - str(DEPLOY_BAT), - *args, - ], - cwd=REPO_ROOT, - capture_output=True, - text=True, - encoding="utf-8", - ) - - -def test_deploy_ps1_dry_run_prints_target(): - result = run_powershell("-DryRun") - output = f"{result.stdout}\n{result.stderr}" - - assert result.returncode == 0 - assert "DryRun" in output - assert "116.62.17.81" in output - assert "9444" in output - assert "/volume1/webapp/ccdi" in output - - -def test_bat_dry_run_uses_default_nas_target(): - result = run_bat("--dry-run") - output = f"{result.stdout}\n{result.stderr}" - - assert result.returncode == 0 - assert "DryRun" in output - assert "116.62.17.81" in output - assert "9444" in output - assert "/volume1/webapp/ccdi" in output - - -def test_bat_dry_run_accepts_override_arguments(): - result = run_bat("1.2.3.4", "9000", "demo", "demoPwd", "/demo/path", "--dry-run") - output = f"{result.stdout}\n{result.stderr}" - - assert result.returncode == 0 - assert "1.2.3.4" in output - assert "9000" in output - assert "demo" in output - assert "/demo/path" in output - - -def test_compose_exposes_lsfx_mock_port_via_backend_namespace(): - compose_text = DOCKER_COMPOSE.read_text(encoding="utf-8") - - assert '${LSFX_MOCK_PORT:-62320}:8000' in compose_text - assert 'network_mode: "service:backend"' in compose_text - - -def test_compose_defaults_backend_profile_to_nas(): - compose_text = DOCKER_COMPOSE.read_text(encoding="utf-8") - env_text = ENV_EXAMPLE.read_text(encoding="utf-8") - - assert '${SPRING_PROFILES_ACTIVE:-nas}' in compose_text - assert 'SPRING_PROFILES_ACTIVE=nas' in env_text - - -def test_lsfx_mock_standalone_compose_exposes_62320(): - compose_text = LSFX_MOCK_COMPOSE.read_text(encoding="utf-8") - - assert '"62320:8000"' in compose_text diff --git a/tests/frontend/upload-file-action-rules.test.mjs b/tests/frontend/upload-file-action-rules.test.mjs deleted file mode 100644 index a267bc63..00000000 --- a/tests/frontend/upload-file-action-rules.test.mjs +++ /dev/null @@ -1,22 +0,0 @@ -import assert from "node:assert/strict"; -import { - getUploadFileAction, - getUploadFileStatusText, - getUploadFileStatusType -} from "../../ruoyi-ui/src/views/ccdiProject/components/detail/uploadFileActionRules.js"; - -assert.deepEqual(getUploadFileAction("parsed_failed"), { - key: "viewError", - text: "查看错误原因" -}); -assert.deepEqual(getUploadFileAction("parsed_success"), { - key: "delete", - text: "删除" -}); -assert.equal(getUploadFileAction("uploading"), null); -assert.equal(getUploadFileAction("parsing"), null); -assert.equal(getUploadFileAction("deleted"), null); -assert.equal(getUploadFileStatusText("deleted"), "已删除"); -assert.equal(getUploadFileStatusType("deleted"), "info"); - -console.log("PASS");