Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Storage TestController #18470

Merged
merged 4 commits into from
Jun 17, 2022
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -12,107 +12,101 @@
// limitations under the License.
// ----------------------------------------------------------------------------------


using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
using Xunit;
using Xunit.Abstractions;

namespace Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests
{
public class StorageBlobTests : RMTestBase
public class StorageBlobTests : StorageTestRunner
{
public XunitTracingInterceptor _logger;

public StorageBlobTests(ITestOutputHelper output)
: base(output)
{
_logger = new XunitTracingInterceptor(output);
XunitTracingInterceptor.AddToContext(_logger);
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestStorageBlobIsVersioningEnabled()
{
TestController.NewInstance.RunPsTest(_logger, "Test-StorageBlobIsVersioningEnabled");
TestRunner.RunTestScript("Test-StorageBlobIsVersioningEnabled");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestStorageBlobContainer()
{
TestController.NewInstance.RunPsTest(_logger, "Test-StorageBlobContainer");
TestRunner.RunTestScript("Test-StorageBlobContainer");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestStorageBlobContainerEncryptionScope()
{
TestController.NewInstance.RunPsTest(_logger, "Test-StorageBlobContainerEncryptionScope");
}
TestRunner.RunTestScript("Test-StorageBlobContainerEncryptionScope");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestStorageBlobContainerLegalHold()
{
TestController.NewInstance.RunPsTest(_logger, "Test-StorageBlobContainerLegalHold");
TestRunner.RunTestScript("Test-StorageBlobContainerLegalHold");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestStorageBlobContainerImmutabilityPolicy()
{
TestController.NewInstance.RunPsTest(_logger, "Test-StorageBlobContainerImmutabilityPolicy");
TestRunner.RunTestScript("Test-StorageBlobContainerImmutabilityPolicy");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestStorageBlobServiceProperties()
{
TestController.NewInstance.RunPsTest(_logger, "Test-StorageBlobServiceProperties");
}
TestRunner.RunTestScript("Test-StorageBlobServiceProperties");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestStorageBlobORS()
{
TestController.NewInstance.RunPsTest(_logger, "Test-StorageBlobORS");
TestRunner.RunTestScript("Test-StorageBlobORS");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestStorageBlobRestore()
{
TestController.NewInstance.RunPsTest(_logger, "Test-StorageBlobRestore");
TestRunner.RunTestScript("Test-StorageBlobRestore");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestStorageBlobChangeFeed()
{
TestController.NewInstance.RunPsTest(_logger, "Test-StorageBlobChangeFeed");
TestRunner.RunTestScript("Test-StorageBlobChangeFeed");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestStorageBlobContainerSoftDelete()
{
TestController.NewInstance.RunPsTest(_logger, "Test-StorageBlobContainerSoftDelete");
TestRunner.RunTestScript("Test-StorageBlobContainerSoftDelete");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestStorageBlobLastAccessTimeTracking()
{
TestController.NewInstance.RunPsTest(_logger, "Test-StorageBlobLastAccessTimeTracking");
TestRunner.RunTestScript("Test-StorageBlobLastAccessTimeTracking");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestStorageBlobContainerVLW()
{
TestController.NewInstance.RunPsTest(_logger, "Test-StorageBlobContainerVLW");
TestRunner.RunTestScript("Test-StorageBlobContainerVLW");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,83 +12,72 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using System;
using System.Collections;
using System.Collections.ObjectModel;
using System.Management.Automation;
using Xunit;
using Xunit.Abstractions;
using System.Diagnostics;
using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
using Microsoft.Azure.Management.Internal.Resources;
using Microsoft.Azure.Management.Storage;
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;

namespace Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests
{
public class StorageDataPlaneTests : RMTestBase
public class StorageDataPlaneTests : StorageTestRunner
{
public XunitTracingInterceptor _logger;
private string resourceGroupName;
private string storageAccountName;

public StorageDataPlaneTests(ITestOutputHelper output)
: base(output)
{
resourceGroupName = TestUtilities.GenerateName();
storageAccountName = "sto" + resourceGroupName;
_logger = new XunitTracingInterceptor(output);
XunitTracingInterceptor.AddToContext(_logger);
}

[Fact]
[Trait(Category.RunType, Category.LiveOnly)]
public void TestBlob()
{
TestController.NewInstance.RunPsTest(_logger, $"Test-Blob -ResourceGroupName \"{resourceGroupName}\" -StorageAccountName \"{storageAccountName}\"");
TestRunner.RunTestScript($"Test-Blob -ResourceGroupName \"{resourceGroupName}\" -StorageAccountName \"{storageAccountName}\"");
}

[Fact]
[Trait(Category.RunType, Category.LiveOnly)]
public void TestFile()
{
TestController.NewInstance.RunPsTest(_logger, $"Test-File -ResourceGroupName \"{resourceGroupName}\" -StorageAccountName \"{storageAccountName}\"");
TestRunner.RunTestScript($"Test-File -ResourceGroupName \"{resourceGroupName}\" -StorageAccountName \"{storageAccountName}\"");
}

[Fact]
[Trait(Category.RunType, Category.LiveOnly)]
public void TestBlobFileCopy()
{
TestController.NewInstance.RunPsTest(_logger, $"Test-BlobFileCopy -ResourceGroupName \"{resourceGroupName}\" -StorageAccountName \"{storageAccountName}\"");
TestRunner.RunTestScript($"Test-BlobFileCopy -ResourceGroupName \"{resourceGroupName}\" -StorageAccountName \"{storageAccountName}\"");
}

[Fact]
[Trait(Category.RunType, Category.LiveOnly)]
public void TestTable()
{
TestController.NewInstance.RunPsTest(_logger, $"Test-Table -ResourceGroupName \"{resourceGroupName}\" -StorageAccountName \"{storageAccountName}\"");
TestRunner.RunTestScript($"Test-Table -ResourceGroupName \"{resourceGroupName}\" -StorageAccountName \"{storageAccountName}\"");
}

[Fact]
[Trait(Category.RunType, Category.LiveOnly)]
public void TestQueue()
{
TestController.NewInstance.RunPsTest(_logger, $"Test-Queue -ResourceGroupName \"{resourceGroupName}\" -StorageAccountName \"{storageAccountName}\"");
TestRunner.RunTestScript($"Test-Queue -ResourceGroupName \"{resourceGroupName}\" -StorageAccountName \"{storageAccountName}\"");
}

[Fact]
[Trait(Category.RunType, Category.LiveOnly)]
public void TestCommon()
{
TestController.NewInstance.RunPsTest(_logger, $"Test-Common -ResourceGroupName \"{resourceGroupName}\" -StorageAccountName \"{storageAccountName}\"");
TestRunner.RunTestScript($"Test-Common -ResourceGroupName \"{resourceGroupName}\" -StorageAccountName \"{storageAccountName}\"");
}

[Fact]
[Trait(Category.RunType, Category.LiveOnly)]
public void TestDatalakeGen2()
{
TestController.NewInstance.RunPsTest(_logger, $"Test-DatalakeGen2 -ResourceGroupName \"{resourceGroupName}\" -StorageAccountName \"{storageAccountName}\"");
TestRunner.RunTestScript($"Test-DatalakeGen2 -ResourceGroupName \"{resourceGroupName}\" -StorageAccountName \"{storageAccountName}\"");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,65 +12,59 @@
// limitations under the License.
// ----------------------------------------------------------------------------------


using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
using Xunit;
using Xunit.Abstractions;

namespace Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests
{
public class StorageFileTests : RMTestBase
public class StorageFileTests : StorageTestRunner
{
public XunitTracingInterceptor _logger;

public StorageFileTests(ITestOutputHelper output)
: base(output)
{
_logger = new XunitTracingInterceptor(output);
XunitTracingInterceptor.AddToContext(_logger);
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestStorageFileShare()
{
TestController.NewInstance.RunPsTest(_logger, "Test-StorageFileShare");
TestRunner.RunTestScript("Test-StorageFileShare");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestStorageFileShareGetUsage()
{
TestController.NewInstance.RunPsTest(_logger, "Test-StorageFileShareGetUsage");
TestRunner.RunTestScript("Test-StorageFileShareGetUsage");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestShareSoftDeletee()
{
TestController.NewInstance.RunPsTest(_logger, "Test-ShareSoftDelete");
TestRunner.RunTestScript("Test-ShareSoftDelete");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestShareSnapshot()
{
TestController.NewInstance.RunPsTest(_logger, "Test-ShareSnapshot");
TestRunner.RunTestScript("Test-ShareSnapshot");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestFileServiceProperties()
{
TestController.NewInstance.RunPsTest(_logger, "Test-FileServiceProperties");
TestRunner.RunTestScript("Test-FileServiceProperties");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestAzureStorageShareNFS()
{
TestController.NewInstance.RunPsTest(_logger, "Test-AzureStorageShareNFS");
}
TestRunner.RunTestScript("Test-AzureStorageShareNFS");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Commands.TestFx;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Xunit.Abstractions;

namespace Microsoft.Azure.Commands.Management.Storage.Test
Expand All @@ -28,8 +29,12 @@ protected StorageTestRunner(ITestOutputHelper output)
.WithProjectSubfolderForTests("ScenarioTests")
.WithCommonPsScripts(new[]
{
@"Common.ps1", @"../AzureRM.Resources.ps1"
@"Common.ps1",
@"../AzureRM.Resources.ps1"
})
.WithRecordMatcher((ignoreResourcesClient, resourceProviders, userAgentsToIgnore) =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I mean is the record matcher arguments instead of the matcher itself. In the test controller, there are arguments for the matcher, also need to pass in these arguments in the test runner. The WithRecordMatcher invocation here can be removed as it only instantiated the default matcher.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I didn't notice "arguments".

new PermissiveRecordMatcherWithApiExclusion(ignoreResourcesClient, resourceProviders, userAgentsToIgnore)
)
.WithNewRmModules(helper => new[]
{
helper.RMProfileModule,
Expand Down
Loading