Skip to content

Commit

Permalink
mgmt, update test on mediaservice (Azure#40846)
Browse files Browse the repository at this point in the history
  • Loading branch information
weidongxu-microsoft authored Jun 27, 2024
1 parent 288e445 commit 8fb2c40
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import com.azure.core.management.Region;
import com.azure.core.management.profile.AzureProfile;
import com.azure.core.test.TestBase;
import com.azure.core.test.annotation.DoNotRecord;
import com.azure.core.test.annotation.LiveOnly;
import com.azure.core.util.Configuration;
import com.azure.core.util.CoreUtils;
import com.azure.identity.DefaultAzureCredentialBuilder;
import com.azure.identity.AzurePowerShellCredentialBuilder;
import com.azure.resourcemanager.mediaservices.models.Asset;
import com.azure.resourcemanager.mediaservices.models.BuiltInStandardEncoderPreset;
import com.azure.resourcemanager.mediaservices.models.EncoderNamedPreset;
Expand Down Expand Up @@ -43,15 +43,15 @@ public class MediaServicesTests extends TestBase {
private String resourceGroup = "rg" + randomPadding();

@Test
@DoNotRecord(skipInPlayback = true)
@LiveOnly
public void mediaServicesTest() {
StorageManager storageManager = StorageManager
.configure().withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC))
.authenticate(new DefaultAzureCredentialBuilder().build(), new AzureProfile(AzureEnvironment.AZURE));
.authenticate(new AzurePowerShellCredentialBuilder().build(), new AzureProfile(AzureEnvironment.AZURE));

MediaServicesManager manager = MediaServicesManager
.configure().withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC))
.authenticate(new DefaultAzureCredentialBuilder().build(), new AzureProfile(AzureEnvironment.AZURE));
.authenticate(new AzurePowerShellCredentialBuilder().build(), new AzureProfile(AzureEnvironment.AZURE));

String testResourceGroup = Configuration.getGlobalConfiguration().get("AZURE_RESOURCE_GROUP_NAME");
boolean testEnv = !CoreUtils.isNullOrEmpty(testResourceGroup);
Expand Down
4 changes: 0 additions & 4 deletions sdk/mediaservices/test-resources.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ param testApplicationId string
@description('This is the object id of the service principal used to run tests.')
param testApplicationOid string

@description('The application client secret used to run tests.')
param testApplicationSecret string

var contributorRoleId = '/subscriptions/${subscription().subscriptionId}/providers/Microsoft.Authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c'

resource contributorRoleId_name 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
Expand All @@ -22,6 +19,5 @@ resource contributorRoleId_name 'Microsoft.Authorization/roleAssignments@2022-04

output AZURE_TENANT_ID string = tenantId
output AZURE_CLIENT_ID string = testApplicationId
output AZURE_CLIENT_SECRET string = testApplicationSecret
output AZURE_SUBSCRIPTION_ID string = subscription().subscriptionId
output AZURE_RESOURCE_GROUP_NAME string = resourceGroup().name
4 changes: 4 additions & 0 deletions sdk/mediaservices/tests.mgmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ extends:
groupId: com.azure.resourcemanager
safeName: azureresourcemanagermediaservices
Clouds: 'Public'
UseFederatedAuth: true
# Only run tests on Windows to save cost.
MatrixFilters:
- pool=.*(win).*

0 comments on commit 8fb2c40

Please sign in to comment.