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

Add SynapseTestRunner to replace SynapseTestBase #18325

Merged
merged 4 commits into from
Jun 7, 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 @@ -15,35 +15,25 @@
namespace Microsoft.Azure.Commands.Synapse.Test.ScenarioTests
{
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using ServiceManagement.Common.Models;
using Xunit;

public class ADOnlyAuthenticationTests : SynapseTestBase
public class ADOnlyAuthenticationTests : SynapseTestRunner
{
public XunitTracingInterceptor _logger;

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

[Fact]
[Trait(Category.AcceptanceType, Category.All)]
public void TestEnableSynapseADOnlyAuthentication()
{
SynapseTestBase.NewInstance.RunPsTest(
_logger,
"Test-EnableSynapseADOnlyAuthentication");
TestRunner.RunTestScript("Test-EnableSynapseADOnlyAuthentication");
}

[Fact]
public void TestDisableSynapseADOnlyAuthentication()
{
SynapseTestBase.NewInstance.RunPsTest(
_logger,
"Test-DisableSynapseADOnlyAuthentication");
TestRunner.RunTestScript("Test-DisableSynapseADOnlyAuthentication");
}
}
}

109 changes: 27 additions & 82 deletions src/Synapse/Synapse.Test/ScenarioTests/AuditTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,247 +12,192 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

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

namespace Microsoft.Azure.Commands.Synapse.Test.ScenarioTests
{
public class AuditTests : SynapseTestBase
public class AuditTests : SynapseTestRunner
{
public XunitTracingInterceptor _logger;

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

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

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

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

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

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

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

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

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

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

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

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

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

[Fact(Skip = "SQL Data Warehouse audit doesn’t support audit actions.")]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestBlobAuditOnSqlPool()
{
NewInstance.RunPsTest(
_logger,
"Test-BlobAuditOnSqlPool");
TestRunner.RunTestScript("Test-BlobAuditOnSqlPool");
}

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

[Fact(Skip = "SQL Data Warehouse audit doesn’t support other audit groups.")]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestBlobAuditWithAuditActionGroups()
{
NewInstance.RunPsTest(
_logger,
"Test-BlobAuditWithAuditActionGroups");
TestRunner.RunTestScript("Test-BlobAuditWithAuditActionGroups");
}

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

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

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
[Trait(Category.RunType, Category.LiveOnly)]
public void TestAuditOnSqlPool()
{
NewInstance.RunPsTest(
_logger,
"Test-AuditOnSqlPool");
TestRunner.RunTestScript("Test-AuditOnSqlPool");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
[Trait(Category.RunType, Category.LiveOnly)]
public void TestAuditOnWorkspace()
{
NewInstance.RunPsTest(
_logger,
"Test-AuditOnWorkspace");
TestRunner.RunTestScript("Test-AuditOnWorkspace");
}

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

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

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

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

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

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestRemoveWorkspaceAuditingSettingsMultipleDiagnosticSettings()
{
NewInstance.RunPsTest(
_logger,
"Test-RemoveWorkspaceAuditingSettingsMultipleDiagnosticSettings");
TestRunner.RunTestScript("Test-RemoveWorkspaceAuditingSettingsMultipleDiagnosticSettings");
}
}
}
17 changes: 4 additions & 13 deletions src/Synapse/Synapse.Test/ScenarioTests/DataClassificationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,29 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

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

namespace Microsoft.Azure.Commands.Synapse.Test.ScenarioTests
{
public class DataClassificationTests : SynapseTestBase
public class DataClassificationTests : SynapseTestRunner
{
public XunitTracingInterceptor _logger;

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

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

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestEnableDisableRecommendationsOnSqlPool()
{
NewInstance.RunPsTest(
_logger,
"Test-EnableDisableRecommendationsOnSqlPool");
TestRunner.RunTestScript("Test-EnableDisableRecommendationsOnSqlPool");
}
}
}
13 changes: 3 additions & 10 deletions src/Synapse/Synapse.Test/ScenarioTests/FirewallTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,19 @@
namespace Microsoft.Azure.Commands.Synapse.Test.ScenarioTests
{
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using ServiceManagement.Common.Models;
using Xunit;

public class FirewallTests : SynapseTestBase
public class FirewallTests : SynapseTestRunner
{
public XunitTracingInterceptor _logger;

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

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestSynapseFirewall()
{
SynapseTestBase.NewInstance.RunPsTest(
_logger,
"Test-SynapseFirewall");
TestRunner.RunTestScript("Test-SynapseFirewall");
}
}
}
Loading