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

Automation 3.0.1-preview: Software Update Configuration #3992

Merged
merged 4 commits into from
Feb 1, 2018
Merged

Automation 3.0.1-preview: Software Update Configuration #3992

merged 4 commits into from
Feb 1, 2018

Conversation

vrdmr
Copy link
Member

@vrdmr vrdmr commented Jan 11, 2018

Things done for this release:

  • Fixed the project structure to correct the build errors.
  • Regenerated the code based on the latest swagger spec - contains the change in the method signatures to remove the requirement of passing the resource group.
  • Added newer resources - Software Update Configuration (SUC) along with the tests.

Swagger Updates for SUC: Azure/azure-rest-api-specs#2139

Description


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.

@vrdmr
Copy link
Member Author

vrdmr commented Jan 11, 2018

@shahabhijeet Could you please help me with this?

The build failed with the following error -

"c:\workspace\NetCore-SdkCI\build.proj" (RunTests target) (1) ->
(Test target) -> 
EXEC : error Message:  [c:\workspace\NetCore-SdkCI\build.proj]
c:\workspace\NetCore-SdkCI\tools\SdkBuildTools\targets\common.targets(189,5): error MSB3073: The command "dotnet test -f netcoreapp1.1 c:\workspace\NetCore-SdkCI\src\SDKs\Automation\Automation.Tests\Automation.Tests.csproj -l trx;LogFileName=c:\workspace\NetCore-SdkCI\TestResults\netCore11\Automation.Tests.trx " exited with code 1. [c:\workspace\NetCore-SdkCI\build.proj]

1495 Warning(s)
2 Error(s)

But when trying the same on local box to see if the build is successful and working, it works correctly.

C:\azure\azure-sdk-for-net\src\SDKs\Automation>dotnet test -f netcoreapp1.1 C:\azure\azure-sdk-for-net\src\SDKs\Automati
on\Automation.Tests\Automation.Tests.csproj -l trx;LogFileName=C:\Automation.Tests.trx
Build started, please wait...
Build completed.

Test run for C:\azure\azure-sdk-for-net\src\SDKs\Automation\Automation.Tests\bin\Debug\netcoreapp1.1\Automation.Tests.dl
l(.NETCoreApp,Version=v1.1)
Microsoft (R) Test Execution Command Line Tool Version 15.0.0.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
[xUnit.net 00:00:00.9289255]   Discovering: Automation.Tests
[xUnit.net 00:00:01.0524404]   Discovered:  Automation.Tests
[xUnit.net 00:00:01.0586550]   Starting:    Automation.Tests
[xUnit.net 00:00:04.6959312]   Finished:    Automation.Tests
Results File: C:\Automation.Tests.trx

Total tests: 19. Passed: 19. Failed: 0. Skipped: 0.
Test Run Successful.
Test execution time: 6.6643 Seconds

C:\azure\azure-sdk-for-net\src\SDKs\Automation>

FYI @finiteattractor @safeermohammed

@shahabhijeet
Copy link
Member

Go to Jenkins job, click on artifacts=>TestResults=>netCore=>Automation.Tests.trx
If you download this file and open it in VS you will see exactly what test failed.

@vrdmr
Copy link
Member Author

vrdmr commented Jan 18, 2018

@shahabhijeet @finiteattractor

Hi Abhijeet,

I am trying to see if there is any file that we missed but does not look like it. When running the same set of tests locally (including the test which is causing this issue - Automation.Tests.ScenarioTests.UpdateManagement.SoftwareUpdateConfigurationRunTests.CanGetAllRunsByStartTime), it correctly runs.

C:\azure\azure-sdk-for-net\src\SDKs\Automation\Automation.Tests>dotnet test -f netcoreapp1.1  C:\azure\azure-sdk-for-net
\src\SDKs\Automation\Automation.Tests\Automation.Tests.csproj -l trx;LogFileName=C:\azure\Automation.Tests.trx
Build started, please wait...
Build completed.

Test run for C:\azure\azure-sdk-for-net\src\SDKs\Automation\Automation.Tests\bin\Debug\netcoreapp1.1\Automation.Tests.dl
l(.NETCoreApp,Version=v1.1)
Microsoft (R) Test Execution Command Line Tool Version 15.0.0.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
[xUnit.net 00:00:01.1162600]   Discovering: Automation.Tests
[xUnit.net 00:00:01.2674264]   Discovered:  Automation.Tests
[xUnit.net 00:00:01.2758508]   Starting:    Automation.Tests
[xUnit.net 00:00:05.5545858]   Finished:    Automation.Tests
Results File: C:\azure\Automation.Tests.trx

Total tests: 19. Passed: 19. Failed: 0. Skipped: 0.
Test Run Successful.
Test execution time: 8.2224 Seconds

C:\azure\azure-sdk-for-net\src\SDKs\Automation\Automation.Tests>

Mohamed, have you seen an error message like this before?

System.Collections.Generic.KeyNotFoundException : Unable to find a matching HTTP request for URL 'GET /subscriptions/05fd3142-4b8e-4b16-8da9-98b4bbfd722d/resourceGroups/to-delete-01/providers/Microsoft.Automation/automationAccounts/fbs-aa-01/softwareUpdateConfigurationRuns?api-version=2017-05-15-preview&$filter=properties%2FstartTime%20ge%202017-12-04T06%3A01%3A00.0000000%2B00%3A00'. Calling method Item().

I saw something like this when the generated code was not the latest and it did could not find the correct URL for the resource. Please let me know.

@shahabhijeet
Copy link
Member

@vrdmr when something passes locally and fails in CI, most of the time it is because you failed to include any required files as part of you PR.
Best way to find out missing files is to do git clean -xdf and then run all your tests in Playback mode and you will see the failure that CI is flagging.

@vrdmr
Copy link
Member Author

vrdmr commented Jan 25, 2018

Hi @shahabhijeet,

When I do git clean -xdf, and then do dotnet test directly, It complains about the missing dependencies.

C:\azure\azure-sdk-for-net\src\SDKs\Automation\Management.Automation>dotnet test -f netcoreapp1.1  C:\azure\azure-sdk-fo
r-net\src\SDKs\Automation\Automation.Tests\Automation.Tests.csproj -l trx;LogFileName=C:\azure\Automation.Tests.trx
Build started, please wait...
Properties\AssemblyInfo.cs(7,12): error CS0246: The type or namespace name 'AssemblyTitleAttribute' could not be found (
are you missing a using directive or an assembly reference?) [C:\azure\azure-sdk-for-net\src\SDKs\Automation\Management.
Automation\Microsoft.Azure.Management.Automation.csproj]
...

Thus, I need to execute msbuild.exe build.proj from the repo root and then build the SDK from out repo to restore the nuget packagages msbuild.exe build.proj /t:build /p:Scope=SDKs\Automation before running the tests, which succeed then.

C:\azure\azure-sdk-for-net\src\SDKs\Automation\Management.Automation>dotnet test -f netcoreapp1.1  C:\azure\azure-sdk-fo
r-net\src\SDKs\Automation\Automation.Tests\Automation.Tests.csproj -l trx;LogFileName=C:\azure\Automation.Tests.trx
Build started, please wait...
Build completed.

Test run for C:\azure\azure-sdk-for-net\src\SDKs\Automation\Automation.Tests\bin\Debug\netcoreapp1.1\Automation.Tests.dl
l(.NETCoreApp,Version=v1.1)
Microsoft (R) Test Execution Command Line Tool Version 15.0.0.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
[xUnit.net 00:00:03.1191168]   Discovering: Automation.Tests
[xUnit.net 00:00:03.4652685]   Discovered:  Automation.Tests
[xUnit.net 00:00:03.4860111]   Starting:    Automation.Tests
[xUnit.net 00:00:08.3198771]   Finished:    Automation.Tests
WARNING: Overwriting results file: C:\azure\Automation.Tests.trx
Results File: C:\azure\Automation.Tests.trx

Total tests: 19. Passed: 19. Failed: 0. Skipped: 0.
Test Run Successful.
Test execution time: 10.9529 Seconds

C:\azure\azure-sdk-for-net\src\SDKs\Automation\Management.Automation>

@shahabhijeet shahabhijeet merged commit 99c693a into Azure:psSdkJson6 Feb 1, 2018
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.

2 participants