зеркало из https://github.com/microsoft/BuildXL.git
Switch to Microsoft.DotNet.XUnitConsoleRunner (#356)
* Adjust xUnit console runner to use Dotnet Arcade version with fixes BuildXL needs
This commit is contained in:
Родитель
ef6dc51ebe
Коммит
d632375de2
|
@ -16,8 +16,11 @@ export const dotnetTool: Transformer.ToolDefinition = {
|
|||
prepareTempDirectory: true,
|
||||
untrackedDirectoryScopes: [
|
||||
d`${dotnetExecutable.parent}`,
|
||||
d`/usr/local/share/dotnet`,
|
||||
d`/etc`,
|
||||
...addIfLazy(Context.getCurrentHost().os !== "win", () => [
|
||||
d`${Environment.getDirectoryValue("HOME")}/.dotnet`,
|
||||
d`/usr/local/share/dotnet`,
|
||||
d`/etc`
|
||||
]),
|
||||
]
|
||||
};
|
||||
|
||||
|
|
|
@ -7,6 +7,10 @@ import * as Managed from "Sdk.Managed";
|
|||
|
||||
export const xunitConsolePackage = importFrom("xunit.runner.console").Contents.all;
|
||||
|
||||
// This package is published by Dotnet Arcade and contains some important fixes we need, when
|
||||
// running on .NETCoreApp 3.0, see: https://github.com/dotnet/arcade/tree/master/src/Microsoft.DotNet.XUnitConsoleRunner
|
||||
export const xunitNetCoreConsolePackage = importFrom("microsoft.dotnet.xunitconsolerunner").Contents.all;
|
||||
|
||||
/**
|
||||
* Evaluate (i.e. schedule) xUnit test runner invocation with specified arguments.
|
||||
*/
|
||||
|
|
|
@ -21,8 +21,9 @@ export const xunitReferences : Managed.Reference[] = qualifier.targetFramework =
|
|||
? [
|
||||
importFrom("xunit.assert").pkg,
|
||||
importFrom("xunit.abstractions").pkg,
|
||||
importFrom("xunit.runner.reporters").pkg,
|
||||
importFrom("xunit.extensibility.core").pkg,
|
||||
importFrom("xunit.extensibility.execution").pkg,
|
||||
importFrom("xunit.extensibility.execution").pkg
|
||||
]
|
||||
: [
|
||||
Managed.Factory.createBinary(importFrom("xunit.assert").Contents.all, r`lib/netstandard1.1/xunit.assert.dll`),
|
||||
|
@ -44,7 +45,7 @@ const netStandardFramework = importFrom("Sdk.Managed.Frameworks.NetCoreApp3.0").
|
|||
const xunitNetStandardRuntimeConfigFiles: File[] = Managed.RuntimeConfigFiles.createFiles(
|
||||
netStandardFramework,
|
||||
"xunit.console",
|
||||
Managed.Factory.createBinary(xunitConsolePackage, r`tools/netcoreapp2.0/xunit.console.dll`),
|
||||
Managed.Factory.createBinary(xunitNetCoreConsolePackage, r`/lib/netcoreapp2.0/xunit.console.dll`),
|
||||
xunitReferences,
|
||||
undefined, // appconfig
|
||||
true);
|
||||
|
@ -59,13 +60,12 @@ function additionalRuntimeContent(args: Managed.TestArguments) : Deployment.Depl
|
|||
: Managed.RuntimeConfigFiles.createFiles(
|
||||
args.framework,
|
||||
"xunit.console",
|
||||
Managed.Factory.createBinary(xunitConsolePackage, r`tools/${args.framework.targetFramework}/xunit.console.dll`),
|
||||
Managed.Factory.createBinary(xunitNetCoreConsolePackage, r`/lib/netcoreapp2.0/xunit.console.dll`),
|
||||
xunitReferences,
|
||||
undefined, // appConfig
|
||||
true)),
|
||||
xunitConsolePackage.getFile(r`/tools/netcoreapp2.0/xunit.console.dll`),
|
||||
xunitConsolePackage.getFile(r`/tools/netcoreapp2.0/xunit.runner.reporters.netcoreapp10.dll`),
|
||||
xunitConsolePackage.getFile(r`/tools/netcoreapp2.0/xunit.runner.utility.netcoreapp10.dll`),
|
||||
xunitNetCoreConsolePackage.getFile(r`/lib/netcoreapp2.0/xunit.console.dll`),
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -4,16 +4,16 @@ SETLOCAL ENABLEDELAYEDEXPANSION
|
|||
|
||||
REM Description:
|
||||
REM Uses the Xunit console to run tests that call the BuildXL executable directly
|
||||
REM
|
||||
REM Prerequisities:
|
||||
REM
|
||||
REM Prerequisities:
|
||||
REM Run "bxl.cmd -DeployStandaloneTest /q:<qualifier> Out\bin\tests\standalonetest\*" to build and deploy test dlls.
|
||||
REM The executable tests are deployed separately from the StandaloneTest deployment (see StandaloneTest.dsc),
|
||||
REM but re-use the tools deployed alongside the standalone tests (see StadaloneTestSupport.dsc) to execute the executable tests using Xunit.
|
||||
REM
|
||||
REM Usage:
|
||||
REM RunExecutableTests.cmd /configuration <release|debug> /framework <net472|win-x64|etc..>
|
||||
REM
|
||||
REM Example:
|
||||
REM
|
||||
REM Usage:
|
||||
REM RunExecutableTests.cmd /configuration <release|debug> /framework <net472|win-x64|etc..>
|
||||
REM
|
||||
REM Example:
|
||||
REM RunExecutableTests.cmd /configuration release /framework net472
|
||||
|
||||
SET TEST_CONFIGURATION=
|
||||
|
|
|
@ -55,7 +55,7 @@ function wrapInDotNetExe(args: Transformer.ExecuteArguments): Transformer.Execut
|
|||
|
||||
function wrapInUntrackedCmdExe(args: Transformer.ExecuteArguments): Transformer.ExecuteArguments {
|
||||
return Object.merge<Transformer.ExecuteArguments>(
|
||||
args,
|
||||
args,
|
||||
{
|
||||
tool: {
|
||||
exe: Environment.getFileValue("COMSPEC"),
|
||||
|
@ -148,7 +148,7 @@ export function runSingleUnitTest(args: TestArguments): DerivedFile[] {
|
|||
|
||||
let commandLineArgs : Argument[] = CreateCommandLineArgument(args.testAssembly, consoleArgs);
|
||||
commandLineArgs = [...commandLineArgs, ...((args.classes || []).map(c => Cmd.option("-class ", c)))];
|
||||
|
||||
|
||||
let execArguments : Transformer.ExecuteArguments = {
|
||||
tool: tool,
|
||||
arguments: commandLineArgs,
|
||||
|
|
|
@ -162,7 +162,7 @@ namespace BuildXL.Engine
|
|||
maxDegreeOfParallelism: PipTableMaxDegreeOfParallelismDuringConstruction,
|
||||
debug: false);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Creates an EngineSchedule for an immutable pip graph.
|
||||
/// </summary>
|
||||
|
@ -220,9 +220,9 @@ namespace BuildXL.Engine
|
|||
runtimeTableTask.Forget();
|
||||
|
||||
PipTwoPhaseCache twoPhaseCache = InitTwoPhaseCache(
|
||||
loggingContext,
|
||||
context,
|
||||
configuration,
|
||||
loggingContext,
|
||||
context,
|
||||
configuration,
|
||||
scheduleCache,
|
||||
performanceDataFingerprint: performanceDataFingerprint,
|
||||
pathExpander: mountPathExpander,
|
||||
|
@ -423,11 +423,11 @@ namespace BuildXL.Engine
|
|||
if (directoryPath != null)
|
||||
{
|
||||
var historicMetadataCache = new HistoricMetadataCache(
|
||||
loggingContext,
|
||||
cache,
|
||||
context,
|
||||
pathExpander,
|
||||
AbsolutePath.Create(context.PathTable, directoryPath),
|
||||
loggingContext,
|
||||
cache,
|
||||
context,
|
||||
pathExpander,
|
||||
AbsolutePath.Create(context.PathTable, directoryPath),
|
||||
prepareAsync: hmc =>
|
||||
{
|
||||
return TryLoadHistoricMetadataCache(loggingContext, hmc, context, configuration, cache, performanceDataFingerprint);
|
||||
|
@ -446,7 +446,7 @@ namespace BuildXL.Engine
|
|||
private bool ShouldSerializeOptimizationDataStructurePostExecution()
|
||||
{
|
||||
// Check if the build has run for required time in order to make serializing the optimizing data structures worthwhile.
|
||||
return m_schedulerStartTime != null &&
|
||||
return m_schedulerStartTime != null &&
|
||||
(TimestampUtilities.Timestamp - m_schedulerStartTime.Value) > MinExecutionTimeForSerializingOptimizationDataStructures;
|
||||
}
|
||||
|
||||
|
@ -532,7 +532,7 @@ namespace BuildXL.Engine
|
|||
// The reason for invalidation should have already been logged
|
||||
//
|
||||
// This is different than the case where there is content that should be saved,
|
||||
// and the save fails. In that case, we log an error as that could
|
||||
// and the save fails. In that case, we log an error as that could
|
||||
// leave the historic metadata cache in a bad state for future runs.
|
||||
return true;
|
||||
}
|
||||
|
@ -795,8 +795,8 @@ namespace BuildXL.Engine
|
|||
}
|
||||
|
||||
// Shared opaque content is always deleted, regardless of what configuration.Engine.Scrub says
|
||||
// We need to delete shared opaques because otherwise hardlinks can't be used (content will remain readonly, which will
|
||||
// block the next build from modifying them) and to increase consistency in tool behavior and make them more agnostic to
|
||||
// We need to delete shared opaques because otherwise hardlinks can't be used (content will remain readonly, which will
|
||||
// block the next build from modifying them) and to increase consistency in tool behavior and make them more agnostic to
|
||||
// the state of the disk that past builds could have produced.
|
||||
// TODO: This nuclear deletion is a temporary measure to deal with the fact that shared opaque directory outputs are not known
|
||||
// in advance. We need a better solution.
|
||||
|
@ -810,7 +810,7 @@ namespace BuildXL.Engine
|
|||
var scrubber = new DirectoryScrubber(
|
||||
loggingContext: loggingContext,
|
||||
loggingConfiguration: configuration.Logging,
|
||||
// Everything that is not an output under a shared opaque is considered part of the build.
|
||||
// Everything that is not an output under a shared opaque is considered part of the build.
|
||||
isPathInBuild: path =>
|
||||
!SharedOpaqueOutputHelper.IsSharedOpaqueOutput(path) ||
|
||||
ShouldRemoveEmptyDirectories(configuration, path),
|
||||
|
@ -835,8 +835,8 @@ namespace BuildXL.Engine
|
|||
|
||||
internal static IReadOnlyList<string> GetNonScrubbablePaths(
|
||||
PathTable pathTable,
|
||||
IConfiguration configuration,
|
||||
IEnumerable<string> extraNonScrubbablePaths,
|
||||
IConfiguration configuration,
|
||||
IEnumerable<string> extraNonScrubbablePaths,
|
||||
[CanBeNull] ITempDirectoryCleaner tempCleaner)
|
||||
{
|
||||
var nonScrubbablePaths = new List<string>(new[]
|
||||
|
@ -867,9 +867,9 @@ namespace BuildXL.Engine
|
|||
|
||||
if (OperatingSystemHelper.IsUnixOS)
|
||||
{
|
||||
// Don't scrub the .NET Core lock file when running the CoreCLR on Unix even if its parent directory is specified as scrubabble.
|
||||
// Some build tools use the '/tmp' folder as temporary file location (e.g. xcodebuild, clang, etc.) for dumping state and reports.
|
||||
// Unfortunately scrubbing the dotnet state files can lead to a missbehaving CoreCLR in subsequent or parallel runs where several
|
||||
// Don't scrub the .NET Core lock file when running the CoreCLR on Unix even if its parent directory is specified as scrubbable.
|
||||
// Some build tools use the '/tmp' folder as temporary file location (e.g. xcodebuild, clang, etc.) for dumping state and reports.
|
||||
// Unfortunately scrubbing the dotnet state files can lead to a misbehaving CoreCLR in subsequent or parallel runs where several
|
||||
// dotnet invocations happen, so lets avoid scrubbing that folder explicitly!
|
||||
nonScrubbablePaths.AddRange(new[]
|
||||
{
|
||||
|
@ -1846,9 +1846,9 @@ namespace BuildXL.Engine
|
|||
/// Synchronously saves the subset of scheduling state needed for execution analyzers.
|
||||
/// </summary>
|
||||
internal static async Task<bool> SaveExecutionStateToDiskAsync(
|
||||
EngineSerializer serializer,
|
||||
BuildXLContext context,
|
||||
PipTable pipTable,
|
||||
EngineSerializer serializer,
|
||||
BuildXLContext context,
|
||||
PipTable pipTable,
|
||||
PipGraph pipGraph,
|
||||
MountPathExpander mountPathExpander,
|
||||
HistoricTableSizes historicTableSizes)
|
||||
|
@ -2101,10 +2101,10 @@ namespace BuildXL.Engine
|
|||
internal static Task DuplicateScheduleFiles(LoggingContext loggingContext, EngineSerializer serializer, string destinationFolder)
|
||||
{
|
||||
return DuplicateFiles(
|
||||
loggingContext,
|
||||
serializer,
|
||||
loggingContext,
|
||||
serializer,
|
||||
destinationFolder,
|
||||
new[]
|
||||
new[]
|
||||
{
|
||||
EngineSerializer.StringTableFile,
|
||||
EngineSerializer.PathTableFile,
|
||||
|
|
|
@ -17,7 +17,7 @@ if NOT DEFINED DBD_TESTGEN_COUNT (
|
|||
)
|
||||
|
||||
if NOT DEFINED TEST_COMMITID (
|
||||
set TEST_COMMITID=201fb8470cc4a363705e1b4d721e98e5731346b0
|
||||
set TEST_COMMITID=47e77cd946c0d37a09cad752dee603db84ce2d92
|
||||
)
|
||||
|
||||
set TEST_SOLUTION_ROOT=%ENLISTMENTROOT%\Out\Tests\SMDB
|
||||
|
|
15
config.dsc
15
config.dsc
|
@ -55,7 +55,8 @@ config({
|
|||
"nuget.org" : "http://api.nuget.org/v3/index.json",
|
||||
"roslyn-tools" : "https://dotnet.myget.org/F/roslyn-tools/api/v3/index.json",
|
||||
"msbuild" : "https://dotnet.myget.org/F/msbuild/api/v3/index.json",
|
||||
"dotnet-core" : "https://dotnet.myget.org/F/dotnet-core/api/v3/index.json"
|
||||
"dotnet-core" : "https://dotnet.myget.org/F/dotnet-core/api/v3/index.json",
|
||||
"dotnet-arcade" : "https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json",
|
||||
},
|
||||
|
||||
packages: [
|
||||
|
@ -169,14 +170,16 @@ config({
|
|||
{ id: "Microsoft.Data.Edm", version: "5.8.2" },
|
||||
|
||||
// xUnit
|
||||
{ id: "xunit.abstractions", version: "2.0.3", tfm: ".NETStandard2.0" },
|
||||
{ id: "xunit.abstractions", version: "2.0.3" },
|
||||
{ id: "xunit.analyzers", version: "0.10.0" },
|
||||
{ id: "xunit.assert", version: "2.4.1-ms" },
|
||||
{ id: "xunit.core", version: "2.4.1-ms" },
|
||||
{ id: "xunit.extensibility.core", version: "2.4.1-ms" },
|
||||
{ id: "xunit.extensibility.execution", version: "2.4.1-ms" },
|
||||
{ id: "xunit.runner.console", version: "2.4.1-ms" },
|
||||
{ id: "xunit.runner.utility", version: "2.4.1-ms" },
|
||||
{ id: "xunit.extensibility.core", version: "2.4.1" },
|
||||
{ id: "xunit.extensibility.execution", version: "2.4.1" },
|
||||
{ id: "xunit.runner.console", version: "2.4.1" },
|
||||
{ id: "microsoft.dotnet.xunitconsolerunner", version: "2.5.1-beta.19270.4" },
|
||||
{ id: "xunit.runner.reporters", version: "2.4.1-pre.build.4059" },
|
||||
{ id: "xunit.runner.utility", version: "2.4.1" },
|
||||
{ id: "xunit.runner.visualstudio", version: "2.4.1" },
|
||||
|
||||
{ id: "Microsoft.IdentityModel.Clients.ActiveDirectory", version: "3.17.2" },
|
||||
|
|
Загрузка…
Ссылка в новой задаче