From 76d56ecaca1c098a882b4bcc0bc351d5cbec045f Mon Sep 17 00:00:00 2001 From: ls147258 Date: Wed, 12 Aug 2026 20:46:13 +0800 Subject: [PATCH] chore: disable model download e2e tests in CI and freeze model command logic Comment out the model download e2e block in __tests__/e2e/ci-mac-linux.sh, which was the only place GitHub Actions exercised model downloads (invoked by ci_node16.yaml on the macOS and Linux jobs). It covered deploy_and_test_model.py across NAS and OSS storage, plus the `s model download` / `s model remove` flow via __tests__/e2e/model/s_file.yaml. The `cd model` / `cd ..` pair is commented together so the working directory stays correct for the `test go runtime` block that follows. Also record two constraints in CLAUDE.md: - The `model` command logic is frozen. src/subCommands/model/ and src/commands-help/model.ts are read-only for future iterations: no refactors, renames, or restructuring, and no indirect behavior changes through shared helpers. - The e2e block stays commented out, and the __tests__/e2e/model/ fixtures are kept in the repo for manual runs. Unit tests under __tests__/ut/commands/model*.ts and artModelService_test.ts are fully mocked (no real downloads) and remain enabled in `npm test`. --- CLAUDE.md | 27 ++++++++++++++++++++++ __tests__/e2e/ci-mac-linux.sh | 43 +++++++++++++++++++---------------- 2 files changed, 50 insertions(+), 20 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 752f66f..fdf2248 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -66,6 +66,33 @@ See `docs/architecture.md` for detailed diagrams. - Logs command: multi-topic search (FCLogs + FCInstanceEvents) for --instance-id, SLS field-specific query syntax - `skill` command: install/update the bundled `s-fc3` skill into agent tools (claude/codex/cursor/qoder/agents), global or project scope; local operation, no credentials +## Constraints + +### `model` Command — Frozen Logic (DO NOT MODIFY) + +**The logic of the `model` command must not be changed in any future iteration.** + +Frozen scope (read-only for all subsequent work): + +| Path | Contents | +| ---- | -------- | +| `src/subCommands/model/` | `model.ts`, `index.ts`, `fileManager.ts`, `constants.ts`, `utils/` | +| `src/commands-help/model.ts` | `model` command help text | + +Rules: + +- Do **not** refactor, rename, restructure, or "improve" anything under the frozen scope — not even style-only or lint-driven edits. +- Do **not** change `model` behavior indirectly via shared helpers it depends on. If a shared change is unavoidable, verify `model` behavior is bit-for-bit unchanged and call it out explicitly in the PR. +- Only exception: an explicit, targeted request from the user to change `model`. Absent that, treat the code as frozen. + +### Model Download E2E Tests — Disabled in CI + +The model download e2e block in `__tests__/e2e/ci-mac-linux.sh` is commented out, so GitHub Actions no longer runs it. It covered `deploy_and_test_model.py` (NAS + OSS storage) and the `s model download` / `s model remove` flow via `__tests__/e2e/model/s_file.yaml`. + +- Keep it commented out. Do not re-enable it without an explicit request. +- The `__tests__/e2e/model/` fixtures stay in the repo for manual runs — do not delete them. +- Unit tests under `__tests__/ut/commands/model_test.ts`, `model_utils_test.ts`, `modelService_test.ts`, and `artModelService_test.ts` are fully mocked (no real downloads) and **remain enabled** in `npm test`. + ## Development Workflow 1. Create branch from `master` diff --git a/__tests__/e2e/ci-mac-linux.sh b/__tests__/e2e/ci-mac-linux.sh index aaaed30..10f00f0 100755 --- a/__tests__/e2e/ci-mac-linux.sh +++ b/__tests__/e2e/ci-mac-linux.sh @@ -30,26 +30,29 @@ else fi -echo "test model download" -cd model -pip install -r requirements.txt -export fc_component_function_name=model-$(uname)-$(uname -m)-$RANDSTR-$RANDOM -python -u deploy_and_test_model.py --model-id iic/cv_LightweightEdge_ocr-recognitoin-general_damo --region cn-shanghai --auto-cleanup -sleep 10 -python -u deploy_and_test_model.py --model-id Qwen/Qwen2.5-0.5B-Instruct --region cn-shanghai --auto-cleanup -sleep 10 -python -u deploy_and_test_model.py --model-id iic/cv_LightweightEdge_ocr-recognitoin-general_damo --region cn-shanghai --storage oss --auto-cleanup -sleep 10 -python -u deploy_and_test_model.py --model-id Qwen/Qwen2.5-0.5B-Instruct --region cn-shanghai --storage oss --auto-cleanup - -sleep 10 -echo "test model s_file.yaml" -# python -u test.py -s model download -t s_file.yaml -s deploy -y -t s_file.yaml --skip-push -s model remove -t s_file.yaml -s remove -y -t s_file.yaml -cd .. +# NOTE: model download e2e tests are temporarily disabled in CI (see CLAUDE.md). +# The `model` command logic itself MUST NOT be modified — only this CI invocation is commented out. +# echo "test model download" +# cd model +# pip install -r requirements.txt +# export fc_component_function_name=model-$(uname)-$(uname -m)-$RANDSTR-$RANDOM +# python -u deploy_and_test_model.py --model-id iic/cv_LightweightEdge_ocr-recognitoin-general_damo --region cn-shanghai --auto-cleanup +# sleep 10 +# python -u deploy_and_test_model.py --model-id Qwen/Qwen2.5-0.5B-Instruct --region cn-shanghai --auto-cleanup +# sleep 10 +# python -u deploy_and_test_model.py --model-id iic/cv_LightweightEdge_ocr-recognitoin-general_damo --region cn-shanghai --storage oss --auto-cleanup +# sleep 10 +# python -u deploy_and_test_model.py --model-id Qwen/Qwen2.5-0.5B-Instruct --region cn-shanghai --storage oss --auto-cleanup +# +# sleep 10 +# echo "test model s_file.yaml" +# # python -u test.py +# s model download -t s_file.yaml +# s deploy -y -t s_file.yaml --skip-push +# s model remove -t s_file.yaml +# s remove -y -t s_file.yaml +# cd .. +echo "skip test model download" echo "test go runtime" cd go