Skip to content

dotnet-svcutil test: fix ParamsFiles and typereuse cases #5052

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

imcarolwang
Copy link
Contributor

@imcarolwang imcarolwang commented Mar 21, 2023

The ParamsFiles case tests global tool can generate wcf client using parameter file passed in, typereuse case tests type reuse feature, both cases hard coded the context test project to .net6.0.

With the wcf repository's root global.json upgrades SDK version to .net8.0, the tests failed to run because the test code can only create test projects whose framework targets are available as defined by the global.json.

This PR changes net6.0 to net8.0 for the two cases and add their corresponding baseline files, also deletes baseline folder ParamsFiles_SDK_TFM/TFnetcoreapp3_1 which is no longer baseline of any existing case.

Updates:

  1. The tests are updated to use the default target framework instead of updating to use the latest for each new release.
  2. Add a scenario to test type reuse for project targeting .NET Standard 2.0.

@HongGit
Copy link
Contributor

HongGit commented Jun 20, 2023

@imcarolwang can you please research to see if it's possible to make a global variable or somewhere so all the code path could benefit in the future?

@imcarolwang imcarolwang force-pushed the svcutil_FixNet60Tests branch from aec76d9 to 33cd695 Compare July 4, 2023 03:28
@HongGit
Copy link
Contributor

HongGit commented Jul 5, 2023

I agree with the latest approach, is there a concern that using the default framework may not be include all the test framework needed to be tested?

@imcarolwang
Copy link
Contributor Author

I agree with the latest approach, is there a concern that using the default framework may not be include all the test framework needed to be tested?

I think it's ok because before updating to use default framework, test hard coded to use the latest framework version, which is no different than use the default, and we have other tests to cover different framework option test.

@@ -13,7 +13,7 @@ namespace Microsoft.Tools.ServiceModel.Svcutil
{
internal class TargetFrameworkHelper
{
internal static readonly List<string> s_currentSupportedVersions = new List<string>() { "8.0", "9.0" };
internal static readonly List<string> s_currentSupportedVersions = new List<string>() { "8.0", "9.0", "10.0" };
Copy link
Contributor Author

@imcarolwang imcarolwang May 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notes:
This list determines the version of WCF packages added to the user's project. If the detected target framework matches any item in the list, the latest WCF package version (8.x) will be added; otherwise, WCF 4.10.x packages will be added.
This change may require a separate PR, but it's included here because the current wcf.git code base uses the 10.0 SDK for test compilation and execution. As a result, test scenarios with the default target framework unexpectedly added the WCF version 4.10.x references, causing numerous baseline mismatch test failures.

@mconnew
Copy link
Member

mconnew commented May 23, 2025

@imcarolwang, this PR includes the assembly src/dotnet-svcutil/lib/tests/TestCases/Netstandard20TypeReuse/BinLib/BinLib.dll. It's not normal for us to commit compiled code into the repo. Was this a mistake or intentional?

@imcarolwang
Copy link
Contributor Author

@imcarolwang, this PR includes the assembly src/dotnet-svcutil/lib/tests/TestCases/Netstandard20TypeReuse/BinLib/BinLib.dll. It's not normal for us to commit compiled code into the repo. Was this a mistake or intentional?

Hi @mconnew, It was intentional. However, since it was not normal, I updated the test client project to reference .csproj instead of the compiled dll to cover the code generation type-reuse scenario.

@imcarolwang imcarolwang force-pushed the svcutil_FixNet60Tests branch from b78f47a to b722c75 Compare May 26, 2025 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants