feat: 配置Workbench CaseRun桥接
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user