Skip to content

Commit 4ce16bb

Browse files
authored
[AutoStop Max VU] Update API version to 2025-03-01-preview and add missing key test (#126)
1 parent 6f0461e commit 4ce16bb

File tree

5 files changed

+48
-2
lines changed

5 files changed

+48
-2
lines changed

lib/models/UtilModels.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ exports.resultZipFileName = 'results.zip';
3333
exports.correlationHeader = 'x-ms-correlation-request-id';
3434
var ApiVersionConstants;
3535
(function (ApiVersionConstants) {
36-
ApiVersionConstants.latestVersion = '2024-12-01-preview';
36+
ApiVersionConstants.latestVersion = '2025-03-01-preview';
3737
ApiVersionConstants.tm2022Version = '2022-11-01';
3838
ApiVersionConstants.cp2022Version = '2022-12-01';
3939
})(ApiVersionConstants || (exports.ApiVersionConstants = ApiVersionConstants = {}));

src/models/UtilModels.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const resultZipFileName = 'results.zip';
5454
export const correlationHeader = 'x-ms-correlation-request-id';
5555

5656
export module ApiVersionConstants {
57-
export const latestVersion = '2024-12-01-preview';
57+
export const latestVersion = '2025-03-01-preview';
5858
export const tm2022Version = '2022-11-01';
5959
export const cp2022Version = '2022-12-01'
6060
}

test/Constants/AutoStopCriteriaYamls.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,23 @@ export const UndefinedMaxVUAutostop : any =
1414
maximumVirtualUsersPerEngine: undefined,
1515
}
1616
}
17+
18+
export const MissingKeyMaxVUAutostop : any =
19+
{
20+
version: 'v0.1',
21+
testId: 'SampleTest',
22+
testName: 'SampleTest',
23+
displayName: 'Sample Test',
24+
description: 'Load test website home page',
25+
testPlan: 'SampleTest.jmx',
26+
testType: 'JMX',
27+
engineInstances: 2,
28+
autoStop: {
29+
errorPercentage: 80,
30+
timeWindow: 60,
31+
}
32+
}
33+
1734
export const NullMaxVUAutostop : any =
1835
{
1936
version: 'v0.1',

test/Constants/TestPayloadConstants.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,26 @@ export const undefinedMaxVUAutostopCriteriaTestExpectedPayload: TestModel = {
455455
engineBuiltinIdentityType: ManagedIdentityTypeForAPI.None,
456456
metricsReferenceIdentityType: ManagedIdentityTypeForAPI.SystemAssigned,
457457
}
458+
459+
460+
export const missingKeyVUAutostopCriteriaTestExpectedPayload: TestModel = {
461+
testId: 'sampletest',
462+
description: 'Load test website home page',
463+
displayName: 'Sample Test',
464+
loadTestConfiguration: {
465+
engineInstances: 2,
466+
},
467+
kind: TestKind.JMX,
468+
autoStopCriteria: {
469+
autoStopDisabled: false,
470+
errorRate: 80,
471+
errorRateTimeWindowInSeconds: 60,
472+
},
473+
keyvaultReferenceIdentityType: ManagedIdentityTypeForAPI.SystemAssigned,
474+
engineBuiltinIdentityType: ManagedIdentityTypeForAPI.None,
475+
metricsReferenceIdentityType: ManagedIdentityTypeForAPI.SystemAssigned,
476+
}
477+
458478
export const nullMaxVUAutostopCriteriaTestExpectedPayload: TestModel = {
459479
testId: 'sampletest',
460480
description: 'Load test website home page',

test/testPayload.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,15 @@ describe('test payload tests', () => {
148148

149149
TestSupport.validateTestPayload(testPayload, TestPayloadConstants.undefinedMaxVUAutostopCriteriaTestExpectedPayload);
150150
});
151+
152+
it("missing key max vu autostop test", async () => {
153+
TestSupport.createAndSetLoadTestConfigFile(AutoStopCriteriaYamls.MissingKeyMaxVUAutostop, coreMock);
154+
let dataPlaneAPIMock = new DataPlaneAPIMock(Constants.loadtestResourceId);
155+
dataPlaneAPIMock.mockGetTest(AutoStopCriteriaYamls.MissingKeyMaxVUAutostop.testId.toLowerCase()!, 404);
156+
await runner.initialize();
157+
let testPayload = await runner.getTestPayload();
158+
TestSupport.validateTestPayload(testPayload, TestPayloadConstants.missingKeyVUAutostopCriteriaTestExpectedPayload);
159+
});
151160

152161
it("null max vu autostop test", async () => {
153162
TestSupport.createAndSetLoadTestConfigFile(AutoStopCriteriaYamls.NullMaxVUAutostop, coreMock);

0 commit comments

Comments
 (0)