Skip to content

Commit

Permalink
Missing assembly added to TestAdapter package (#796)
Browse files Browse the repository at this point in the history
Fixes #789
  • Loading branch information
Haplois authored Mar 10, 2021
1 parent c3a4c9f commit d4ec238
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 48 deletions.
5 changes: 2 additions & 3 deletions TestFx.sln
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Package", "Package", "{E374A3A6-C364-4890-B315-D60F5C682B6E}"
ProjectSection(SolutionItems) = preProject
src\Package\MSTest.Internal.TestFx.Documentation.nuspec = src\Package\MSTest.Internal.TestFx.Documentation.nuspec
src\Package\MSTest.TestAdapter.Dotnet.nuspec = src\Package\MSTest.TestAdapter.Dotnet.nuspec
src\Package\MSTest.TestAdapter.Enu.nuspec = src\Package\MSTest.TestAdapter.Enu.nuspec
src\Package\MSTest.TestAdapter.nuspec = src\Package\MSTest.TestAdapter.nuspec
src\Package\MSTest.TestAdapter.symbols.nuspec = src\Package\MSTest.TestAdapter.symbols.nuspec
Expand Down Expand Up @@ -142,8 +141,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "targets", "targets", "{F60B
ProjectSection(SolutionItems) = preProject
scripts\build\TestFx.Loc.targets = scripts\build\TestFx.Loc.targets
scripts\build\TestFx.Settings.targets = scripts\build\TestFx.Settings.targets
scripts\build\TestFx.Versions.targets = scripts\build\TestFx.Versions.targets
scripts\build\TestFx.targets = scripts\build\TestFx.targets
scripts\build\TestFx.Versions.targets = scripts\build\TestFx.Versions.targets
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{BCF525B1-E67F-486D-B091-06A8BB8A2793}"
Expand Down Expand Up @@ -186,7 +185,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DeploymentTestProjectNetCor
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TimeoutTestProjectNetCore", "test\E2ETests\TestAssets\TimeoutTestProjectNetCore\TimeoutTestProjectNetCore.csproj", "{ED27A844-6870-4FE6-8FEF-3ABDD1ED6564}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharpTestProject", "test\E2ETests\TestAssets\FSharpTestProject\FSharpTestProject.fsproj", "{E5E58613-82FC-44CD-B75F-4F1C7ED52D0D}"
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharpTestProject", "test\E2ETests\TestAssets\FSharpTestProject\FSharpTestProject.fsproj", "{E5E58613-82FC-44CD-B75F-4F1C7ED52D0D}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Expand Down
42 changes: 24 additions & 18 deletions scripts/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ Param(
[Alias("tpv")]
[string] $TestPlatformVersion = $null,

[Alias("np")]
[Switch] $DisallowPrereleaseMSBuild,

[Alias("f")]
[Switch] $Force,

Expand Down Expand Up @@ -111,20 +114,23 @@ function Print-Help {
Write-Host -object ""
Write-Host -object "********* MSTest Adapter Build Script *********"
Write-Host -object ""
Write-Host -object " Help (-h) - [Switch] - Prints this help message."
Write-Host -object " Clean (-cl) - [Switch] - Indicates that this should be a clean build."
Write-Host -object " SkipRestore (-sr) - [Switch] - Indicates nuget package restoration should be skipped."
Write-Host -object " ClearPackageCache (-cache) - [Switch] - Indicates local package cache should be cleared before restore."
Write-Host -object " Updatexlf (-uxlf) - [Switch] - Indicates that there are resource changes and that these need to be copied to other languages as well."
Write-Host -object " IsLocalizedBuild (-loc) - [Switch] - Indicates that the build needs to generate resource assemblies as well."
Write-Host -object " Official - [Switch] - Indicates that this is an official build. Only used in CI builds."
Write-Host -object " Full - [Switch] - Indicates to perform a full build which includes Adapter, Framework"
Write-Host -object " Help (-h) - [switch] - Prints this help message."
Write-Host -object " Clean (-cl) - [switch] - Indicates that this should be a clean build."
Write-Host -object " SkipRestore (-sr) - [switch] - Indicates nuget package restoration should be skipped."
Write-Host -object " ClearPackageCache (-cache) - [switch] - Indicates local package cache should be cleared before restore."
Write-Host -object " Updatexlf (-uxlf) - [switch] - Indicates that there are resource changes and that these need to be copied to other languages as well."
Write-Host -object " IsLocalizedBuild (-loc) - [switch] - Indicates that the build needs to generate resource assemblies as well."
Write-Host -object " Official - [switch] - Indicates that this is an official build. Only used in CI builds."
Write-Host -object " Full - [switch] - Indicates to perform a full build which includes Adapter, Framework"
Write-Host -object " DisallowPrereleaseMSBuild (-np) - [switch] - Uses an RTM version of MSBuild to build the projects"
Write-Host -object ""
Write-Host -object " Configuration (-c) - [string] - Specifies the build configuration. Defaults to 'Debug'."
Write-Host -object " FrameworkVersion (-fv) - [string] - Specifies the version of the Test Framework nuget package."
Write-Host -object " AdapterVersion (-av) - [string] - Specifies the version of the Test Adapter nuget package."
Write-Host -object " VersionSuffix (-vs) - [string] - Specifies the version suffix for the nuget packages."
Write-Host -object " Target - [string] - Specifies the build target. Defaults to 'Build'."
Write-Host -object ""
Write-Host -object " Configuration (-c) - [String] - Specifies the build configuration. Defaults to 'Debug'."
Write-Host -object " FrameworkVersion (-fv) - [String] - Specifies the version of the Test Framework nuget package."
Write-Host -object " AdapterVersion (-av) - [String] - Specifies the version of the Test Adapter nuget package."
Write-Host -object " VersionSuffix (-vs) - [String] - Specifies the version suffix for the nuget packages."
Write-Host -object " Target - [String] - Specifies the build target. Defaults to 'Build'."
Write-Host -object " Steps (-s) - [string[]] - List of build steps to run, valid steps: `"UpdateTPVersion`", `"Restore`", `"Build`", `"Publish`""

Write-Host -object ""
Exit 0
Expand Down Expand Up @@ -259,6 +265,8 @@ function Create-NugetPackages {
Copy-Item $tfSrcPackageDir\$file $stagingDir -Force
}

Copy-Item -Path "$($env:TF_PACKAGES_DIR)\microsoft.testplatform.adapterutilities\$TestPlatformVersion\lib" -Destination "$($stagingDir)\Microsoft.TestPlatform.AdapterUtilities" -Recurse -Force

# Copy over LICENSE file to staging directory
$licenseFilePath = Join-Path $env:TF_ROOT_DIR "LICENSE"
Copy-Item $licenseFilePath $stagingDir -Force
Expand All @@ -279,7 +287,7 @@ function Create-NugetPackages {
}

Write-Verbose "$nugetExe pack $stagingDir\$file -OutputDirectory $packageOutDir -Version=$version -Properties Version=$version"
& $nugetExe pack $stagingDir\$file -OutputDirectory $packageOutDir -Version $version -Properties Version=$version`;Srcroot=$env:TF_SRC_DIR`;Packagesroot=$env:TF_PACKAGES_DIR
& $nugetExe pack $stagingDir\$file -OutputDirectory $packageOutDir -Version $version -Properties Version=$version`;Srcroot=$env:TF_SRC_DIR`;Packagesroot=$env:TF_PACKAGES_DIR`;TestPlatformVersion=$TestPlatformVersion

if ($lastExitCode -ne 0) {
throw "Nuget pack failed with an exit code of '$lastExitCode'."
Expand All @@ -299,17 +307,15 @@ function Replace-InFile($File, $RegEx, $ReplaceWith) {
}

function Sync-PackageVersions {
$versionsFile = "$PSScriptRoot\build\TestFx.Versions.targets"

$versionsRegex = '(?mi)<(TestPlatformVersion.*?)>(.*?)<\/TestPlatformVersion>'
$packageRegex = '(?mi)<package id="Microsoft\.TestPlatform([0-9a-z.]+)?" version="([0-9a-z.-]*)"'
$sourceRegex = '(?mi)(.+[a-z =]+\@\")Microsoft\.TestPlatform\.([0-9.-a-z]+)\";'

if ([String]::IsNullOrWhiteSpace($TestPlatformVersion)) {
$TestPlatformVersion = (([XML](Get-Content $versionsFile)).Project.PropertyGroup.TestPlatformVersion).InnerText
$TestPlatformVersion = (([XML](Get-Content $TF_VERSIONS_FILE)).Project.PropertyGroup.TestPlatformVersion).InnerText
}
else {
Replace-InFile -File $versionsFile -RegEx $versionsRegex -ReplaceWith "<`$1>$TestPlatformVersion</TestPlatformVersion>"
Replace-InFile -File $TF_VERSIONS_FILE -RegEx $versionsRegex -ReplaceWith "<`$1>$TestPlatformVersion</TestPlatformVersion>"
}

(Get-ChildItem "$PSScriptRoot\..\src\*packages.config", "$PSScriptRoot\..\test\*packages.config" -Recurse) | ForEach-Object {
Expand Down
6 changes: 5 additions & 1 deletion scripts/common.lib.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ $env:TF_SRC_DIR = Join-Path $env:TF_ROOT_DIR "src"
$env:TF_TEST_DIR = Join-Path $env:TF_ROOT_DIR "test"
$env:TF_PACKAGES_DIR = Join-Path $env:TF_ROOT_DIR "packages"

$TF_VERSIONS_FILE = "$PSScriptRoot\build\TestFx.Versions.targets"
if ([String]::IsNullOrWhiteSpace($TestPlatformVersion)) {
$TestPlatformVersion = (([XML](Get-Content $TF_VERSIONS_FILE)).Project.PropertyGroup.TestPlatformVersion).InnerText
}

function Create-Directory([string[]] $path) {
if (!(Test-Path -path $path)) {
Expand Down Expand Up @@ -136,7 +140,7 @@ function Locate-VsInstallPath($hasVsixExtension = "false") {

Write-Verbose "$vswhere -latest -products * -requires $requiredPackageIds -property installationPath"
try {
if ($Official) {
if ($Official -or $DisallowPrereleaseMSBuild) {
$vsInstallPath = & $vswhere -latest -products * -requires $requiredPackageIds -property installationPath
}
else {
Expand Down
9 changes: 6 additions & 3 deletions src/Package/MSTest.TestAdapter.Enu.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
<dependencies>
<group targetFramework="netcoreapp1.0">
<dependency id="NETStandard.Library" version="1.6.1" />
<dependency id="Microsoft.TestPlatform.AdapterUtilities" version="[16.9.1, )" />
<dependency id="Microsoft.TestPlatform.AdapterUtilities" version="$TestPlatformVersion$" />
<dependency id="System.Diagnostics.TextWriterTraceListener" version="4.3.0" />
</group>

<group targetFramework="net45">
<dependency id="Microsoft.TestPlatform.AdapterUtilities" />
<dependency id="Microsoft.TestPlatform.AdapterUtilities" version="$TestPlatformVersion$" />
</group>

<group targetFramework="uap10.0">
<dependency id="Microsoft.TestPlatform.AdapterUtilities" />
<dependency id="Microsoft.TestPlatform.AdapterUtilities" version="$TestPlatformVersion$" />
</group>
</dependencies>
</metadata>
Expand All @@ -46,15 +46,18 @@
<!-- NetCore -->
<file src="Build\NetCore\MSTest.TestAdapter.props" target="build\netcoreapp1.0\" />
<file src="PlatformServices.NetCore\netstandard1.5\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll" target="build\netcoreapp1.0\" />
<file src="Microsoft.TestPlatform.AdapterUtilities\netstandard1.0\" target="build\netcoreapp1.0\" />

<!-- UWP -->
<file src="Build\Universal\MSTest.TestAdapter.props" target="build\uap10.0\MSTest.TestAdapter.props" />
<file src="Build\Universal\MSTest.TestAdapter.targets" target="build\uap10.0\MSTest.TestAdapter.targets" />
<file src="PlatformServices.Universal\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll" target="build\uap10.0\" />
<file src="Microsoft.TestPlatform.AdapterUtilities\uap10.0\" target="build\uap10.0\" />

<!-- Desktop -->
<file src="Build\Desktop\MSTest.TestAdapter.props" target="build\net45\MSTest.TestAdapter.props" />
<file src="Build\Desktop\MSTest.TestAdapter.targets" target="build\net45\MSTest.TestAdapter.targets" />
<file src="Microsoft.TestPlatform.AdapterUtilities\netstandard2.0\" target="build\net45\" />

<!-- LICENSE -->
<!-- Workaround for https://github.com/NuGet/Home/issues/7601 -->
Expand Down
5 changes: 4 additions & 1 deletion src/Package/MSTest.TestAdapter.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
<tags>MSTest TestFramework TestAdapter VisualStudio Unittest MSTestV2 Microsoft</tags>
<dependencies>
<dependency id="Microsoft.TestPlatform.AdapterUtilities" version="[16.9.1, )" />
<dependency id="Microsoft.TestPlatform.AdapterUtilities" version="$TestPlatformVersion$" />
</dependencies>
</metadata>
<files>
Expand Down Expand Up @@ -75,6 +75,7 @@
<!-- NetCore -->
<file src="Build\NetCore\MSTest.TestAdapter.props" target="build\netcoreapp1.0\" />
<file src="PlatformServices.NetCore\netstandard1.5\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll" target="build\netcoreapp1.0\" />
<file src="Microsoft.TestPlatform.AdapterUtilities\netstandard1.0\" target="build\netcoreapp1.0\" />

<!-- <file src="PlatformServices.NetCore\netstandard1.5\zh-Hans\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" target="\build\netcoreapp1.0\zh-Hans" />
<file src="PlatformServices.NetCore\netstandard1.5\zh-Hant\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" target="\build\netcoreapp1.0\zh-Hant" />
Expand All @@ -94,10 +95,12 @@
<file src="Build\Universal\MSTest.TestAdapter.props" target="build\uap10.0\MSTest.TestAdapter.props" />
<file src="Build\Universal\MSTest.TestAdapter.targets" target="build\uap10.0\MSTest.TestAdapter.targets" />
<file src="PlatformServices.Universal\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll" target="build\uap10.0\" />
<file src="Microsoft.TestPlatform.AdapterUtilities\uap10.0\" target="build\uap10.0\" />

<!-- Desktop -->
<file src="Build\Desktop\MSTest.TestAdapter.props" target="build\net45\MSTest.TestAdapter.props" />
<file src="Build\Desktop\MSTest.TestAdapter.targets" target="build\net45\MSTest.TestAdapter.targets" />
<file src="Microsoft.TestPlatform.AdapterUtilities\netstandard2.0\" target="build\net45\" />

<!-- LICENSE -->
<!-- Workaround for https://github.com/NuGet/Home/issues/7601 -->
Expand Down
12 changes: 6 additions & 6 deletions src/Package/MSTest.TestAdapter.symbols.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
<iconUrl>http://go.microsoft.com/fwlink/?LinkID=288859</iconUrl>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
<tags>MSTest TestFramework TestAdapter VisualStudio Unittest MSTestV2 Microsoft</tags>
<dependencies>
<group targetFramework="netcoreapp1.0">
<dependency id="NETStandard.Library" version="1.6.1" />
<dependency id="System.Diagnostics.TextWriterTraceListener" version="4.3.0" />
</group>
<dependencies>
<group targetFramework="netcoreapp1.0">
<dependency id="NETStandard.Library" version="1.6.1" />
<dependency id="System.Diagnostics.TextWriterTraceListener" version="4.3.0" />
</group>
</dependencies>
</metadata>
<files>
Expand All @@ -33,7 +33,7 @@
<file src="PlatformServices.Desktop\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll" target="build\_common\" />
<file src="MSTest.Core\Microsoft.VisualStudio.TestPlatform.TestFramework.dll" target="build\_common\" />

<!-- NetCore -->
<!-- NetCore -->
<file src="Build\NetCore\MSTest.TestAdapter.props" target="build\netcoreapp1.0\" />
<file src="PlatformServices.NetCore\netstandard1.5\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll" target="build\netcoreapp1.0\" />

Expand Down
18 changes: 9 additions & 9 deletions src/Package/MSTest.TestFramework.enu.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
<owners>Microsoft</owners>
<summary>This is MSTest V2, the evolution of Microsoft's Test Framework.</summary>
<description>
This is MSTest V2, the evolution of Microsoft's Test Framework.
This is MSTest V2, the evolution of Microsoft's Test Framework.

Supported platforms:
- .NET 4.5.0+
- .NET Core 1.0+ (Universal Windows Apps 10+, DNX Core 5+)
- ASP.NET Core 1.0+
Supported platforms:
- .NET 4.5.0+
- .NET Core 1.0+ (Universal Windows Apps 10+, DNX Core 5+)
- ASP.NET Core 1.0+

To discover and execute tests install MSTest.TestAdapter.
To discover and execute tests install MSTest.TestAdapter.

To discover and execute tests for project.json based projects install dotnet-test-mstest.
</description>
Expand All @@ -29,16 +29,16 @@
<dependencies>
<group targetFramework="netstandard1.0">
<dependency id="NETStandard.Library" version="1.6.1" />
<dependency id="Microsoft.TestPlatform.AdapterUtilities" version="[16.9.1, )" />
<dependency id="Microsoft.TestPlatform.AdapterUtilities" version="$TestPlatformVersion$" />
<dependency id="System.Diagnostics.TextWriterTraceListener" version="4.3.0" />
</group>

<group targetFramework="net45">
<dependency id="Microsoft.TestPlatform.AdapterUtilities" version="[16.9.1, )" />
<dependency id="Microsoft.TestPlatform.AdapterUtilities" version="$TestPlatformVersion$" />
</group>

<group targetFramework="uap10.0">
<dependency id="Microsoft.TestPlatform.AdapterUtilities" version="[16.9.1, )" />
<dependency id="Microsoft.TestPlatform.AdapterUtilities" version="$TestPlatformVersion$" />
</group>
</dependencies>
</metadata>
Expand Down
14 changes: 7 additions & 7 deletions src/Package/MSTest.TestFramework.symbols.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<description>
This is MSTest V2, the evolution of Microsoft's Test Framework.
This is MSTest V2, the evolution of Microsoft's Test Framework.

Supported platforms:
- .NET 4.5.0+
- .NET Core 1.0+ (Universal Windows Apps 10+, DNX Core 5+)
- ASP.NET Core 1.0+
Supported platforms:
- .NET 4.5.0+
- .NET Core 1.0+ (Universal Windows Apps 10+, DNX Core 5+)
- ASP.NET Core 1.0+

To discover and execute tests install MSTest.TestAdapter.
To discover and execute tests install MSTest.TestAdapter.

To discover and execute tests for project.json based projects install dotnet-test-mstest.
</description>
Expand All @@ -35,7 +35,7 @@
<!-- Symbols -->
<file src="MSTest.Core\Microsoft.VisualStudio.TestPlatform.TestFramework.pdb" target="lib\netstandard1.0\" />
<file src="Extension.Core\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.pdb" target="lib\netstandard1.0" />
<!-- net45 -->
<file src="MSTest.Core\Microsoft.VisualStudio.TestPlatform.TestFramework.dll" target="lib\net45\" />
<file src="MSTest.Core\Microsoft.VisualStudio.TestPlatform.TestFramework.xml" target="lib\net45\" />
Expand Down

0 comments on commit d4ec238

Please sign in to comment.