Skip to content

Update Azurestack DiskRP admin SDK#4644

Merged
dsgouda merged 4 commits intoAzure:psSdkJson6from
shanswmicrosoft:PR
Aug 10, 2018
Merged

Update Azurestack DiskRP admin SDK#4644
dsgouda merged 4 commits intoAzure:psSdkJson6from
shanswmicrosoft:PR

Conversation

@shanswmicrosoft
Copy link
Copy Markdown
Contributor

Description

Update Azurestack DiskRP admin SDK - compute module. It includes two kinds of resources:
a. Disk - Get and List
b. DiskMigrationJob - Get, List, Create and Stop.

PR for Swagger:
Azure/azure-rest-api-specs#3418


This checklist is used to make sure that common guidelines for a pull request are followed.

General Guidelines

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

SDK Generation Guidelines

  • If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.
  • The generate.cmd file for the SDK has been updated with the version of AutoRest, as well as the commitid of your swagger spec or link to the swagger spec, used to generate the code.
  • The *.csproj and AssemblyInfo.cs files have been updated with the new version of the SDK.

}
}

var migrationId = "ba0644a4-c2ed-4e3c-a167-089a32865297"; // System.Guid.NewGuid().ToString(); This guid should be the same as the ones in sessionRecord
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove 'System.Guid.NewGuid().StoString();' from comment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sure. thanks.

<VersionPrefix>0.2.0-preview</VersionPrefix>
<VersionPrefix>0.3.0-preview</VersionPrefix>
<AssemblyName>Microsoft.AzureStack.Management.Compute.Admin</AssemblyName>
<PackageTags>Microsoft Azure Stack;Compute;REST HTTP client;azureostackfficial;netcore451511</PackageTags>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You might want to add 'Managed Disks' to the PackageTags. Add others if you feel necessary.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure.

@@ -0,0 +1,62 @@

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you do tests that should fail? For instance try to migrate to a share that doesn't exist or with a disk that is invalid?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Try Assert.False or Assert.Exception constructs.
If you wish to add the tests but enable them at a later time, you could always skip the tests, hope this helps

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have added more tests.

<AssemblyName>Compute.Admin.Tests</AssemblyName>
<VersionPrefix>1.0.0</VersionPrefix>
</PropertyGroup>
<!--<PropertyGroup>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please remove this change. Our tests are now running against netcoreapp2.0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You are saying they should leave this commented out? If so they should just delete this XML entry then.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Leave it commented for now, we will do a cleanup throughout the repo at a later point.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

OK. I will leave it as what it is.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@dsgouda I change it back. thanks.

Copy link
Copy Markdown
Contributor

@dsgouda dsgouda left a comment

Choose a reason for hiding this comment

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

Looks great apart from the minor comment

@deathly809
Copy link
Copy Markdown
Member

@dsgouda We would like tests that verify invalid input.

@dsgouda
Copy link
Copy Markdown
Contributor

dsgouda commented Aug 9, 2018

Will review the rest upon @deathly809 's approval

@deathly809
Copy link
Copy Markdown
Member

@dsgouda Looks good to me! :)

Copy link
Copy Markdown
Contributor

@dsgouda dsgouda left a comment

Choose a reason for hiding this comment

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

Looks great apart from a minor comment. Won't block if you choose to integrate it later

public void ValidateExpectedReturnCode(Action action, HttpStatusCode httpResponseCode)
{
try { action.Invoke(); }
try {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: Highly recommend using Assert.Exception here. Take a look at this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure. Updated. Thanks.

Copy link
Copy Markdown
Contributor

@dsgouda dsgouda left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants