Send SessionRecords to correct location#15937
Conversation
| string fileName = name + (IsAsync ? "Async" : string.Empty) + ".json"; | ||
| return Path.Combine(TestContext.CurrentContext.TestDirectory, | ||
|
|
||
| var path = TestContext.CurrentContext.TestDirectory; |
There was a problem hiding this comment.
This is an enhancement that we would want to enable for all Track 2 tests. It will be really helpful for users.
It might be better to use an attribute that we include in https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/Directory.Build.props.
<ItemGroup>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>SourcePath</_Parameter1>
<_Parameter2>$(MSBuildProjectDirectory)</_Parameter2>
</AssemblyAttribute>
</ItemGroup>
We can then retrieve the path like this from within RecordedTestBase:
string path = ((AssemblyMetadataAttribute) GetType().Assembly.GetCustomAttribute(typeof(AssemblyMetadataAttribute))).Value;There was a problem hiding this comment.
We were only going to do this for MGMT plane, are you suggesting we do this for data plane as well?
This suggestion seems simpler as well if @nisha-bhatia can get it from this property.
Also, we were going to apply this to track 1 MGMT as well, not just track 2.
There was a problem hiding this comment.
I think making this change both for data and management plane makes sense. There is no need to bifurcate the workflow.
|
We should remove the |
| rpname = testname.Substring(rpnamefirstindex, testname.Length - rpnamefirstindex).ToLower(); | ||
| rpname.Replace(".", "-"); | ||
| } | ||
| else if (testname.Substring(0,9) == "Management") //Track 1 |
There was a problem hiding this comment.
This test framework is not used for track 1 projects.
…s, remove Track 1, add isMgmtProject attribute to track 2 rps
| ## Recording | ||
|
|
||
| When tests are run in recording mode, session records are saved to `artifacts/bin/<ProjectName>/<TargetFramework>/SessionRecords` directory. You can copy recordings to the project directory manually or by executing `dotnet msbuild /t:UpdateSessionRecords` in the test project directory. | ||
| When tests are run in recording mode, session records are saved to the project directory manually in a folder named 'Session Records'. |
There was a problem hiding this comment.
| When tests are run in recording mode, session records are saved to the project directory manually in a folder named 'Session Records'. | |
| When tests are run in recording mode, session records are saved to the project directory manually in a folder named 'SessionRecords'. |
| } | ||
|
|
||
| dotnet msbuild /t:UpdateSessionRecords | ||
| dotnet msbuild |
| @@ -5,11 +5,6 @@ | |||
|
|
|||
| <Target Name="AutoUpdateSessionRecords" Condition="'$(AutoUpdateSessionRecords)' == 'true'" DependsOnTargets="UpdateSessionRecordsInner" AfterTargets="Test;VSTest"/> | |||
There was a problem hiding this comment.
This can be removed as well as UpdateSessionRecordsInner target.
| } | ||
|
|
||
| dotnet msbuild /t:UpdateSessionRecords | ||
| dotnet msbuild |
There was a problem hiding this comment.
All of these dotnet msbuild invocations are not required
| @@ -1 +1 @@ | |||
| dotnet msbuild /t:UpdateSessionRecords No newline at end of file | |||
| dotnet msbuild No newline at end of file | |||
There was a problem hiding this comment.
This file is not required as well.
This reverts commit 344ef94.
|
This appears to be a flakey test as rerunning the failed test allowed it to pass @pakrym 2020-10-27T23:02:37.0825692Z X AddsDelay [129ms] |
This reverts commit 17b964f.
|
Yes, feel free to file failing tests. This one is already filed at #16291 |
* send SessionRecords to correct location * add more error handling * WIP: added dataplane and Track 2 correct locations for Session Records, remove Track 1, add isMgmtProject attribute to track 2 rps * Update Directory.Build.props * Update RecordedTestBase.cs * add IsTestProject * remove changes to eventhub * remove unnecessary imports * update docs and remove UpdateSessionRecords target * update documentation and targets * forgot to remove dotnet build * Delete UpdateSessionRecords.ps1 Co-authored-by: bquantump <53361486+bquantump@users.noreply.github.com>
#15664