Skip to content
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

dotnet-svcutil test update: remove unsupported .net version tests and… #5042

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

imcarolwang
Copy link
Contributor

@imcarolwang imcarolwang commented Mar 16, 2023

… fixing baselines.

To make changes of this PR clear, split it into following three:
#5050: remove CloseAsync()
#5051: remove unsupported framework targets
#5052: fix ParamsFiles and typereuse cases which hard code to net6.0

Copy link
Contributor

@HongGit HongGit left a comment

Choose a reason for hiding this comment

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

  1. please documents all the changes in the description to make this PR clear
  2. does it make sense to separate the CloseAsync in a separate PR?
  3. I see making the version generic is more dangerous than the gain, particularly in the type reuse side, what do you think? I would suggest to make this PR purely remove the old non-supported framework PR. We could rethink about the future, whether to make it generic or not.
  4. I also think we need to throw an error message when the targeted app is on non-supported target framework.

@@ -25,8 +25,8 @@
</PropertyGroup>

<PropertyGroup>
<ScenarioTestTargetFrameworks>net6.0;net7.0</ScenarioTestTargetFrameworks>
<UnitTestTargetFrameworks>net6.0;net7.0</UnitTestTargetFrameworks>
<ScenarioTestTargetFrameworks>net6.0;net8.0</ScenarioTestTargetFrameworks>
Copy link
Contributor

Choose a reason for hiding this comment

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

why drop net7.0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I meant to upgrade net7.0 to net8.0 to accommodate the .net sdk and runtime definitions in https://github.com/dotnet/wcf/blob/main/global.json

Copy link
Contributor Author

@imcarolwang imcarolwang Mar 21, 2023

Choose a reason for hiding this comment

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

I found this setting only affects WCF tests, not dotnet-svcutil tests. So it's not changed in the newly created separated PR.

@@ -889,11 +889,6 @@ public virtual System.Threading.Tasks.Task OpenAsync()
return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action<System.IAsyncResult>(((System.ServiceModel.ICommunicationObject)(this)).EndOpen));
}

public virtual System.Threading.Tasks.Task CloseAsync()
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any risk of removing this? Should another test be added?

In addition, can you please put a summary of all changes as it will make it easier to understand the changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The test baselines are updated for changes of PR #4909 (issue #4891), dotnet-svcutil no longer generate CloseAsync() when the referenced wcf package version equals or greater than 4.10.

The risk here is we missed testing the tool running in projects with different .net targets, it is due to the limitation of .net defined in global.json under the repository root. We do cover this scenario in manual testing, specifically, verifying that when the test project references wcf packages older than 4.10.*, the CloseAysnc() still get generated.

@@ -3,6 +3,8 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>N.N</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
Copy link
Contributor

Choose a reason for hiding this comment

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

should we still support coreapp2.0 when we are deleting netcoreapp3.1?

@@ -1,18 +1,18 @@
{
"providerId": "TFnet5_0",
"providerId": "_edb",
Copy link
Contributor

Choose a reason for hiding this comment

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

why not use 6.0 to replace 5.0? Is _edb defined somewhere, I might have missed it>

Copy link
Contributor

Choose a reason for hiding this comment

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

is this part of this change? From the name, sound like this is used for net6.0? Is that not the case?

@@ -7,12 +7,12 @@
// </auto-generated>
//------------------------------------------------------------------------------

namespace TypeReuse60_NS
Copy link
Contributor

Choose a reason for hiding this comment

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

I see that you are making this generic. How does this impact combability?

In addition, perhaps we should throw an erro message when working with version less than 5.0, what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Does generic will make it work with all versions of target Framework? We do need to think about this.

[System.ServiceModel.FaultContractAttribute(typeof(NetHttps_NS.FaultDetail), Action="http://tempuri.org/IWcfService/TestFaultFaultDetailFault", Name="FaultDetail", Namespace="http://www.contoso.com/wcfnamespace")]
[System.ServiceModel.FaultContractAttribute(typeof(NetHttps_NS.FaultDetail), Action="http://tempuri.org/IWcfService/TestFaultFaultDetailFault2", Name="FaultDetail2", Namespace="http://www.contoso.com/wcfnamespace")]
Copy link
Contributor

Choose a reason for hiding this comment

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

sorry, I am not sure I know what this is for.

Copy link
Contributor Author

@imcarolwang imcarolwang Mar 17, 2023

Choose a reason for hiding this comment

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

In generated code, the attributes' order is different than originally generated, looks relate to CodeDom other than bug from the tool.

@@ -204,12 +201,12 @@ public void NamespaceParam(string testCaseName, string options, bool expectSucce

[Trait("Category", "BVT")]
[Theory]
[InlineData("TypeReuse60", "net6.0")]
Copy link
Contributor

Choose a reason for hiding this comment

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

rather than use a generic format, I do prefer to add net7.0 and net 8.0 here to make it explicitly clear. However, I do see your point that we don't need to update this in the future. Similar to another comment before, does this mean we also allow other earlier .net versions? We do need to be careful here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The format is made generic because the .net version is actually not used at all in the test, in the case context it always creates a test.csproj targets to the latest .net version (currently it's net8.0 as defined in global.json) to test type-reuse feature.

{
this_TestCaseName = "ParamsFiles_SDK_TFM";
TestFixture();
var testCaseName = $"TF{targetFramework}".Replace(".", "_");
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

@imcarolwang
Copy link
Contributor Author

  1. please documents all the changes in the description to make this PR clear
  2. does it make sense to separate the CloseAsync in a separate PR?
  3. I see making the version generic is more dangerous than the gain, particularly in the type reuse side, what do you think? I would suggest to make this PR purely remove the old non-supported framework PR. We could rethink about the future, whether to make it generic or not.
  4. I also think we need to throw an error message when the targeted app is on non-supported target framework.

Thanks for your review!

  1. I think it makes sense to put the CloseAsync in a separate PR, I will keep this one open as reference.
  2. I'll make this PR purely remove the old non-supported framework to make it clearer.
  3. As regarding to make versions generic for 2 cases which hard coded to .net6.0, they currently fail to run because the test code can only create project targeting to .net8.0, I will make the change in new PR and work on it from there.

@imcarolwang imcarolwang added the PR DO NOT MERGE If for whatever reason you do not want a PR merged. label Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR DO NOT MERGE If for whatever reason you do not want a PR merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants