-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update assembly version from hardcoded to MajorVersion (#74157)
* Update assembly version from hardcoded to MajorVersion * Bump version to 8 in XsdDataContractExporterTests * Retrieve major version dynamically for expected message in TypesTest_Negative * Retrieve major version dynamically for expected message in SurrogateProvider_MemberData * Manually generate the TestData.resources. The dotnet exec command generated by the msbuild Target had to be manually executed in the cmdline with the target framework folders for RemoteExecutor hardcoded to net7.0-windows so the resources file could be generated. * Avoid hardcoded 8 in additional SurrogateTests line * Fix Diagnostics.EventLog supression message * Update assembly version from hardcoded to MajorVersion * Bump version to 8 in XsdDataContractExporterTests * Retrieve major version dynamically for expected message in TypesTest_Negative * Retrieve major version dynamically for expected message in SurrogateProvider_MemberData * Manually generate the TestData.resources. The dotnet exec command generated by the msbuild Target had to be manually executed in the cmdline with the target framework folders for RemoteExecutor hardcoded to net7.0-windows so the resources file could be generated. * Avoid hardcoded 8 in additional SurrogateTests line * Fix Diagnostics.EventLog supression message * Extract the LocalEchoServer bits from the projects .. so that the helix bits are in a LocalEchoServer.helix.targets , instead of being special-cased in sendtohelix-wasm.targets . - And this is setup and used by the test projects by importing one file. * Build the LocalEchoServers specifically without using artifacts . - The RemoteLoopServer, and NetCoreServer are projects used as aspnetcore middleware, and loaded by xharness. - These are built against the live artifacts, same as other projects. - But this can be a problem when the libraries in `runtime` are on a newer assembly version (say `8.0.0`), but xharness is still built with `7.0.0` libraries. - In that case, xharness fails to load the middleware: ``` Application startup exception: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. ... Could not load file or assembly 'System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) at System.Reflection.Assembly.GetTypes() at Microsoft.DotNet.XHarness.CLI.CommandArguments.TypeFromAssemblyArgument`1.GetLoadedTypes()+MoveNext() in /_/src/Microsoft.DotNet.XHarness.CLI/CommandArguments/Arguments/TypeFromAssemblyArgument.cs:line 29 at Microsoft.DotNet.XHarness.CLI.Commands.WebServer.<>c__DisplayClass0_0.<Start>b__9(TestWebServerOptions options) in /_/src/Microsoft.DotNet.XHarness.CLI/Commands/WebServer.cs:line 60 at Microsoft.Extensions.Options.OptionsFactory`1.Create(String name) at Microsoft.Extensions.Options.OptionsCache`1.<>c__3`1.<GetOrAdd>b__3_0(String name, ValueTuple`2 arg) at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd[TArg](TKey key, Func`3 valueFactory, TArg factoryArgument) at Microsoft.Extensions.Options.OptionsCache`1.GetOrAdd[TArg](String name, Func`3 createOptions, TArg factoryArgument) at Microsoft.DotNet.XHarness.CLI.Commands.WebServer.TestWebServerStartup.Configure(IApplicationBuilder app, IOptionsMonitor`1 optionsAccessor) in /_/src/Microsoft.DotNet.XHarness.CLI/Commands/WebServer.cs:line 126 at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder) at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app) at Microsoft.AspNetCore.Hosting.WebHost.BuildApplication() ``` - Build the project in isolation from rest of the repo, so that it is built with references only from the SDK. The built assembly can then be deployed for use with xharness, just like before. * add missing files * [wasm] fixup extensions targets for LocalEchoServer * [wasm] Use eng/targetingpacks.targets instead of wasm specific targets * [wasm] Avoid duplicate imports, and don't use the targetingpacks.targets .. for runtime tests since the paths are set explicitly in the project * [wasm] Workaround for #77707 The middleware projects are now being built separately, so they can target a different TFM. But when `RunAOTCompilation=true` is set, like on CI/AOT builds, the build breaks with: ``` To build this project, the following workloads must be installed: macos [/__w/1/s/Build.proj] To install these workloads, run the following command: dotnet workload restore [/__w/1/s/Build.proj] ``` This is described in #77707 . And the issue is present in `7.0 rc1` also, which is currently used for building the repo. To workaround it, we unset some properties which aren't needed anyway for the middleware projects builds. Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com> Co-authored-by: Ankit Jain <radical@gmail.com>
- Loading branch information
1 parent
37bd664
commit f84c1b5
Showing
25 changed files
with
130 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Project> | ||
<!-- This is for use with projects that don't need to be built with artifacts. And | ||
need to be loadable by xharness. For example, aspnetcore middleware --> | ||
<PropertyGroup> | ||
<RepositoryRoot>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)../, global.json))/</RepositoryRoot> | ||
<BaseIntermediateOutputPath>$([MSBuild]::NormalizeDirectory($(RepositoryRoot), 'artifacts', 'obj', $(MSBuildProjectName)))</BaseIntermediateOutputPath> | ||
<IntermediateOutputPath>$([MSBuild]::NormalizeDirectory($(BaseIntermediateOutputPath), $(Configuration)))</IntermediateOutputPath> | ||
<OutputPath>$([MSBuild]::NormalizeDirectory($(RepositoryRoot), 'artifacts', 'bin', $(MSBuildProjectName), $(Configuration)))</OutputPath> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<Project> | ||
<!-- This is for use with projects that don't need to be built with artifacts. And | ||
need to be loadable by xharness. For example, aspnetcore middleware --> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.helix.targets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<Project> | ||
<PropertyGroup Condition="'$(IsRunningLibraryTests)' == 'true' and | ||
('$(Scenario)' == '' or '$(Scenario)' == 'normal' or | ||
'$(Scenario)' == 'WasmTestOnBrowser' or '$(Scenario)' == 'WasmTestOnNodeJS')"> | ||
|
||
<HelixExtensionTargets>$(HelixExtensionTargets);_AddMiddlewarePayload</HelixExtensionTargets> | ||
<TestEchoMiddleware>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'bin', 'NetCoreServer', '$(Configuration)', '$(AspNetCoreAppCurrent)'))</TestEchoMiddleware> | ||
<RemoteLoopMiddleware>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'bin', 'RemoteLoopServer', '$(Configuration)', '$(AspNetCoreAppCurrent)'))</RemoteLoopMiddleware> | ||
</PropertyGroup> | ||
|
||
<Target Name="_AddMiddlewarePayload"> | ||
<ItemGroup> | ||
<HelixCorrelationPayload Include="$(TestEchoMiddleware)" Destination="xharness/TestEchoMiddleware" Condition="Exists('$(TestEchoMiddleware)')" /> | ||
<HelixCorrelationPayload Include="$(RemoteLoopMiddleware)" Destination="xharness/RemoteLoopMiddleware" Condition="Exists('$(RemoteLoopMiddleware)')" /> | ||
</ItemGroup> | ||
</Target> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/libraries/Common/tests/System/Net/Prerequisites/NetCoreServer/Directory.Build.props
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<RepositoryRoot>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)../, global.json))/</RepositoryRoot> | ||
</PropertyGroup> | ||
|
||
<Import Project="$([MSBuild]::NormalizePath($(RepositoryRoot), 'eng', 'testing', 'ForXHarness.Directory.Build.props'))" /> | ||
</Project> |
7 changes: 7 additions & 0 deletions
7
src/libraries/Common/tests/System/Net/Prerequisites/NetCoreServer/Directory.Build.targets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<RepositoryRoot Condition="'$(RepositoryRoot)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)../, global.json))/</RepositoryRoot> | ||
</PropertyGroup> | ||
|
||
<Import Project="$([MSBuild]::NormalizePath($(RepositoryRoot), 'eng', 'testing', 'ForXHarness.Directory.Build.targets'))" /> | ||
</Project> |
4 changes: 3 additions & 1 deletion
4
src/libraries/Common/tests/System/Net/Prerequisites/NetCoreServer/NetCoreServer.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/libraries/Common/tests/System/Net/Prerequisites/RemoteLoopServer/Directory.Build.props
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<RepositoryRoot>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)../, global.json))/</RepositoryRoot> | ||
</PropertyGroup> | ||
|
||
<Import Project="$([MSBuild]::NormalizePath($(RepositoryRoot), 'eng', 'testing', 'ForXHarness.Directory.Build.props'))" /> | ||
</Project> |
7 changes: 7 additions & 0 deletions
7
src/libraries/Common/tests/System/Net/Prerequisites/RemoteLoopServer/Directory.Build.targets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<RepositoryRoot Condition="'$(RepositoryRoot)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)../, global.json))/</RepositoryRoot> | ||
</PropertyGroup> | ||
|
||
<Import Project="$([MSBuild]::NormalizePath($(RepositoryRoot), 'eng', 'testing', 'ForXHarness.Directory.Build.targets'))" /> | ||
</Project> |
5 changes: 4 additions & 1 deletion
5
src/libraries/Common/tests/System/Net/Prerequisites/RemoteLoopServer/RemoteLoopServer.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+0 Bytes
(100%)
src/libraries/System.Resources.Extensions/tests/TestData.resources
Binary file not shown.
Oops, something went wrong.