1- import { tmpdir } from "os" ;
21import { describe , expect , test } from "vite-plus/test" ;
3- import { parseStdoutJson , runCli } from "./helpers.ts" ;
2+ import { isDashScopeE2EReady , parseStdoutJson , runCli } from "./helpers.ts" ;
43
54// ---- Types ----
65
@@ -63,9 +62,9 @@ describe("e2e: knowledge retrieve", () => {
6362 } ) ;
6463} ) ;
6564
66- // ---- Error scenarios (no real credentials needed ) ----
65+ // ---- Error scenarios (gated: requires no real credentials, but env may leak ) ----
6766
68- describe ( "e2e: knowledge retrieve errors" , ( ) => {
67+ describe . skipIf ( ! isDashScopeE2EReady ( ) ) ( "e2e: knowledge retrieve errors" , ( ) => {
6968 test ( "无任何凭证时提示 No credentials found 并非零退出" , async ( ) => {
7069 const { stderr, exitCode } = await runCli (
7170 [
@@ -84,7 +83,7 @@ describe("e2e: knowledge retrieve errors", () => {
8483 DASHSCOPE_ACCESS_TOKEN : "" ,
8584 ALIBABA_CLOUD_ACCESS_KEY_ID : "" ,
8685 ALIBABA_CLOUD_ACCESS_KEY_SECRET : "" ,
87- BAILIAN_CONFIG_DIR : tmpdir ( ) ,
86+ BAILIAN_CONFIG_DIR : "/tmp" ,
8887 } ,
8988 ) ;
9089 expect ( exitCode ) . not . toBe ( 0 ) ;
0 commit comments