-
Notifications
You must be signed in to change notification settings - Fork 4k
Test controller as nuget package #7314
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
<package id="Microsoft.WindowsAzure.Management" version="4.1.1" targetFramework="net45" /> | ||
<package id="Moq" version="4.2.1510.2205" targetFramework="net45" /> | ||
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" /> | ||
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" /> |
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'm not sure these packages.config changes actually affect anything. These packages should be loaded from restoring Profile.
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
@@ -3,4 +3,5 @@ | |||
<package id="Microsoft.Azure.Management.Authorization" version="2.8.0-preview" targetFramework="net452" /> | |||
<package id="Microsoft.Azure.Management.ManagementGroups" version="1.1.0-preview" targetFramework="net452" /> | |||
<package id="Microsoft.Azure.Management.ResourceManager" version="1.9.0-preview" targetFramework="net452" /> | |||
<package id="Microsoft.Azure.PowerShell.TestFx" version="1.0.137-preview" targetFramework="net452" /> |
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.
This should be added to the Profile packages.config.
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" /> | ||
<package id="Microsoft.Rest.ClientRuntime.Azure.Authentication" version="2.3.0" targetFramework="net452" /> | ||
<package id="Microsoft.Rest.ClientRuntime.Azure.TestFramework" version="1.7.2" targetFramework="net452" /> | ||
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" /> |
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 here with packages.config changes should be in Profile.
@@ -2,6 +2,7 @@ | |||
<packages> | |||
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net452" /> | |||
<package id="Microsoft.Azure.Management.Storage" version="8.1.0-preview" targetFramework="net452" /> | |||
<package id="Microsoft.Azure.PowerShell.TestFx" version="1.0.137-preview" targetFramework="net452" /> |
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 here with packages.config changes should be in Profile.
@@ -88,7 +87,8 @@ public void TestGetADGroupWithSearchString() | |||
[Trait(Category.AcceptanceType, Category.CheckIn)] | |||
public void TestGetADGroupWithBadSearchString() | |||
{ | |||
ResourcesController.NewInstance.RunPsTest(interceptor, "Test-GetADGroupWithBadSearchString"); | |||
//ResourcesController.NewInstance.RunPsTest("Test-GetADGroupWithBadSearchString"); |
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.
Commented code.
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.
See changes to common code first. Also, what are the changes to the developer guide on adding a new test project that will come with this change?
@@ -64,6 +64,10 @@ | |||
<HintPath>$(LibraryNugetPackageFolder)\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.7.2\lib\net452\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll</HintPath> | |||
<Private>True</Private> | |||
</Reference> | |||
<Reference Include="Microsoft.Azure.PowerShell.TestFx, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | |||
<HintPath>$(LibraryNugetPackageFolder)\Microsoft.Azure.PowerShell.TestFx.1.0.137-preview\lib\net452\Microsoft.Azure.PowerShell.TestFx.dll</HintPath> |
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.
Can we make this one of the published packages from the common repo?
I'll update the guide as soon as the review has signed off to be sure there won't be any changes. |
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.
Can you remove the TestController.cs
from each of the test projects you've updated? You'd have to delete them and remove the entry in the .Test.csproj for Profile/Resources/Storage.
I removed ProfileController as redundant, but 2 others are still in use: ResourcesController uses library calls to setup and cleanup an environment like this: ADGroup newGroup = null;
var controllerAdmin = ResourcesController.NewInstance;
controllerAdmin.RunPsTestWorkflow(
interceptor,
// scriptBuilder
() =>
{
newGroup = CreateNewAdGroup(controllerAdmin);
return new[] { scriptMethod };
},
// cleanup
() =>
{
DeleteAdGroup(controllerAdmin, newGroup);
},
MethodBase.GetCurrentMethod().ReflectedType?.ToString(),
MethodBase.GetCurrentMethod().Name);
} but this functionality is not supported in the new controller because the setup and cleanup should be performed as part of the test script. and Storage TestController is still in use for blob containers tests because to get the new one work the tests need to be re-recorded but they use some experimental environment I don't have access to:
|
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.
LGTM
@vladimir-shcherbakov Can you update this PR for the new released common libraries, pull the latest and fix merge conflicts, and clean up the commits? |
@vladimir-shcherbakov re-targeted the PR at the new default branch, |
@vladimir-shcherbakov ping on the above comments |
1f6c27d
to
ee2192a
Compare
}) | ||
.WithExtraRmModules(helper => new[] | ||
{ | ||
#if !NETSTANDARD |
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.
We can remove this IFDEF, now
Description
Change TestController implementation.
Issue #6180
Checklist
CONTRIBUTING.md
platyPS
module