Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

[WIP] Enable CoreFX tests on CoreRT #5287

Closed
wants to merge 16 commits into from

Conversation

A-And
Copy link
Contributor

@A-And A-And commented Jan 25, 2018

Work on #5059. Enables running CoreFX tests on CoreRT. A couple of points

  • A number of tests have a dependency on the CoreFX.Private.TestUtilities assembly. We need a way to distribute this - as either a NuGet package or fetching built assemblies as correlation payloads from build machines. Any suggestions on this would be great.

  • No shell script changes - most of this change is cross-plat, but only called on Windows

  • Test URL - will change according to whichever version we pick, run and "freeze"

  • Some minor points marked with TODOs

cc @MichalStrehovsky @jkotas @sergiy-k

[
"System.Collections.Tests",
"System.Collections.Immutable.Tests",
"System.Net.Security.Tests"
Copy link
Member

Choose a reason for hiding this comment

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

Why System.Net.Security.Tests ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All three are placeholders. System.Net.Security.Tests has an explicit dependenency on CoreFX.Private.TestUitilities, so that's why I included it.
The actual tests need to be decided.

@@ -0,0 +1 @@
https://dotnetbuilddrops.blob.core.windows.net/build-e0a70e19967c4fbfa9e6a9e7fed567cc/TestList.json?sv=2015-04-05&sr=c&sig=rwqOIDM585nrCg4ydSleaYi%2FN1%2BcFqEivySw06MiZRs%3D&st=2018-01-12T01%3A34%3A06.4065828Z&se=2018-02-11T01%3A34%3A06.4065828Z&sp=r
Copy link
Member

Choose a reason for hiding this comment

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

Just curious - is 2015-04-05 in the URL a date? It seems pretty old.

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 build itself should be fairly new. "sv" should stand for signed version, but I'm not certain how that relates.

@jkotas
Copy link
Member

jkotas commented Jan 25, 2018

We need a way to distribute this - as either a NuGet package or fetching built assemblies as correlation payloads from build machines.

How does the .NET Core Helix test runs get this? We should be using same mechanism, ideally.

<ItemGroup>
<!-- Some tests consist of multiple assemblies - make sure ILC sees them -->
<IlcCompileInput Include="$(MSBuildProjectDirectory)\*.dll" />
<!-- TODO Get both assemblies from somewhere else? -->
Copy link
Member

Choose a reason for hiding this comment

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

@A-And
Copy link
Contributor Author

A-And commented Jan 25, 2018

@jkotas Helix builds CoreFX. The closest alternative we should have to this is either "freezing" a specific CoreFX build and fetching the dll from there or adding the assembly as a correlation payload to the built tests (as opposed to the built repo)

@@ -0,0 +1,205 @@
using System;
Copy link
Contributor

Choose a reason for hiding this comment

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

All source files must have a license header (like this one:

// Licensed to the .NET Foundation under one or more agreements.
)

In addition, please add comments describing what this program does and what kind of arguments it takes.

@@ -0,0 +1,108 @@
using System;
Copy link
Contributor

Choose a reason for hiding this comment

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

All source files must have a license header (like this one:

// Licensed to the .NET Foundation under one or more agreements.
)

echo Build %TestFileName%

call "%CoreRT_CliDir%\dotnet.exe" publish %TestFolder%\Test.csproj /ConsoleLoggerParameters:ForceNoAlign "/p:IlcPath=%CoreRT_ToolchainDir%" "/p:DebugSymbols=false" "/p:Configuration=%CoreRT_BuildType%" "/p:FrameworkLibPath=%~dp0..\..\bin\%CoreRT_BuildOS%.%CoreRT_BuildArch%.%CoreRT_BuildType%\lib" "/p:FrameworkObjPath=%~dp0..\..\bin\obj\%CoreRT_BuildOS%.%CoreRT_BuildArch%.%CoreRT_BuildType%\Framework" /p:DisableFrameworkLibGeneration=true /p:TestRootDir=%~dp0 /p:ExecutableName=%TestExecutable%

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to check that the build has succeeded before starting running the test?

if not exist %XunitLogDir% md %XunitLogDir%

if not exist %TestFolder%\%TestExecutable%.exe (
:: Not a test we support yet, exit silently
Copy link
Member

Choose a reason for hiding this comment

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

What are these tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tests not run by Helix (e.g. AssemblyResolve). Technically, this shouldn't ever happen, but in case the test format changes, this degrades more gracefully.
Ideally, the need for this will be completely eliminated once we add a CoreRT parallel to the uap-aot target for CoreFX.

if not exist %__LogsDir% md %__LogsDir%

:: Check presence of VS
if not defined VS%__VSProductVersion%COMNTOOLS goto NoVS
Copy link
Member

Choose a reason for hiding this comment

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

Is there a NoVS label anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added.

:: The issue is that we extend the build with our own targets which
:: means that that rebuilding cannot successfully delete the task
:: assembly.
set __msbuildCommonArgs=/nologo /nodeReuse:false %__msbuildExtraArgs% /p:Platform=%__MSBuildBuildArch%
Copy link
Member

Choose a reason for hiding this comment

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

Is this used anywhere?

set __VSToolsRoot=!VS%__VSProductVersion%COMNTOOLS!
if %__VSToolsRoot:~-1%==\ set "__VSToolsRoot=%__VSToolsRoot:~0,-1%"

set _msbuildexe="%VSINSTALLDIR%\MSBuild\15.0\Bin\MSBuild.exe"
Copy link
Member

Choose a reason for hiding this comment

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

Is this used anywhere?

:RestoreCoreFXTests

:: Explicitly restore the test helper project
"%CoreRT_CliDir%\dotnet.exe" msbuild /t:Restore "%CoreRT_TestFileHelperProjectPath%"
Copy link
Member

Choose a reason for hiding this comment

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

Should we check error level after this too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added.

)

:: Build the test helper project
"%CoreRT_CliDir%\dotnet.exe" msbuild /m /ConsoleLoggerParameters:ForceNoAlign "/p:IlcPath=%CoreRT_ToolchainDir%" "/p:Configuration=%CoreRT_BuildType%" "/p:OSGroup=%CoreRT_BuildOS%" "/p:Platform=%CoreRT_BuildArch%" "/p:RepoLocalBuild=true" "/p:FrameworkLibPath=%CoreRT_TestRoot%..\bin\%CoreRT_BuildOS%.%CoreRT_BuildArch%.%CoreRT_BuildType%\lib" "/p:FrameworkObjPath=%~dp0..\bin\obj\%CoreRT_BuildOS%.%CoreRT_BuildArch%.%CoreRT_BuildType%\Framework" "/p:OutputPath=%CoreRT_TestingUtilitiesOutputDir%" /p:RepoLocalBuild=true "%CoreRT_TestFileHelperProjectPath%"
Copy link
Member

Choose a reason for hiding this comment

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

Check errorlevel here too?


<PropertyGroup>
<!-- TODO - need a general way to specify version without relying on the test directory structure being intact, i.e. import dependencies from \tests\ -->
<ToolsDir>$(FrameworkLibPath)\..\tools\</ToolsDir>
Copy link
Member

Choose a reason for hiding this comment

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

The only place where ToolsDir is used seems unused?

@A-And A-And force-pushed the FXTestingFramework branch 4 times, most recently from ba7c398 to 208e7da Compare January 30, 2018 19:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants