From bdda2b705f68bc6a021a26c07afa496d8959110f Mon Sep 17 00:00:00 2001 From: pikastech Date: Fri, 24 Jul 2026 14:49:51 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=85=8D=E7=BD=AEWorkbench=20CaseRun?= =?UTF-8?q?=E6=A1=A5=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/src/hwlab-native-development.test.ts | 5 +++++ scripts/src/hwlab-native-development.ts | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/scripts/src/hwlab-native-development.test.ts b/scripts/src/hwlab-native-development.test.ts index 02112ccf..37b921ac 100644 --- a/scripts/src/hwlab-native-development.test.ts +++ b/scripts/src/hwlab-native-development.test.ts @@ -12,6 +12,11 @@ test("L1 Workbench exposure uses YAML HTTPS origin and separate bind/probe addre expect(env.WORKBENCH_NATIVE_SERVICE_STATE_DIR).toBe(native!.stateDir); expect(env.WORKBENCH_NATIVE_STATE_FILE).toBe(`${spec.workspace}/${native!.stateFile}`); expect(env.WORKBENCH_MODE).toBe("agentrun-native"); + expect(env.WORKBENCH_CASERUN_API_URL).toBe("http://127.0.0.1:4316"); + expect(env.HWLAB_CASERUN_CASE_REPO).toBe("/root/hwlab-case-registry"); + expect(env.HARNESSRL_CASE_REPOSITORY).toBe("git@github.com:pikasTech/hwlab-case-registry.git"); + expect(env.HARNESSRL_CASE_REF).toBe("main"); + expect(env.HARNESSRL_CASE_COMMIT).toBe("7001995118784976698b711f9cd3a59ab0053a4b"); expect(env.WORKBENCH_CLOUD_API_URL).toBeUndefined(); expect(env.WORKBENCH_CLOUD_API_AUTHORIZATION).toBeUndefined(); expect(env.WORKBENCH_AGENTRUN_TERMINAL_TIMEOUT_MS).toBeUndefined(); diff --git a/scripts/src/hwlab-native-development.ts b/scripts/src/hwlab-native-development.ts index 28835ccb..a282b11b 100644 --- a/scripts/src/hwlab-native-development.ts +++ b/scripts/src/hwlab-native-development.ts @@ -191,6 +191,8 @@ export function hwlabNativeDevelopmentSourceCommitRef(spec: HwlabRuntimeLaneSpec export function hwlabNativeDevelopmentEnvironment(native: HwlabRuntimeNativeDevelopmentSpec["workbench"], spec: HwlabRuntimeLaneSpec, sourceCommit: string): NodeJS.ProcessEnv { const codeAgent = spec.codeAgentRuntime; if (codeAgent === undefined) throw new Error(`${hwlabRuntimeLaneConfigPath()}#lanes.${spec.lane}.targets.${spec.nodeId}.codeAgentRuntime is required`); + const caseRun = spec.nativeDevelopment?.caserun; + if (caseRun === undefined) throw new Error(`${hwlabRuntimeLaneConfigPath()}#lanes.${spec.lane}.targets.${spec.nodeId}.nativeDevelopment.caserun is required`); const kafkaBridge = codeAgent.kafkaEventBridge; if (kafkaBridge === undefined) throw new Error(`${hwlabRuntimeLaneConfigPath()}#lanes.${spec.lane}.targets.${spec.nodeId}.${native.kafka.configRef} is required`); if (native.kafka.features.directPublish !== true) throw new Error("native Workbench Kafka direct mapper must be enabled"); @@ -210,6 +212,11 @@ export function hwlabNativeDevelopmentEnvironment(native: HwlabRuntimeNativeDeve const sessionIndex = native.kafka.refreshReplay.sessionIndex; return { WORKBENCH_MODE: native.mode, + WORKBENCH_CASERUN_API_URL: `http://${caseRun.api.probeHost}:${caseRun.api.port}`, + HWLAB_CASERUN_CASE_REPO: caseRun.caseAuthority.checkoutPath, + HARNESSRL_CASE_REPOSITORY: caseRun.caseAuthority.repositoryUrl, + HARNESSRL_CASE_REF: caseRun.caseAuthority.ref, + HARNESSRL_CASE_COMMIT: caseRun.caseAuthority.commit, WORKBENCH_TEMPORAL_ADDRESS: native.temporal.address, WORKBENCH_TEMPORAL_NAMESPACE: native.temporal.namespace, WORKBENCH_TEMPORAL_TASK_QUEUE: native.temporal.taskQueue,