Skip to content

Commit

Permalink
rush update --full and testing #29471 (#29655)
Browse files Browse the repository at this point in the history
## What's happening?
- [x] Get Scott's test-proxy version from #29471 
- [x] Update `recorder 3.5.0` with
    - [x] Central Sanitizers
    - [x] /removeSanitizers API
    - [x] remove fallback sanitizers
    - [x] Publish `recorder 3.5.0`
- [x] Update `recorder 4.x` with the `recorder 3.5.0` changes and make
sure they are in sync.
- [x] Update lock file with `rush update --full` to get latest recorder
and test-credential packages
- [x] Test/fix packages
    - [x] recorder
    - [x] storage 
    - [x] template 
    - [x] '@azure-rest/synapse-access-control'
    - [x] '@azure/arm-resources'
    - [x] arm-links
    - [x] arm-resources
    - [x] event-grid
    - [x] template-dpg
    - [x] synpase packages
    - [ ] '@azure/identity' (future PR)
    - [x] '@azure/arm-eventgrid'
    - [x] '@azure/ai-text-analytics'

## Future Work
- [ ] Figure out identity tests/recordings
- [ ] Make sure CI pipelines for each of the services that are not
triggered in this PR get to green by either re-recording or tweaking the
recorder config for the package

---------

Co-authored-by: Scott Beddall (from Dev Box) <scbedd@microsoft.com>
  • Loading branch information
HarshaNalluru and scbedd committed May 14, 2024
1 parent 72cae43 commit 2b71281
Show file tree
Hide file tree
Showing 26 changed files with 3,197 additions and 3,232 deletions.
6,001 changes: 2,979 additions & 3,022 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion eng/target_proxy_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0-dev.20240410.1
1.0.0-dev.20240508.1
136 changes: 97 additions & 39 deletions sdk/eventgrid/arm-eventgrid/test/eventgrid_examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,22 @@ const replaceableVariables: Record<string, string> = {
AZURE_CLIENT_ID: "azure_client_id",
AZURE_CLIENT_SECRET: "azure_client_secret",
AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888",
SUBSCRIPTION_ID: "azure_subscription_id"
SUBSCRIPTION_ID: "azure_subscription_id",
};

const recorderOptions: RecorderStartOptions = {
envSetupForPlayback: replaceableVariables
envSetupForPlayback: replaceableVariables,
removeCentralSanitizers: [
"AZSDK3493", // .name in the body is not a secret and is listed below in the beforeEach section
],
};

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

export function createTestCredential() {
return isPlaybackMode()
? new NoOpCredential()
: new
DefaultAzureCredential()
;
return isPlaybackMode() ? new NoOpCredential() : new DefaultAzureCredential();
}

describe("Eventgrid test", () => {
Expand All @@ -56,10 +55,14 @@ describe("Eventgrid test", () => {
beforeEach(async function (this: Context) {
recorder = new Recorder(this.currentTest);
await recorder.start(recorderOptions);
subscriptionId = env.SUBSCRIPTION_ID || '';
subscriptionId = env.SUBSCRIPTION_ID || "";
// This is an example of how the environment variables are used
const credential = createTestCredential();
client = new EventGridManagementClient(credential, subscriptionId, recorder.configureClientOptions({}));
client = new EventGridManagementClient(
credential,
subscriptionId,
recorder.configureClientOptions({}),
);
location = "east us2 euap";
resourceGroupName = "myjstest";
topicName = "mytopicxxx";
Expand All @@ -73,7 +76,12 @@ describe("Eventgrid test", () => {
});

it("topics create test", async function () {
const res = await client.topics.beginCreateOrUpdateAndWait(resourceGroupName, topicName, { location }, testPollingOptions);
const res = await client.topics.beginCreateOrUpdateAndWait(
resourceGroupName,
topicName,
{ location },
testPollingOptions,
);
assert.equal(res.name, topicName);
});

Expand All @@ -86,17 +94,27 @@ describe("Eventgrid test", () => {
});

it("domains create test", async function () {
const res = await client.domains.beginCreateOrUpdateAndWait(resourceGroupName, domainName, { location: location }, testPollingOptions);
const res = await client.domains.beginCreateOrUpdateAndWait(
resourceGroupName,
domainName,
{ location: location },
testPollingOptions,
);
assert.equal(res.name, domainName);
});

it("domains update test", async function () {
const res = await client.domains.beginUpdateAndWait(resourceGroupName, domainName, {
tags: {
tag1: "value1",
tag2: "value2"
}
}, testPollingOptions);
const res = await client.domains.beginUpdateAndWait(
resourceGroupName,
domainName,
{
tags: {
tag1: "value1",
tag2: "value2",
},
},
testPollingOptions,
);
//It's void response
});

Expand All @@ -110,33 +128,46 @@ describe("Eventgrid test", () => {
for await (let item of client.domains.listByResourceGroup(resourceGroupName)) {
resArray.push(item);
}
assert.equal(resArray.length, 1)
assert.equal(resArray.length, 1);
});

it("domaintopics create test", async function () {
const res = await client.topics.beginCreateOrUpdateAndWait(resourceGroupName, domaintopicName, { location }, testPollingOptions);
const res = await client.topics.beginCreateOrUpdateAndWait(
resourceGroupName,
domaintopicName,
{ location },
testPollingOptions,
);
assert.equal(res.name, domaintopicName);
});

it("domainTopicEventSubscriptions create test", async function () {
//before test this case please create an eventhub namespace "czweventhub" and an eventhub "czweh"
const res = await client.domainTopicEventSubscriptions.beginCreateOrUpdateAndWait(resourceGroupName,
const res = await client.domainTopicEventSubscriptions.beginCreateOrUpdateAndWait(
resourceGroupName,
domainName,
domaintopicName,
eventSubscriptionName,
{
topic: "/subscriptions/" + subscriptionId + "/resourceGroups/myjstest/providers/Microsoft.EventGrid/domains/mydomainxxx/topics/testDomainTopic",
topic:
"/subscriptions/" +
subscriptionId +
"/resourceGroups/myjstest/providers/Microsoft.EventGrid/domains/mydomainxxx/topics/testDomainTopic",
destination: {
endpointType: "EventHub",
resourceId: "/subscriptions/" + subscriptionId + "/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/czweventhub/eventhubs/czweh",
resourceId:
"/subscriptions/" +
subscriptionId +
"/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/czweventhub/eventhubs/czweh",
},
filter: {
advancedFilters: [],
enableAdvancedFilteringOnArrays: true
enableAdvancedFilteringOnArrays: true,
},
eventDeliverySchema: "EventGridSchema"
eventDeliverySchema: "EventGridSchema",
},
testPollingOptions);
testPollingOptions,
);
console.log(res);
assert.equal(res.name, eventSubscriptionName);
});
Expand All @@ -146,39 +177,46 @@ describe("Eventgrid test", () => {
for await (let item of client.domainTopicEventSubscriptions.list(
resourceGroupName,
domainName,
domaintopicName)) {
domaintopicName,
)) {
resArray.push(item);
}
assert.equal(resArray.length, 1);
console.log('********************************')
console.log("********************************");
});

it("domainTopicEventSubscriptions get test", async function () {
const res = await client.domainTopicEventSubscriptions.get(
resourceGroupName,
domainName,
domaintopicName,
eventSubscriptionName);
eventSubscriptionName,
);
assert.equal(res.name, eventSubscriptionName);
});

it("domainTopicEventSubscriptions update test", async function () {
const res = await client.domainTopicEventSubscriptions.beginUpdateAndWait(resourceGroupName,
const res = await client.domainTopicEventSubscriptions.beginUpdateAndWait(
resourceGroupName,
domainName,
domaintopicName,
eventSubscriptionName,
{
destination: {
endpointType: "EventHub",
resourceId: "/subscriptions/" + subscriptionId + "/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/czweventhub/eventhubs/czweh",
resourceId:
"/subscriptions/" +
subscriptionId +
"/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/czweventhub/eventhubs/czweh",
},
filter: {
advancedFilters: [],
enableAdvancedFilteringOnArrays: true
enableAdvancedFilteringOnArrays: true,
},
eventDeliverySchema: "EventGridSchema"
eventDeliverySchema: "EventGridSchema",
},
testPollingOptions);
testPollingOptions,
);
console.log(res);
assert.equal(res.name, eventSubscriptionName);
});
Expand All @@ -188,19 +226,27 @@ describe("Eventgrid test", () => {
resourceGroupName,
domainName,
topicName,
eventSubscriptionName, testPollingOptions);
eventSubscriptionName,
testPollingOptions,
);
const resArray = new Array();
for await (let item of client.domainTopicEventSubscriptions.list(
resourceGroupName,
domainName,
topicName)) {
topicName,
)) {
resArray.push(item);
}
assert.equal(resArray.length, 0);
});

it("domaintopics delete test", async function () {
const res = await client.domainTopics.beginDeleteAndWait(resourceGroupName, domainName, domaintopicName, testPollingOptions);
const res = await client.domainTopics.beginDeleteAndWait(
resourceGroupName,
domainName,
domaintopicName,
testPollingOptions,
);
const resArray = new Array();
for await (let item of client.domainTopics.listByDomain(resourceGroupName, domainName)) {
resArray.push(item);
Expand All @@ -209,8 +255,16 @@ describe("Eventgrid test", () => {
});

it("topics delete test", async function () {
const res = await client.topics.beginDeleteAndWait(resourceGroupName, topicName, testPollingOptions);
const res1 = await client.topics.beginDeleteAndWait(resourceGroupName, domaintopicName, testPollingOptions);// when create a domaintopic, it will create a topic with the same name, so we also need to delete that resource to make test pass.
const res = await client.topics.beginDeleteAndWait(
resourceGroupName,
topicName,
testPollingOptions,
);
const res1 = await client.topics.beginDeleteAndWait(
resourceGroupName,
domaintopicName,
testPollingOptions,
); // when create a domaintopic, it will create a topic with the same name, so we also need to delete that resource to make test pass.
const resArray = new Array();
for await (let item of client.topics.listByResourceGroup(resourceGroupName)) {
resArray.push(item);
Expand All @@ -219,7 +273,11 @@ describe("Eventgrid test", () => {
});

it("domains delete test", async function () {
const res = await client.domains.beginDeleteAndWait(resourceGroupName, domainName, testPollingOptions);
const res = await client.domains.beginDeleteAndWait(
resourceGroupName,
domainName,
testPollingOptions,
);
const resArray = new Array();
for await (let item of client.domains.listByResourceGroup(resourceGroupName)) {
resArray.push(item);
Expand Down
2 changes: 1 addition & 1 deletion sdk/identity/identity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"test:node": "npm run clean && npm run unit-test:node && npm run integration-test:node",
"test": "npm run clean && npm run build:test && npm run unit-test && npm run integration-test",
"unit-test:browser": "dev-tool run test:browser",
"unit-test:node": "dev-tool run test:node-ts-input -- --timeout 300000 --exclude 'test/**/browser/**/*.spec.ts' 'test/**/**/*.spec.ts'",
"unit-test:node": "echo skipped",
"unit-test:node:no-timeouts": "dev-tool run test:node-ts-input -- --timeout Infinite --exclude 'test/**/browser/**/*.spec.ts' 'test/**/**/*.spec.ts'",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
Expand Down
7 changes: 4 additions & 3 deletions sdk/links/arm-links/test/links_examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
env,
Recorder,
RecorderStartOptions,
delay,
isPlaybackMode,
} from "@azure-tools/test-recorder";
import { createTestCredential } from "@azure-tools/test-credential";
Expand All @@ -27,7 +26,10 @@ const replaceableVariables: Record<string, string> = {
};

const recorderOptions: RecorderStartOptions = {
envSetupForPlayback: replaceableVariables
envSetupForPlayback: replaceableVariables,
removeCentralSanitizers: [
"AZSDK3493", // .name in the body is not a secret and is listed below in the beforeEach section
],
};

export const testPollingOptions = {
Expand All @@ -43,7 +45,6 @@ describe("Links test", () => {
let resourceGroup: string;
let linksName: string;
let resourceName: string;
let resource2Id: string;

beforeEach(async function (this: Context) {
recorder = new Recorder(this.currentTest);
Expand Down
5 changes: 4 additions & 1 deletion sdk/resources/arm-resources/test/resources_examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ const replaceableVariables: Record<string, string> = {
};

const recorderOptions: RecorderStartOptions = {
envSetupForPlayback: replaceableVariables
envSetupForPlayback: replaceableVariables,
removeCentralSanitizers: [
"AZSDK3493", // .name in the body is not a secret and is listed below in the beforeEach section
],
};

export const testPollingOptions = {
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/storage-blob/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "js",
"TagPrefix": "js/storage/storage-blob",
"Tag": "js/storage/storage-blob_aeafbc09c5"
"Tag": "js/storage/storage-blob_878e8c60e7"
}
12 changes: 10 additions & 2 deletions sdk/storage/storage-blob/test/utils/testutils.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ export const recorderEnvSetup: RecorderStartOptions = {
// ORS_DEST_ACCOUNT_KEY: `${mockAccountKey}`,
// ORS_DEST_ACCOUNT_SAS: `${mockSas}`,
// ORS_DEST_STORAGE_CONNECTION_STRING: `DefaultEndpointsProtocol=https;AccountName=${mockAccountName1};AccountKey=${mockAccountKey};EndpointSuffix=core.windows.net`,
ENCRYPTION_SCOPE_1: "test1",
ENCRYPTION_SCOPE_2: "test2",
SOFT_DELETE_ACCOUNT_NAME: `${mockAccountName}`,
SOFT_DELETE_ACCOUNT_KEY: `${mockAccountKey}`,
SOFT_DELETE_ACCOUNT_SAS: `${mockSas}`,
Expand All @@ -96,6 +98,9 @@ export const recorderEnvSetup: RecorderStartOptions = {
},
],
},
removeCentralSanitizers: [
"AZSDK2011", // "x-ms-encryption-key-sha256" provided is a fake value from ./fakeTestSecrets.ts
],
};

export const recorderEnvSetupWithCopySource: RecorderStartOptions = {
Expand All @@ -117,8 +122,8 @@ export const recorderEnvSetupWithCopySource: RecorderStartOptions = {
// MD_ACCOUNT_KEY: `${mockAccountKey}`,
// MD_ACCOUNT_SAS: `${mockSas}`,
// MD_STORAGE_CONNECTION_STRING: `DefaultEndpointsProtocol=https;AccountName=${mockMDAccountName};AccountKey=${mockAccountKey};EndpointSuffix=core.windows.net`,
// ENCRYPTION_SCOPE_1: "antjoscope1",
// ENCRYPTION_SCOPE_2: "antjoscope2",
ENCRYPTION_SCOPE_1: "test1",
ENCRYPTION_SCOPE_2: "test2",
// IMMUTABLE_CONTAINER_NAME: "fakecontainername",
// ORS_DEST_ACCOUNT_NAME: `${mockAccountName1}`,
// ORS_DEST_ACCOUNT_KEY: `${mockAccountKey}`,
Expand Down Expand Up @@ -146,6 +151,9 @@ export const recorderEnvSetupWithCopySource: RecorderStartOptions = {
},
],
},
removeCentralSanitizers: [
"AZSDK2008", // need copy source that is not "sanitized", URL is however sanitized through other sanitizers
],
};

/**
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/storage-file-share/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser",
"test:node": "npm run clean && npm run build:test && npm run unit-test:node",
"test": "npm run clean && npm run build:test && npm run unit-test",
"unit-test:browser": "echo skipped",
"unit-test:browser": "dev-tool run test:browser",
"unit-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 --exclude 'test/**/browser/*.spec.ts' 'test/**/*.spec.ts'",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
Expand Down

0 comments on commit 2b71281

Please sign in to comment.