Adding ActivityLogAlerts and ActionGroups API calls, PATCH operations, and the corresponding unit tests#3520
Conversation
… and the corresponding unit tests
|
@azuresdkci test this please |
|
@gucalder can you add link to the swagger PR |
There was a problem hiding this comment.
@gucalder we need basic scenario tests that will test your service.
This is a requirement and we have asked in the past to add these tests.
Please add recorded tests.
Please use latest Resource Manager nuget to record your tests
|
This is the Swagger PR: Azure/azure-rest-api-specs#1481 |
… into psSdkJson6 # Conflicts: # src/SDKs/Monitor/Management.Monitor/generate.cmd
| <!-- PackageReference Update="Microsoft.NET.Test.Sdk" Version="15.0.0" / > | ||
| <PackageReference Update="Microsoft.Rest.ClientRuntime.Azure" Version="3.3.8" / > | ||
| <PackageReference Update="Microsoft.Rest.ClientRuntime.Azure.TestFramework" Version="1.7.2" / --> | ||
| <PackageReference Include="Newtonsoft.Json" Version="6.0.8" /> |
There was a problem hiding this comment.
@gucalder all SDK tests have dependency on newtonsoft.json via clientruntime. Why are you introducing a downgraded version for your tests? What is the reason for doing this?
There was a problem hiding this comment.
That downgraded version comes from AzSdk.reference.props, the item group for net452. It uses 9.0.1 for netstandard1.4. My tests are targeting net452.
Without the explicit reference in the test project all my tests fail in VS with an error that says: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0.... I think this is so since the clientruntime depends on 6.0.8 for net452 (and on 9.0.1 for netstandard1.4.)
There was a problem hiding this comment.
@gucalder any reason you don't have tests that supports .NETStandard1.4
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <Reference Include="System.Net.Http" /> |
There was a problem hiding this comment.
Similarly why do you need a separate System.NET.Http dependency as it is already part of your management client.
Any reason for adding this?
There was a problem hiding this comment.
I get several compilation errors for net452 if I do not include it.
| <ItemGroup> | ||
| <!-- PackageReference Update="Microsoft.NET.Test.Sdk" Version="15.0.0" / > | ||
| <PackageReference Update="Microsoft.Rest.ClientRuntime.Azure" Version="3.3.8" / > | ||
| <PackageReference Update="Microsoft.Rest.ClientRuntime.Azure.TestFramework" Version="1.7.2" / --> |
There was a problem hiding this comment.
@gucalder remove all commented code.
Also use latest Resource manager 1.6.0 at least, you are still targeting 1.1.0 resource manager
Record all your tests using latest resource manager.
There was a problem hiding this comment.
That version of resource manager comes from AzSdk.test.reference.props, which is including it unconditionally. I have no explicit reference to this package/dll.
I am going to need guidance here:
I can add an explicit reference to the package called:
That does not exclude the old reference to 1.1.0-preview. The build contains two dlls:
Microsoft.Azure.Management.ResourceManager.dll
Microsoft.Azure.ResourceManager.dll
Internally, the dlls are similar, but the namespaces and files are different.
There was a problem hiding this comment.
@gucalder if you see the difference between those two nugets, you will see the namespace is different.
So all I was trying to say is to use the correct namespace and types from the 1.6.0 version
|
@azuresdkci test this please |
| <ItemGroup> | ||
| <!-- PackageReference Update="Microsoft.NET.Test.Sdk" Version="15.0.0" / > | ||
| <PackageReference Update="Microsoft.Rest.ClientRuntime.Azure" Version="3.3.8" / > | ||
| <PackageReference Update="Microsoft.Rest.ClientRuntime.Azure.TestFramework" Version="1.7.2" / --> |
There was a problem hiding this comment.
@gucalder if you see the difference between those two nugets, you will see the namespace is different.
So all I was trying to say is to use the correct namespace and types from the 1.6.0 version
| <!-- PackageReference Update="Microsoft.NET.Test.Sdk" Version="15.0.0" / > | ||
| <PackageReference Update="Microsoft.Rest.ClientRuntime.Azure" Version="3.3.8" / > | ||
| <PackageReference Update="Microsoft.Rest.ClientRuntime.Azure.TestFramework" Version="1.7.2" / --> | ||
| <PackageReference Include="Newtonsoft.Json" Version="6.0.8" /> |
There was a problem hiding this comment.
@gucalder any reason you don't have tests that supports .NETStandard1.4
…e Resource Manager dll. Enabling tests for netcoreapp1.1
|
Making sure I am referencing and using Resource Manager 1.6.0. |
|
Netcoreapp1.1 tests failed because the scenario tests cannot find the SessionRecords files. |
| set specFile1="%2" | ||
| ) | ||
|
|
||
| if "%3" == "" ( |
There was a problem hiding this comment.
@gucalder you do not need all this code. Any reason you are updating this file.
Simply executing this file will create a _meta file that is what the new way to generate the code.
All this change has already been done for you, you only need to execute generate.cmd the way it is.
Please revert this change.
Once you execute generate.cmd, it will create a .txt file under _metadata directory like below
https://github.com/Azure/azure-sdk-for-net/tree/psSdkJson6/src/SDKs/_metadata
| <VersionPrefix>1.0.0-preview</VersionPrefix> | ||
| </PropertyGroup> | ||
| <PropertyGroup> | ||
| <TargetFrameworks>net452</TargetFrameworks> |
There was a problem hiding this comment.
@gucalder any reasons you are doing this.
If you are not able to discover tests that is because of VS 15.3 build.
I had sent an email about installing 15.2 and provided link to install 15.2.
Once you install 15.2 you should be good. Please revert all these changes in your test project.
These changes makes it difficult to make sure all SDKs are created and tested consistently with respect to target framework and updating common references.
There was a problem hiding this comment.
My version is 15.1 at the moment. I'll try with 15.2.
The tests are discovered and run fine for .net452. That's how I re-recorded them.
It is only netcoreapp1.1 that does not detect any tests locally. However, in your side, during build, the system apparently discovers them and tries to run the tests for netcoreapp1.1 but fails to find the dll, it looks in a folder where, I assume, the dll is not installed.
|
@azuresdkci test this please |
…, and the corresponding unit tests (Azure#3520) * Adding ActivityLogAlerts and ActionGroups API calls, PATH operations, and the corresponding unit tests * Generating code from the 'current' branch of the Swagger specs repo * Adding scenario tests * Improving scenario tests and re-recording them * Making sure the scenario tests point to the more recent version of the Resource Manager dll. Enabling tests for netcoreapp1.1 * Reverting netcoreapp1.1 test target since it fails to find the records. * Returning generate.md to its Azure\psSdkJson6 state * Re-enabling tests for netcoreapp1.1
Adding ActivityLogAlerts and ActionGroups API calls, PATCH operations, and the corresponding unit tests
Description
Adding ActivityLogAlerts and ActionGroups API calls.
Adding PATCH operations
Adding unit tests for the patch and the new API calls.
This is a retry of the closed PR #3514 which included changes from vs17dev, which is not used any longer.
This checklist is used to make sure that common guidelines for a pull request are followed.
General Guidelines
Testing Guidelines
SDK Generation Guidelines
*.csprojandAssemblyInfo.csfiles have been updated with the new version of the SDK.