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 HDInsightTestRunner and replace TestController #18127

Merged
merged 1 commit into from
May 12, 2022
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 @@ -12,31 +12,24 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.Azure.Commands.HDInsight.Test.ScenarioTests;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using System;
using System.Collections.Generic;
using System.Text;
using Xunit;
using Xunit.Abstractions;

namespace Commands.HDInsight.Test.ScenarioTests
{
public class HDInsightAutoscaleTests : TestController
public class HDInsightAutoscaleTests : HDInsightTestRunner
{
public XunitTracingInterceptor _logger;

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

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

using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.Azure.Commands.HDInsight.Test.ScenarioTests;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using System;
using System.Collections.Generic;
using System.Text;
using Xunit;
using Xunit.Abstractions;

namespace Commands.HDInsight.Test.ScenarioTests
{
public class HDInsightAzureMonitorTests
public class HDInsightAzureMonitorTests : HDInsightTestRunner
{
public XunitTracingInterceptor _logger;

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

//[Fact(Skip = "test case cannot be re-recorded properly, need help from service team")]
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestAzureMonitorRelatedCommands()
{
TestController.NewInstance.RunPowerShellTest(_logger, "Test-AzureMonitorRelatedCommands");
TestRunner.RunTestScript("Test-AzureMonitorRelatedCommands");
}
}
}
34 changes: 15 additions & 19 deletions src/HDInsight/HDInsight.Test/ScenarioTests/HDInsightClusterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,105 +12,101 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

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

namespace Commands.HDInsight.Test.ScenarioTests
{
public class HDInsightClusterTests : TestController
public class HDInsightClusterTests : HDInsightTestRunner
{
public XunitTracingInterceptor _logger;

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

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

[Fact(Skip = "Sikp this")]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestCmkClusterRelatedCommands()
{
TestController.NewInstance.RunPowerShellTest(_logger, "Test-CmkClusterRelatedCommands");
TestRunner.RunTestScript("Test-CmkClusterRelatedCommands");
}

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

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

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

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

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

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

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

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

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

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

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

namespace Commands.HDInsight.Test.ScenarioTests
{
public class HDInsightConfigurationTests
public class HDInsightConfigurationTests : HDInsightTestRunner
{
public XunitTracingInterceptor _logger;

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

[Fact(Skip = "Test requires setting env variable, TODO remove that constraint")]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestConfigurationPipelining()
{
TestController.NewInstance.RunPowerShellTest(_logger, "Test-ConfigurationPipelining");
TestRunner.RunTestScript("Test-ConfigurationPipelining");
}
}
}
12 changes: 4 additions & 8 deletions src/HDInsight/HDInsight.Test/ScenarioTests/HDInsightHostTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,24 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

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

namespace Commands.HDInsight.Test.ScenarioTests
{
public class HDInsightHostTests : TestController
public class HDInsightHostTests : HDInsightTestRunner
{
public XunitTracingInterceptor _logger;

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

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

using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.Azure.Commands.HDInsight.Test.ScenarioTests;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using System;
using System.Collections.Generic;
using System.Text;
using Xunit;
using Xunit.Abstractions;

namespace Commands.HDInsight.Test.ScenarioTests
{
public class HDInsightMonitoringTests
public class HDInsightMonitoringTests : HDInsightTestRunner
{
public XunitTracingInterceptor _logger;

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

[Fact(Skip = "test case cannot be re-recorded properly, need help from service team")]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestMonitoringRelatedCommands()
{
TestController.NewInstance.RunPowerShellTest(_logger, "Test-MonitoringRelatedCommands");
TestRunner.RunTestScript("Test-MonitoringRelatedCommands");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,24 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.Azure.Commands.HDInsight.Test.ScenarioTests;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using System;
using System.Collections.Generic;
using System.Text;
using Xunit;
using Xunit.Abstractions;

namespace Commands.HDInsight.Test.ScenarioTests
{
public class HDInsightScriptActionTests
public class HDInsightScriptActionTests : HDInsightTestRunner
{
public XunitTracingInterceptor _logger;

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

[Fact(Skip="test case cannot be re-recorded properly, need help from service team")]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestScriptActionRelatedCommands()
{
TestController.NewInstance.RunPowerShellTest(_logger, "Test-ScriptActionRelatedCommands");
TestRunner.RunTestScript("Test-ScriptActionRelatedCommands");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,24 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

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

namespace Commands.HDInsight.Test.ScenarioTests
{
public class HDInsightSetGatewayCredentialTest
public class HDInsightSetGatewayCredentialTest : HDInsightTestRunner
{
public XunitTracingInterceptor _logger;

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

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestSetGatewayCredential()
{
TestController.NewInstance.RunPowerShellTest(_logger, "Test-SetGatewayCredential");
TestRunner.RunTestScript("Test-SetGatewayCredential");
}
}
}
Loading