Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import {
env,
record,
RecorderEnvironmentSetup,
Recorder
Recorder,
delay,
isPlaybackMode
} from "@azure-tools/test-recorder";
import * as assert from "assert";
import { ClientSecretCredential } from "@azure/identity";
Expand All @@ -33,6 +35,10 @@ const recorderEnvSetup: RecorderEnvironmentSetup = {
queryParametersToSkip: []
};

export const testPollingOptions = {
updateIntervalInMs: isPlaybackMode() ? 0 : undefined,
};

describe("Apimanagement test", () => {
let recorder: Recorder;
let subscriptionId: string;
Expand Down Expand Up @@ -73,9 +79,8 @@ describe("Apimanagement test", () => {
capacity: 1
},
publisherEmail: "foo@contoso.com",
publisherName: "foo",

});
publisherName: "foo"
},testPollingOptions);
assert.equal(res.name,serviceName);
}).timeout(3600000);

Expand Down Expand Up @@ -103,12 +108,12 @@ describe("Apimanagement test", () => {
customProperties: {
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": "false"
}
});
},testPollingOptions);
assert.equal(res.type,"Microsoft.ApiManagement/service");
break;
}else {
// The resource is activating
await sleep(300000);
await delay(300000)
}
}
}).timeout(3600000);
Expand All @@ -119,8 +124,8 @@ describe("Apimanagement test", () => {
count++;
const res = await client.apiManagementService.get(resourceGroupName,serviceName);
if(res.provisioningState == "Succeeded"){
const res = await client.apiManagementService.beginDeleteAndWait(resourceGroupName,serviceName);
const purge_resource = await client.deletedServices.beginPurgeAndWait(serviceName,location);
const res = await client.apiManagementService.beginDeleteAndWait(resourceGroupName,serviceName,testPollingOptions);
const purge_resource = await client.deletedServices.beginPurgeAndWait(serviceName,location,testPollingOptions);
const resArray = new Array();
for await (let item of client.apiManagementService.listByResourceGroup(resourceGroupName)){
resArray.push(item);
Expand All @@ -129,7 +134,7 @@ describe("Apimanagement test", () => {
break;
}else {
// The resource is activating
await sleep(300000);
await delay(300000);
}
}
}).timeout(3600000);
Expand Down
16 changes: 11 additions & 5 deletions sdk/appplatform/arm-appplatform/test/appplatform_examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import {
env,
record,
RecorderEnvironmentSetup,
Recorder
Recorder,
delay,
isPlaybackMode
} from "@azure-tools/test-recorder";
import * as assert from "assert";
import { ClientSecretCredential } from "@azure/identity";
Expand All @@ -33,6 +35,10 @@ const recorderEnvSetup: RecorderEnvironmentSetup = {
queryParametersToSkip: []
};

export const testPollingOptions = {
updateIntervalInMs: isPlaybackMode() ? 0 : undefined,
};

describe("AppPlatform test", () => {
let recorder: Recorder;
let subscriptionId: string;
Expand Down Expand Up @@ -72,7 +78,7 @@ describe("AppPlatform test", () => {
key1: "value1"
},
location: location
});
},testPollingOptions);
});

it("apps create test", async function() {
Expand All @@ -91,7 +97,7 @@ describe("AppPlatform test", () => {
mountPath: "/mypersistentdisk"
}
}
});
},testPollingOptions);
});

it("services get test", async function() {
Expand Down Expand Up @@ -121,7 +127,7 @@ describe("AppPlatform test", () => {
});

it("apps delete test", async function() {
const res = await client.apps.beginDeleteAndWait(resourceGroup,serviceName,appName);
const res = await client.apps.beginDeleteAndWait(resourceGroup,serviceName,appName,testPollingOptions);
const resArray = new Array();
for await (let item of client.apps.list(resourceGroup,serviceName)){
resArray.push(item);
Expand All @@ -130,7 +136,7 @@ describe("AppPlatform test", () => {
});

it("services delete test", async function() {
const res = await client.services.beginDeleteAndWait(resourceGroup,serviceName);
const res = await client.services.beginDeleteAndWait(resourceGroup,serviceName,testPollingOptions);
const resArray = new Array();
for await (let item of client.services.list(resourceGroup)){
resArray.push(item);
Expand Down
23 changes: 16 additions & 7 deletions sdk/compute/arm-compute/test/compute_examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import {
env,
record,
RecorderEnvironmentSetup,
Recorder
Recorder,
delay,
isPlaybackMode
} from "@azure-tools/test-recorder";
import * as assert from "assert";
import { ClientSecretCredential } from "@azure/identity";
Expand All @@ -34,6 +36,10 @@ const recorderEnvSetup: RecorderEnvironmentSetup = {
queryParametersToSkip: []
};

export const testPollingOptions = {
updateIntervalInMs: isPlaybackMode() ? 0 : undefined,
};

describe("Compute test", () => {
let recorder: Recorder;
let subscriptionId: string;
Expand Down Expand Up @@ -82,7 +88,8 @@ describe("Compute test", () => {
const virtualNetworks_create_info = await network_client.virtualNetworks.beginCreateOrUpdateAndWait(
resourceGroupName,
network_name,
parameter
parameter,
testPollingOptions
);

const subnet_parameter: Subnet = {
Expand All @@ -92,7 +99,8 @@ describe("Compute test", () => {
resourceGroupName,
network_name,
subnet_name,
subnet_parameter
subnet_parameter,
testPollingOptions
);
}

Expand Down Expand Up @@ -124,7 +132,8 @@ describe("Compute test", () => {
const nic_info = await network_client.networkInterfaces.beginCreateOrUpdateAndWait(
group_name,
nic_name,
parameter
parameter,
testPollingOptions
);
}

Expand Down Expand Up @@ -226,7 +235,7 @@ describe("Compute test", () => {
},
],
}
});
}, testPollingOptions);
assert.equal(res.name,virtual_machine_name);
});

Expand Down Expand Up @@ -260,12 +269,12 @@ describe("Compute test", () => {
},
],
}
})
}, testPollingOptions)
assert.equal(res.type,"Microsoft.Compute/virtualMachines");
});

it("virtualMachines delete test", async function() {
const res = await client.virtualMachines.beginDeleteAndWait(resourceGroupName,virtual_machine_name);
const res = await client.virtualMachines.beginDeleteAndWait(resourceGroupName,virtual_machine_name,testPollingOptions);
const resArray = new Array();
for await (const item of client.virtualMachines.list(resourceGroupName)) {
resArray.push(item);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import {
env,
record,
RecorderEnvironmentSetup,
Recorder
Recorder,
delay,
isPlaybackMode
} from "@azure-tools/test-recorder";
import * as assert from "assert";
import { ClientSecretCredential } from "@azure/identity";
Expand All @@ -33,6 +35,10 @@ const recorderEnvSetup: RecorderEnvironmentSetup = {
queryParametersToSkip: []
};

export const testPollingOptions = {
updateIntervalInMs: isPlaybackMode() ? 0 : undefined,
};

describe("ContainerRegistry test", () => {
let recorder: Recorder;
let subscriptionId: string;
Expand Down Expand Up @@ -76,7 +82,7 @@ describe("ContainerRegistry test", () => {
name: "Premium"
},
adminUserEnabled: false
});
},testPollingOptions);
assert.equal(res.name,registryName)
});

Expand All @@ -96,7 +102,7 @@ describe("ContainerRegistry test", () => {
"DeleteSourceBlobOnSuccess",
"ContinueOnErrors"
]
});
},testPollingOptions);
assert.equal(res.name,importPipelineName)
});

Expand All @@ -114,7 +120,7 @@ describe("ContainerRegistry test", () => {
options: [
"OverwriteBlobs"
]
});
},testPollingOptions);
assert.equal(res.name,exportPipelineName);
});

Expand Down Expand Up @@ -145,7 +151,7 @@ describe("ContainerRegistry test", () => {
});

it("importPipelines delete test", async function() {
const res = await client.importPipelines.beginDeleteAndWait(resourceGroup,registryName,importPipelineName);
const res = await client.importPipelines.beginDeleteAndWait(resourceGroup,registryName,importPipelineName,testPollingOptions);
const resArray = new Array();
for await (let item of client.importPipelines.list(resourceGroup,registryName)){
resArray.push(item);
Expand All @@ -154,7 +160,7 @@ describe("ContainerRegistry test", () => {
});

it("exportPipelines delete test", async function() {
const res = await client.exportPipelines.beginDeleteAndWait(resourceGroup,registryName,exportPipelineName);
const res = await client.exportPipelines.beginDeleteAndWait(resourceGroup,registryName,exportPipelineName,testPollingOptions);
const resArray = new Array();
for await (let item of client.exportPipelines.list(resourceGroup,registryName)){
resArray.push(item);
Expand Down Expand Up @@ -192,7 +198,7 @@ describe("ContainerRegistry test", () => {
status: "Enabled"
}
}
});
},testPollingOptions);
assert.equal(res.name,taskName);
});

Expand Down Expand Up @@ -238,12 +244,12 @@ describe("ContainerRegistry test", () => {
status: "Enabled"
}
}
});
},testPollingOptions);
assert.equal(res.type,"Microsoft.ContainerRegistry/registries/tasks");
});

it("tasks delete test", async function() {
const res = await client.tasks.beginDeleteAndWait(resourceGroup,registryName,taskName);
const res = await client.tasks.beginDeleteAndWait(resourceGroup,registryName,taskName,testPollingOptions);
const resArray = new Array();
for await (let item of client.tasks.list(resourceGroup,registryName)){
resArray.push(item);
Expand All @@ -252,6 +258,6 @@ describe("ContainerRegistry test", () => {
});

it("registries delete test", async function() {
const res = await client.registries.beginDeleteAndWait(resourceGroup,registryName);
const res = await client.registries.beginDeleteAndWait(resourceGroup,registryName,testPollingOptions);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import {
env,
record,
RecorderEnvironmentSetup,
Recorder
Recorder,
delay,
isPlaybackMode
} from "@azure-tools/test-recorder";
import * as assert from "assert";
import { ClientSecretCredential } from "@azure/identity";
Expand All @@ -33,6 +35,10 @@ const recorderEnvSetup: RecorderEnvironmentSetup = {
queryParametersToSkip: []
};

export const testPollingOptions = {
updateIntervalInMs: isPlaybackMode() ? 0 : undefined,
};

describe("ContainerService test", () => {
let recorder: Recorder;
let subscriptionId: string;
Expand Down Expand Up @@ -86,7 +92,7 @@ describe("ContainerService test", () => {
secret: secret
},
location: location
});
},testPollingOptions);
assert.equal(res.name,resourceName);
});

Expand All @@ -109,12 +115,12 @@ describe("ContainerService test", () => {
});

it("managedClusters update test", async function() {
const res = await client.managedClusters.beginUpdateTagsAndWait(resourceGroupName,resourceName,{tags: {tier: "testing",archv3: ""}});
const res = await client.managedClusters.beginUpdateTagsAndWait(resourceGroupName,resourceName,{tags: {tier: "testing",archv3: ""}},testPollingOptions);
assert.equal(res.type,"Microsoft.ContainerService/ManagedClusters");
});

it("managedClusters delete test", async function() {
const res = await client.managedClusters.beginDeleteAndWait(resourceGroupName,resourceName);
const res = await client.managedClusters.beginDeleteAndWait(resourceGroupName,resourceName,testPollingOptions);
const resArray = new Array();
for await (let item of client.managedClusters.list()){
resArray.push(item);
Expand Down
14 changes: 10 additions & 4 deletions sdk/databricks/arm-databricks/test/databricks_examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import {
env,
record,
RecorderEnvironmentSetup,
Recorder
Recorder,
delay,
isPlaybackMode
} from "@azure-tools/test-recorder";
import * as assert from "assert";
import { ClientSecretCredential } from "@azure/identity";
Expand All @@ -33,6 +35,10 @@ const recorderEnvSetup: RecorderEnvironmentSetup = {
queryParametersToSkip: []
};

export const testPollingOptions = {
updateIntervalInMs: isPlaybackMode() ? 0 : undefined,
};

describe("Databricks test", () => {
let recorder: Recorder;
let subscriptionId: string;
Expand Down Expand Up @@ -69,7 +75,7 @@ describe("Databricks test", () => {
sku: {
name: "Standard"
}
});
},testPollingOptions);
assert.equal(res.name,workSpaceName);
});

Expand All @@ -86,11 +92,11 @@ describe("Databricks test", () => {
});

it("workspaces update test", async function() {
const res = await client.workspaces.beginUpdateAndWait(resourceGroup,workSpaceName,{tags: {mytag1: "value1"}});
const res = await client.workspaces.beginUpdateAndWait(resourceGroup,workSpaceName,{tags: {mytag1: "value1"}},testPollingOptions);
assert.equal(res.type,"Microsoft.Databricks/workspaces");
});

it("workspaces delete test", async function() {
const res = await client.workspaces.beginDeleteAndWait(resourceGroup,workSpaceName);
const res = await client.workspaces.beginDeleteAndWait(resourceGroup,workSpaceName,testPollingOptions);
});
});
Loading