-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add artifacts post processing #24012
Conversation
src/Assets/TestProjects/VSTestDataCollectorSample/AttachmentProcessorDataCollector.csproj
Outdated
Show resolved
Hide resolved
src/Assets/TestProjects/VSTestDataCollectorSample/AttachmentProcessorDataCollector.csproj
Outdated
Show resolved
Hide resolved
...Assets/TestProjects/VSTestDataCollectorSampleNoMerge/AttachmentProcessorDataCollector.csproj
Outdated
Show resolved
Hide resolved
src/Assets/TestProjects/VSTestMultiProjectSolution/test1/test1.csproj
Outdated
Show resolved
Hide resolved
src/Tests/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsArtifactPostProcessing.cs
Outdated
Show resolved
Hide resolved
src/Tests/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsArtifactPostProcessing.cs
Outdated
Show resolved
Hide resolved
TestAsset testInstance = _testAssetsManager.CopyTestAsset("VSTestMultiProjectSolution", Guid.NewGuid().ToString()) | ||
.WithSource(); | ||
|
||
string runsettings = GetRunsetting(testInstance.Path); |
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 is similar in all your tests, might be worth having a method for it? Maybe only the TestAsset
creation.
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.
mmm what you mean?I need two item here testinstance
and the runsettings
file path for the command line, how would you organize?
src/Tests/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsArtifactPostProcessing.cs
Outdated
Show resolved
Hide resolved
src/Tests/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsArtifactPostProcessing.cs
Show resolved
Hide resolved
src/Tests/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsArtifactPostProcessing.cs
Outdated
Show resolved
Hide resolved
src/Tests/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsArtifactPostProcessing.cs
Outdated
Show resolved
Hide resolved
src/Tests/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsArtifactPostProcessing.cs
Outdated
Show resolved
Hide resolved
src/Tests/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsArtifactPostProcessing.cs
Outdated
Show resolved
Hide resolved
private void BuildDataCollector() | ||
=> LazyInitializer.EnsureInitialized(ref s_dataCollectorDll, ref s_dataCollectorInitLock, () => | ||
{ | ||
TestAsset testInstance = _testAssetsManager.CopyTestAsset("VSTestDataCollectorSample").WithSource(); | ||
|
||
string testProjectDirectory = testInstance.Path; | ||
|
||
new BuildCommand(testInstance) | ||
.Execute("/p:Configuration=Release") | ||
.Should() | ||
.Pass(); | ||
|
||
return Directory.GetFiles(testProjectDirectory, "AttachmentProcessorDataCollector.dll", SearchOption.AllDirectories).Single(x => x.Contains("bin")); | ||
}); | ||
|
||
private void BuildDataCollectorNoMerge() | ||
=> LazyInitializer.EnsureInitialized(ref s_dataCollectorNoMergeDll, ref s_dataCollectorInitLock, () => | ||
{ | ||
TestAsset testInstance = _testAssetsManager.CopyTestAsset("VSTestDataCollectorSampleNoMerge").WithSource(); | ||
|
||
string testProjectDirectory = testInstance.Path; | ||
|
||
new BuildCommand(testInstance) | ||
.Execute("/p:Configuration=Release") | ||
.Should() | ||
.Pass(); | ||
|
||
return Directory.GetFiles(testProjectDirectory, "AttachmentProcessorDataCollector.dll", SearchOption.AllDirectories).Single(x => x.Contains("bin")); | ||
}); |
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 looks so weird. Why do we need static members that holds something that is changed for each test?
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.
datacollectors are not changed for every tests, we reuse the same compilation for every tests(build on ctor). I prefer this instead of fixture to avoid the creation of class/apply interface etc...looks simpler to me.
…ocessorDataCollector.csproj Co-authored-by: Amaury Levé <amaury.leve@gmail.com>
…hmentProcessorDataCollector.csproj Co-authored-by: Amaury Levé <amaury.leve@gmail.com>
Co-authored-by: Amaury Levé <amaury.leve@gmail.com>
Co-authored-by: Amaury Levé <amaury.leve@gmail.com>
Co-authored-by: Amaury Levé <amaury.leve@gmail.com>
Co-authored-by: Amaury Levé <amaury.leve@gmail.com>
…ctPostProcessing.cs Co-authored-by: Amaury Levé <amaury.leve@gmail.com>
Co-authored-by: Amaury Levé <amaury.leve@gmail.com>
…ctPostProcessing.cs Co-authored-by: Amaury Levé <amaury.leve@gmail.com>
@Evangelink refactored a bit the main Run() splitting between run for test containers and run with MSBuild, removed non safe write trace(I do the check inside there, we'll have more closure but it's ok). |
contributes to microsoft/vstest#1811