-
Notifications
You must be signed in to change notification settings - Fork 378
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
Initial implementation of the test command and API #5263
Initial implementation of the test command and API #5263
Conversation
80b8a21
to
607bc8d
Compare
607bc8d
to
1fde346
Compare
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.
First pass - looks good, mostly minor comments and missing docs.
Haven't got to tests yet.
Need to digest and do another pass.
are already signed. However, they must be signed with a 3rd party certificate. | ||
--> | ||
<ItemGroup> | ||
<FileSignInfo Include="Argon.dll" CertificateName="3PartySHA2" /> |
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.
just curious: why this was not needed before?
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.
src/Microsoft.TemplateEngine.Authoring.CLI/Microsoft.TemplateEngine.Authoring.CLI.csproj
Outdated
Show resolved
Hide resolved
src/Microsoft.TemplateEngine.Authoring.CLI/Microsoft.TemplateEngine.Authoring.CLI.csproj
Outdated
Show resolved
Hide resolved
src/Microsoft.TemplateEngine.Authoring.CLI/LocalizableStrings.resx
Outdated
Show resolved
Hide resolved
src/Microsoft.TemplateEngine.Authoring.CLI/LocalizableStrings.resx
Outdated
Show resolved
Hide resolved
...Engine.Authoring.TemplateVerifier/Microsoft.TemplateEngine.Authoring.TemplateVerifier.csproj
Show resolved
Hide resolved
src/Microsoft.TemplateEngine.Authoring.TemplateVerifier/TemplateVerificationErrorCode.cs
Show resolved
Hide resolved
src/Microsoft.TemplateEngine.Authoring.TemplateVerifier/VerificationEngine.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.TemplateEngine.Authoring.TemplateVerifier/VerificationEngine.cs
Outdated
Show resolved
Hide resolved
UsesVerifyAttribute a = new UsesVerifyAttribute(); | ||
// https://github.com/VerifyTests/Verify/blob/d8cbe38f527d6788ecadd6205c82803bec3cdfa6/src/Verify.Xunit/Verifier.cs#L10 | ||
// need to simulate execution from tests | ||
var v = DummyMethod; | ||
MethodInfo mi = v.Method; | ||
a.Before(mi); |
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.
@SimonCropp is there any way we can avoid this workaround?
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.
@vlada-shubina i can give u static SetMethodInfo
api on UsesVerifyAttribute. it would need to be called on the same thread before a verify occurs. or i can give u an optional MethodInfo
parameter on all the Verify*
methods.
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.
@SimonCropp I'd say it's still very similar situation - a dummy MethodInfo
needs to be passed even though it doesn't end up being used (we need to name directories/files by scenarios run, not by the code that was invoking them - so the type and method name are overriden by PathInfo
and parameters are not used as method is intentionally parameterless).
In ideal case the InnerVerifier
would pass Lazy
that would throw only on access (plus there would need to be a way to indicate that parameters should not be used).
Though our scenario is pretty specific (and easily workaroundable) - so I understand this might not meet the bar.
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.
Thanks for this work - looks pretty good.
Some of suggestions can be done later in a separate tasks.
It would be good to have one XUnit test showcasing the usage before we move forward.
...ring.TemplateVerifier.Tests/Microsoft.TemplateEngine.Authoring.TemplateVerifier.Tests.csproj
Outdated
Show resolved
Hide resolved
test/Microsoft.TemplateEngine.Authoring.TemplateVerifier.Tests/VerificationEngineTests.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.TemplateEngine.Authoring.TemplateVerifier.Tests/VerificationEngineTests.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.TemplateEngine.Authoring.CLI.IntegrationTests/VerifyCommandTests.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.TemplateEngine.Authoring.CLI.IntegrationTests/VerifyCommandArgsTests.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.TemplateEngine.Authoring.TemplateVerifier/VerifyDirectory.cs
Show resolved
Hide resolved
src/Microsoft.TemplateEngine.Authoring.TemplateVerifier/VerificationEngine.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.TemplateEngine.Authoring.TemplateVerifier/VerificationEngine.cs
Outdated
Show resolved
Hide resolved
...oft.TemplateEngine.Authoring.TemplateVerifier/Commands/Assertions/CommandResultAssertions.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.TemplateEngine.Authoring.TemplateVerifier/VerificationEngine.cs
Outdated
Show resolved
Hide resolved
a more correct
|
src/Microsoft.TemplateEngine.Authoring.TemplateVerifier/VerificationEngine.cs
Outdated
Show resolved
Hide resolved
The |
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.
great improvements, thanks
|
||
namespace Microsoft.TemplateEngine.Authoring.TemplateVerifier | ||
{ | ||
internal interface IFileSystem |
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 have an IPhysicalFileSystem
interface in Abstractions
. Can it be useful here?
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.
It doesn't expose the async methods (due to support for netcore 2.0). But I have extended it and reused what I could
...eVerifier/Expectations/made-up-template.--a#-b#c#--d.Windows.verified/std-streams/stderr.txt
Outdated
Show resolved
Hide resolved
...ft.TemplateEngine.Authoring.CLI.IntegrationTests/TestTemplate/.template.config/template.json
Outdated
Show resolved
Hide resolved
...gine.Authoring.TemplateVerifier.IntegrationTests/TestTemplate/.template.config/template.json
Outdated
Show resolved
Hide resolved
...rosoft.TemplateEngine.Authoring.TemplateVerifier.IntegrationTests/VerificationEngineTests.cs
Outdated
Show resolved
Hide resolved
* repurposed existing CLI tool and MSBuild tasks for authoring * Initial implementation of the test command and API (#5263) * Initial implementation of the test command and API * Disable diff tool in CI * Use new Verifier, Add verification options * Add 3rd party signing info * Remove dependency on test project * Use custom exceptions for exit expectations failed * Improve engine API, add API tests * Add localizations, move types * Various improvements for PR * Add the uninstalled template testing option * Add integration tests and unit tests * Add VerifyEngine unit tests, add ability to place expectations in code base or current dir * Add sample usage in unit test * Adjust assertions (OS agnostic) * Fix code locations * Fix analyzer errors * Adjust sample dogfood test for CI Co-authored-by: Vlada Shubina <vshubina@microsoft.com>
* repurposed existing CLI tool and MSBuild tasks for authoring * Initial implementation of the test command and API (dotnet#5263) * Initial implementation of the test command and API * Disable diff tool in CI * Use new Verifier, Add verification options * Add 3rd party signing info * Remove dependency on test project * Use custom exceptions for exit expectations failed * Improve engine API, add API tests * Add localizations, move types * Various improvements for PR * Add the uninstalled template testing option * Add integration tests and unit tests * Add VerifyEngine unit tests, add ability to place expectations in code base or current dir * Add sample usage in unit test * Adjust assertions (OS agnostic) * Fix code locations * Fix analyzer errors * Adjust sample dogfood test for CI Co-authored-by: Vlada Shubina <vshubina@microsoft.com>
* Test framework on main (#5399) * repurposed existing CLI tool and MSBuild tasks for authoring * Initial implementation of the test command and API (#5263) * Initial implementation of the test command and API * Disable diff tool in CI * Use new Verifier, Add verification options * Add 3rd party signing info * Remove dependency on test project * Use custom exceptions for exit expectations failed * Improve engine API, add API tests * Add localizations, move types * Various improvements for PR * Add the uninstalled template testing option * Add integration tests and unit tests * Add VerifyEngine unit tests, add ability to place expectations in code base or current dir * Add sample usage in unit test * Adjust assertions (OS agnostic) * Fix code locations * Fix analyzer errors * Adjust sample dogfood test for CI Co-authored-by: Vlada Shubina <vshubina@microsoft.com> * Pack TemplateVerifier as standard package (#5422) Co-authored-by: Vlada Shubina <vshubina@microsoft.com>
Problem
initial implementation of #3868
looking for general comments and suggestions
Solution
TBD
Checks - TBD
#nullable enable
to all the modified files ?