-
Notifications
You must be signed in to change notification settings - Fork 4k
Adding support for creating HDInsight clusters with Datalake storage as default filesystem #3224
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
Conversation
Hi @srsiva, I'm your friendly neighborhood Azure Pull Request Bot (You can call me AZPRBOT). Thanks for your contribution!
TTYL, AZPRBOT; |
Can one of the admins verify this patch? |
@srsiva add to whitelist |
@@ -10,11 +10,18 @@ public DataLakeStoreScenarioTests(Xunit.Abstractions.ITestOutputHelper output) | |||
ServiceManagemenet.Common.Models.XunitTracingInterceptor.AddToContext(new ServiceManagemenet.Common.Models.XunitTracingInterceptor(output)); | |||
} | |||
|
|||
[Fact] | |||
[Fact (Skip = "Test requires fixing GraphAPI by upgrading to latest test framework")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@srsiva could clarify why this test is being skipped. Is it test framework issue or GraphApi issue.
Also make sure you put comment on the test itself as to why is this being skipped and what is the plan to enable it back again.
But at this time, it is not clear why is this being skipped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@srsiva This is not a sufficient reason to skip this test. Please enable and re-record as necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had merged from Azure:dev.
The test framework has been upgraded to Microsoft.Azure.Test.Framework.1.0.6052.28118-prerelease and Graph SDK has been updated to Microsoft.Azure.Graph.RBAC.3.2.0-preview.
However, I am having trouble with getting these upgrades to work with the code.
When I remove the "skip", the NewAzureRmHDInsightCluster cmdlet calls GetApplicationId, which in turn eventually calls MockClientFactory.CreateCustomArmClient.
This function tries to find a management client that it can use (TClient client = ManagementClients.FirstOrDefault(o => o is TClient) as TClient;), fails and then tries to create a real-client by reflecting and calling the constructor.
The problem is that it is not able to create a GraphRbacManagementClient because GraphRbacManagementClient does not have the expected constructor.
I then tried to setup the management client such that MockClientFactory.CreateCustomArmClient will find a client object that it can use directly (and avoid trying to create a real-client via reflection).
I added the code below to HDInsightScenarioTestsBase.cs and expected this to work.
However TestBase.GetGraphServiceClient is throwing a null reference exception...I am not sure why. I am not able to find the code for the TestBase class.
protected void SetupManagementClients()
{
var hdinsightManagementClient = GetHdInsightManagementClient();
var graphRbacManagementClient = TestBase.GetGraphServiceClient(this.csmTestFactory);
helper.SetupSomeOfManagementClients(hdinsightManagementClient, graphRbacManagementClient);
}
Can you help me out with getting this to work ?
Thanks
Siva
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The solution is to update the version of graph rbac manageemnt client you are using. You cna find examples of constructiung the new client here: http://azuresdkci.cloudapp.net/view/1-AzurePowerShell/job/powershell-demand/1313/
You should also be calling SetupManagementClients instead of SetupSomeOfManagementClients, this will make the test fail fast before runtime if client conbstruction fails.
Please ping us, or att
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@markcowl I had upgraded the graph rbac management client to 3.2.0-preview. It still didn't work.
I dug around a bit more and I figured that the new Graph Rbac mgmt client is auto-rest based...and HDInsight was trying to instantiate it using TestBase class from Microsoft.Azure.Test as opposed to Microsoft.Rest.ClientRuntime.Azure.TestFramework.
I tried to make the changes to instantiate HDInsightManagementClient by using Microsoft.Azure.Test ; and GraphRbacManagementClient by Microsoft.Rest.ClientRuntime.Azure.TestFramework....but I ran into some issues.
The call create a graphrbacmgmtclient -- context.GetGraphServiceClient(environment); requires an argument of type TestEnvironment.
The call to create an instance of TestEnvironment -- TestEnvironmentFactory.GetTestEnvironment(); -- fails with an exception "System.InvalidOperationException -- The current SynchronizationContext may not be used as a TaskScheduler".
I am not yet sure why I am running into this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, I think I can just remove the tests that are being skipped currently.
The New-AzureRmHDInsightCluster cmdlet follows the same code path for WASB and ADLS. The only difference between the tests is that the ADL-tests are converting ObjectId into ApplicationId by using GraphAPI.
After converting ObjectId into ApplicationId, the value is included in ClusterCreateParameters and then the SDK takes over by using the clusterCreateParameters to create the cluster.
The functionality that uses ClusterCreateParameters to create the cluster, is already being tested in SDK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@markcowl, @shahabhijeet. I have removed the datalake scenario tests, based on the comments above.
[Trait(Category.AcceptanceType, Category.CheckIn)] | ||
public void TestDataLakeStoreClusterCreate() | ||
{ | ||
NewInstance.RunPsTest("Test-DataLakeStoreClusterCreate"); | ||
} | ||
|
||
[Fact (Skip = "Test requires fixing GraphAPI by upgrading to latest test framework")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@srsiva please be specific the reasons to skip any tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment. Please fix the test and submit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed the datalake scenario tests
<Reference Include="Microsoft.Azure.Management.HDInsight, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
<SpecificVersion>False</SpecificVersion> | ||
<HintPath>..\..\..\packages\Microsoft.Azure.Management.HDInsight.1.3.0\lib\net40\Microsoft.Azure.Management.HDInsight.dll</HintPath> | ||
<Reference Include="Microsoft.Azure.Management.HDInsight"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how come the public key token and all are gone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@shefaliv seems you have approved changes. Could you confirm if you are fine with skipping tests? If yes, I am still not clear the reasons for skipping tests. |
@shefaliv Are you ok with this test coverage being removed? |
Approving the test removal as it is only testing the GraphAPI, which has its own tests by the owning team. Thanks! |
Description
Adding support for creating HDInsight clusters with Datalake storage as default filesystem
This checklist is used to make sure that common guidelines for a pull request are followed. You can find a more complete discussion of PowerShell cmdlet best practices here.
General Guidelines
Testing Guidelines
Cmdlet Signature Guidelines
ShouldProcess
and haveSupportShouldProcess=true
specified in the cmdlet attribute. You can find more information onShouldProcess
here.OutputType
attribute if any output is produced - if the cmdlet produces no output, it should implement aPassThrough
parameter.Cmdlet Parameter Guidelines