From 5c391fe820318a2785888b4537cbaf6f575a5866 Mon Sep 17 00:00:00 2001 From: Cole Carter Date: Wed, 30 Aug 2023 12:57:26 -0700 Subject: [PATCH 1/8] Adds MSBuildRunTests target --- .../Microsoft.Common.CurrentVersion.targets | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/Tasks/Microsoft.Common.CurrentVersion.targets b/src/Tasks/Microsoft.Common.CurrentVersion.targets index ad309e55ee2..802164a6dc4 100644 --- a/src/Tasks/Microsoft.Common.CurrentVersion.targets +++ b/src/Tasks/Microsoft.Common.CurrentVersion.targets @@ -5739,6 +5739,27 @@ Copyright (C) Microsoft Corporation. All rights reserved. + + + + + - + - - - - + + + + false + + + \ No newline at end of file From f0e9f6e96a36b72fb446d0af3f1f7b7ef3d4af85 Mon Sep 17 00:00:00 2001 From: Cole Carter Date: Wed, 15 Nov 2023 09:21:58 -0800 Subject: [PATCH 4/8] move condition to import --- src/Tasks/Microsoft.Common.CurrentVersion.targets | 5 ++++- src/Tasks/Microsoft.Common.Test.targets | 5 +---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Tasks/Microsoft.Common.CurrentVersion.targets b/src/Tasks/Microsoft.Common.CurrentVersion.targets index 5fdfbfe9db4..cbb7f227f43 100644 --- a/src/Tasks/Microsoft.Common.CurrentVersion.targets +++ b/src/Tasks/Microsoft.Common.CurrentVersion.targets @@ -6708,7 +6708,10 @@ Copyright (C) Microsoft Corporation. All rights reserved. - + + false + + - - false - - + \ No newline at end of file From 2201fdee0ac3c27245c5a10d5a7d0e488d6023c8 Mon Sep 17 00:00:00 2001 From: Cole Carter Date: Wed, 15 Nov 2023 09:42:49 -0800 Subject: [PATCH 5/8] add property condition --- src/Tasks/Microsoft.Common.CurrentVersion.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tasks/Microsoft.Common.CurrentVersion.targets b/src/Tasks/Microsoft.Common.CurrentVersion.targets index cbb7f227f43..cf32c9088f6 100644 --- a/src/Tasks/Microsoft.Common.CurrentVersion.targets +++ b/src/Tasks/Microsoft.Common.CurrentVersion.targets @@ -6709,7 +6709,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. - false + false From 8ef1a2f3ed45f08904e6e2e5697574629a2d3c53 Mon Sep 17 00:00:00 2001 From: Cole Carter Date: Tue, 21 Nov 2023 11:31:34 -0800 Subject: [PATCH 6/8] addresses pr comments --- src/Tasks/Microsoft.Common.CurrentVersion.targets | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Tasks/Microsoft.Common.CurrentVersion.targets b/src/Tasks/Microsoft.Common.CurrentVersion.targets index cf32c9088f6..f100f8bc871 100644 --- a/src/Tasks/Microsoft.Common.CurrentVersion.targets +++ b/src/Tasks/Microsoft.Common.CurrentVersion.targets @@ -6709,9 +6709,9 @@ Copyright (C) Microsoft Corporation. All rights reserved. - false + false - + + +``` + +#### Usage Scenario +* Users who wish to utilize this target will set the `$(UseMSBuildTestInfrastructure)` condition in their project file, rsp or via the command line. +* By executing `msbuild /t:Test`, the MSBuild engine will envoke the `Test` taget, which in turn triggers any test runner targets defined to run after it. + +### Default Task Implementation +See: [MSBuild Test Task](https://github.com/microsoft/MSBuildSdks/pull/473) + +#### Nuget package for default implementaion +* The default implementation will be provided through a nuget package +* This package will contain an MSBuild Task deigned to execute `vstest.console.exe` + +#### MSBuild Task Functionality +* The core of this implemenation is an MSBuild task that interfaces with `vstest.console.exe`. +* This task will accept arguments as properties and pass them directly into the command line test runner. + +#### Using The Default Implementation +* Users would install the provided Nuget Package to incorporate it into their projects +* Add the package to their GlobalPackageReferences or specific projects +* Once integrated, executing `msbuild /t:Test` would trigger the MSBuild Task, ultimately executing `vstest.console.exe` From 8a28ae5717b7b98e18d137af7be055819e1df50c Mon Sep 17 00:00:00 2001 From: Jan Krivanek Date: Mon, 27 Nov 2023 20:42:09 +0100 Subject: [PATCH 8/8] No-op doc changes --- documentation/specs/test-target.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/documentation/specs/test-target.md b/documentation/specs/test-target.md index 475a07f2ea6..7726f1f6971 100644 --- a/documentation/specs/test-target.md +++ b/documentation/specs/test-target.md @@ -1,5 +1,6 @@ ## MSBuild Test Target and Task See: [MSBuild Test Target](https://github.com/dotnet/msbuild/pull/9193) + ### Motivation The primary motivation of the MSBuild Test Target is to offer a convienent and standardardized way for executing tests within the msbuild environment. This is inspired by the simplicity of the `dotnet test` command. The proposed command for initiating test within MSBuild would be `msbuild /t:Test` @@ -48,14 +49,14 @@ For instance, an implementation for running VSTest would look like: See: [MSBuild Test Task](https://github.com/microsoft/MSBuildSdks/pull/473) #### Nuget package for default implementaion -* The default implementation will be provided through a nuget package -* This package will contain an MSBuild Task deigned to execute `vstest.console.exe` +* The default implementation will be provided through a nuget package. +* This package will contain an MSBuild Task deigned to execute `vstest.console.exe`. #### MSBuild Task Functionality * The core of this implemenation is an MSBuild task that interfaces with `vstest.console.exe`. * This task will accept arguments as properties and pass them directly into the command line test runner. #### Using The Default Implementation -* Users would install the provided Nuget Package to incorporate it into their projects -* Add the package to their GlobalPackageReferences or specific projects -* Once integrated, executing `msbuild /t:Test` would trigger the MSBuild Task, ultimately executing `vstest.console.exe` +* Users would install the provided Nuget Package to incorporate it into their projects. +* Add the package to their GlobalPackageReferences or specific projects. +* Once integrated, executing `msbuild /t:Test` would trigger the MSBuild Task, ultimately executing `vstest.console.exe`.