-
Notifications
You must be signed in to change notification settings - Fork 377
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
Improving testing of SDK built-in templates #5463
Comments
Sorry, it's a bit vague to me: are you talking about a separate pipeline or adding a new job to an existing one? |
vlada-shubina/installer#1 indicates that the suggestion is to add a new job to a pipeline. |
Hi @ladipro , @JanKrivanek , Could you review this idea paper? |
@YuliiaKovalova, looks great. No strong opinion on programmatic vs. manual test matrix generation. Probably better to start with automatic and add manual adjustments as issues are discovered. Would it be possible to include concrete examples of the issues described in the Background section? Have there been cases where a template was successfully run (in terms of output and exit code) but the generated artifacts had a bug? |
Concrete examples from .NET 7 .NET 6: |
Thank you Vlada. |
due to planning reasons will be delivered in #6026 instead. |
Improving template tests in dotnet/installer
Background
One of the most common problems with .NET templates shipped within .NET SDK are the issues which defining grouping metadata: identity, group identity, precedence.
This issue is commonly reproduced only when multiple .NET SDKs are installed.
Invalid definition results in the conflict that is shown only when the template is attempted to be run and the user cannot resolve it.
During delivery of .NET 5 test templates and common templates had this issue.
During delivery of .NET 6 ASP.NET templates and WPF templates had this issue. Issue with item templates in asp.net was discovered post preview 7.
The problem is amplified because the templates are delivered by 5 teams as of now, using different approaches for authoring, infrastructure and testing their templates.
dotnet/installer seems to be the only common point for them.
Proposal
Since the dotnet/installer is the first and last point where the template packages are inserted, create the tests that can catch the issues described above and disallow releasing the build until they are solved.
The tests will be written by template engine team, the maintenance of them may be negotiated between template engine team, dotnet/installer team or template authors.
Technical details
The tests are suggested as the separate job in existing pipeline. Running tests on a single platform is enough - should the issue occur, it is identically reproduced on all the platforms.
The tests will do the following actions:
Preparation steps:
artifacts\packages\<configuration>\Shipping\dotnet-sdk-<version>.zip
)Test action:
dotnet new <template> --framework <framework> --no-restore
.There are 2 ways how to ensure the test matrix:
prepare test data programmatically
dotnet new list
to get all available templatesdotnet new <template> --help
to see if template supports--framework
and its valuesprepare test data manually
dotnet new list
(anddotnet new <template> --help
)Planned number of test cases (maximum): 40 templates x 2 languages (average) x 4 TFMs = 320 cases.
Note: it is a maximum number of tests as not all the templates support all the frameworks.
Predicted test run time: 320 cases * 2 sec = 640 sec ~ 11 minutes
Note: doesn't include build, test preparation steps, test matrix preparation.
Other possible improvements:
The text was updated successfully, but these errors were encountered: