From 073dcb3d98c86e6db78c7a737325f835ea7cf142 Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Fri, 31 Oct 2025 15:09:56 +0800 Subject: [PATCH] test for workloadorchestration --- .../test/public/WorkloadOrchestration.spec.ts | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/sdk/workloadorchestration/arm-workloadorchestration/test/public/WorkloadOrchestration.spec.ts b/sdk/workloadorchestration/arm-workloadorchestration/test/public/WorkloadOrchestration.spec.ts index 16fee6ead4a8..3f3fdaf4b846 100644 --- a/sdk/workloadorchestration/arm-workloadorchestration/test/public/WorkloadOrchestration.spec.ts +++ b/sdk/workloadorchestration/arm-workloadorchestration/test/public/WorkloadOrchestration.spec.ts @@ -12,6 +12,10 @@ import { assert, beforeEach, afterEach, it, describe } from "vitest"; import { createRecorder } from "./utils/recordedClient.js"; import { WorkloadOrchestrationManagementClient } from "../../src/workloadOrchestrationManagementClient.js"; +import * as logger from '@azure/logger'; + +logger.setLogLevel('verbose'); + export const testPollingOptions = { updateIntervalInMs: isPlaybackMode() ? 0 : undefined, }; @@ -45,4 +49,59 @@ describe("WorkloadOrchestration test", () => { } assert.ok(resArray); }); + + it.only("solutionTemplates createVersion test", async function () { + const resourceGroupName = "test-rg"; + const solutionTemplateName = "test-solution-template"; + const schemaName = "test-schema"; + const schemaVersion = "1.0.0"; + const version = "1.0.0"; + + const configurationsStr = `schema: + name: ${schemaName} + version: ${schemaVersion} +configs: + AppName: Hotmelt + TemperatureRangeMax: \${{$val(TemperatureRangeMax)}} + ErrorThreshold: \${{$val(ErrorThreshold)}} + HealthCheckEndpoint: \${{$val(HealthCheckEndpoint)}} + EnableLocalLog: \${{$val(EnableLocalLog)}} + AgentEndpoint: \${{$val(AgentEndpoint)}} + HealthCheckEnabled: \${{$val(HealthCheckEnabled)}} + ApplicationEndpoint: \${{$val(ApplicationEndpoint)}}`; + + const result = await client.solutionTemplates.createVersion( + resourceGroupName, + solutionTemplateName, + { + version: version, + solutionTemplateVersion: { + properties: { + configurations: configurationsStr, + specification: { + components: [ + { + name: "helmcomponent", + type: "helm.v3", + properties: { + chart: { + repo: "ghcr.io/eclipse-symphony/tests/helm/simple-chart", + version: "0.3.0", + wait: true, + timeout: "5m", + }, + }, + }, + ], + }, + orchestratorType: "TO", + }, + }, + }, + ); + + assert.ok(result); + assert.ok(result.properties); + console.log("Solution template version created successfully:", result.name); + }); });