Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross platform acceptance tests #2653

Merged
merged 88 commits into from Nov 30, 2020
Merged
Show file tree
Hide file tree
Changes from 87 commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
5e78ff6
Linux build fix
nohwnd Jul 3, 2020
28742e0
a
nohwnd Jul 9, 2020
ed1b723
aaa
nohwnd Jul 9, 2020
c470098
build works
nohwnd Jul 15, 2020
19930ae
Run tests on linux
nohwnd Jul 15, 2020
200376b
Use 18.04
nohwnd Jul 15, 2020
18edda6
Add ref
nohwnd Jul 15, 2020
80b1e93
Actually update Ubuntu version
nohwnd Jul 15, 2020
5b882eb
Merge branch 'linux-build' into linux-test
nohwnd Jul 15, 2020
339ab72
Common unit tests fixed
nohwnd Jul 15, 2020
71b2252
Procdump
nohwnd Jul 16, 2020
d8a3c2a
Merge branch 'linux-build' of https://github.com/nohwnd/vstest into l…
nohwnd Jul 16, 2020
ed3e665
Merge branch 'linux-build' into linux-test
nohwnd Jul 16, 2020
6bf5ba5
Skip Vanguard tests
nohwnd Jul 16, 2020
5f32ca4
Fix collector test
nohwnd Jul 16, 2020
18ab4a7
Fix Client.UnitTests
nohwnd Jul 17, 2020
cbb45f8
One test to go on WIndows
nohwnd Jul 21, 2020
410bd44
a
nohwnd Jul 21, 2020
448a87a
Merge
nohwnd Jul 21, 2020
1444436
f
nohwnd Jul 21, 2020
24ce022
fix
nohwnd Jul 22, 2020
baef3ae
aaa
nohwnd Jul 22, 2020
7a07849
Exclude blame
nohwnd Jul 23, 2020
0dba966
Fixed linux build
Haplois Nov 3, 2020
084d870
Merge pull request #1 from Haplois/linux-build-fix
nohwnd Nov 4, 2020
ab7c4cc
Enable linux build in PR
nohwnd Nov 4, 2020
fa21316
Merge branch 'master' of https://github.com/microsoft/vstest into master
nohwnd Nov 4, 2020
4d87208
Merge branch 'master' into enable-linux-build
nohwnd Nov 4, 2020
c07eac7
Merge master
nohwnd Nov 4, 2020
b774394
include tuple
nohwnd Nov 4, 2020
066cc2b
fff
nohwnd Nov 4, 2020
7483075
Merge branch 'enable-linux-build' into linux-test
nohwnd Nov 4, 2020
500f8ce
fix IsTestProject
nohwnd Nov 4, 2020
3edaa2d
exclude logs
nohwnd Nov 4, 2020
2a11826
Remove logs
nohwnd Nov 4, 2020
d2abaf3
Fix Microsoft.TestPlatform.ObjectModel.UnitTests
nohwnd Nov 4, 2020
bd3d852
Fix tests
nohwnd Nov 4, 2020
745487d
Fix vstest.console.UnitTests
nohwnd Nov 4, 2020
4daa670
Merge branch 'master' into linux-test
nohwnd Nov 4, 2020
0d1af5c
Fix merge conflict
nohwnd Nov 4, 2020
ed53ebe
Fixing build
nohwnd Nov 5, 2020
4df489b
Fix build for mac
nohwnd Nov 5, 2020
b7231e7
Add missing ;
nohwnd Nov 5, 2020
a06a688
fix more unit tests
nohwnd Nov 6, 2020
781fd6e
Remove system.valuetuple because it does not build on mono with the c…
nohwnd Nov 6, 2020
ddf0da9
Fix resources again, because they depend on the way we store them on …
nohwnd Nov 6, 2020
81e8a83
Fix vsconsole tests
nohwnd Nov 6, 2020
81135a6
Fix runtime info
nohwnd Nov 6, 2020
4326bdc
Skip socket test
nohwnd Nov 6, 2020
58399d4
Fix my own review comments
nohwnd Nov 6, 2020
7cdf093
Fix Windows test
nohwnd Nov 6, 2020
70d0751
MacOS build and test
nohwnd Nov 6, 2020
89d5c04
remove duplicate Linux job
nohwnd Nov 6, 2020
532d28c
Address review comments
nohwnd Nov 9, 2020
a0be59e
Update azure-pipelines.yml for Azure Pipelines
nohwnd Nov 9, 2020
73d128e
Use Build.SourcesDirectory
nohwnd Nov 9, 2020
ef3b911
Fix some tests
nohwnd Nov 9, 2020
99eabd9
Merge branch 'master' into linux-acceptance-test
nohwnd Nov 20, 2020
ff23a61
Merge branch 'master' of https://github.com/microsoft/vstest into lin…
nohwnd Nov 23, 2020
5c7f57b
Merge branch 'master' of https://github.com/microsoft/vstest into lin…
nohwnd Nov 23, 2020
2893b69
Pass changes
nohwnd Nov 23, 2020
9d57246
Merge branch 'linux-acceptance-test' of https://github.com/nohwnd/vst…
nohwnd Nov 23, 2020
bdd6031
Skipping tests I could not fix
nohwnd Nov 24, 2020
048f6a4
Add acceptance test run
nohwnd Nov 24, 2020
7c6ffa7
Fix loop to parse more than 1 parameter
nohwnd Nov 24, 2020
e78b91d
Merge branch 'linux-acceptance-test' into linux-multi-job-build
nohwnd Nov 24, 2020
f0ca734
Upload and download artifacts
nohwnd Nov 24, 2020
15e02df
Update azure-pipelines.yml for Azure Pipelines
nohwnd Nov 24, 2020
d447cdd
Fix slash
nohwnd Nov 24, 2020
00d5278
Revert externals
nohwnd Nov 24, 2020
bd6e17c
Update azure-pipelines.yml for Azure Pipelines
nohwnd Nov 25, 2020
e9b0070
Update azure-pipelines.yml for Azure Pipelines
nohwnd Nov 25, 2020
a0a448b
Merge branch 'master' into dev/jajares/linux-acceptance-tests
nohwnd Nov 25, 2020
38a99e7
Skip one more
nohwnd Nov 25, 2020
27f390a
Skip some steps
nohwnd Nov 25, 2020
998197e
Build on acceptance
nohwnd Nov 25, 2020
60389ff
Update azure-pipelines.yml for Azure Pipelines
nohwnd Nov 25, 2020
130c117
Skip some steps
nohwnd Nov 25, 2020
e3ea487
Merge branch 'dev/jajares/linux-acceptance-tests' of https://github.c…
nohwnd Nov 25, 2020
18c77bc
Remove (
nohwnd Nov 25, 2020
8a53142
List files
nohwnd Nov 25, 2020
8170047
AAAAAArgh!!!
nohwnd Nov 25, 2020
4b1c0ac
Copy packages to temp dir right after publish
nohwnd Nov 26, 2020
83f3a9d
Create packages dir
nohwnd Nov 27, 2020
c26a3d0
Make output longer
nohwnd Nov 27, 2020
53b6e98
Use Windows-Review tag
nohwnd Nov 30, 2020
8328840
Add Windows-Review filter
nohwnd Nov 30, 2020
f49078b
Apply suggestions from code review
nohwnd Nov 30, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
62 changes: 57 additions & 5 deletions azure-pipelines.yml
Expand Up @@ -12,7 +12,7 @@ jobs:
displayName: 'Run script build.cmd'
inputs:
filename: build.cmd
arguments: '-verbose -configuration $(buildConfiguration)'
arguments: '-verbose -configuration $(buildConfiguration) -steps "InstallDotnet, Restore, UpdateLocalization, Build, Publish"'
modifyEnvironment: false
failOnStandardError: true

Expand All @@ -32,7 +32,48 @@ jobs:
arguments: '-verbose -configuration $(buildConfiguration)'
modifyEnvironment: false
failOnStandardError: true

- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.SourcesDirectory)\artifacts'
artifact: 'testArtifacts'
publishLocation: 'pipeline'

- job: WindowsAcceptance
dependsOn: Windows
timeoutInMinutes: 120
pool:
vmImage: 'vs2017-win2016'
variables:
buildConfiguration: 'Release'
steps:
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: 'testArtifacts'
targetPath: '$(Build.SourcesDirectory)\artifacts'

- task: PowerShell@2
inputs:
targetType: 'inline'
script: 'ls "$(Build.SourcesDirectory)\artifacts\" -Recurse -Dir'

- task: BatchScript@1
displayName: 'Run script build.cmd'
inputs:
filename: build.cmd
# build should not be needed in the end, we are copying the build task from the build folder, but we should get
# it either from artifacts, if present, or from extracted package file
# Adding it at the moment to avoid this error: #[error]Copy-Item : Cannot find path 'D:\a\1\s\src\Microsoft.TestPlatform.Build\bin\Release\netstandard2.0' because it does not exist.
arguments: '-verbose -configuration $(buildConfiguration) -steps "InstallDotnet, Build, PrepareAcceptanceTests"'
modifyEnvironment: false
failOnStandardError: true

- task: PowerShell@2
inputs:
targetType: 'inline'
script: 'ls "$(Build.SourcesDirectory)\artifacts\Release\packages"'

- task: BatchScript@1
displayName: 'Run Acceptance Tests'
inputs:
Expand Down Expand Up @@ -64,7 +105,8 @@ jobs:
testResultsFiles: '**\*.trx'
condition: succeededOrFailed()

- job:
- job: OtherOSes
dependsOn: Windows
workspace:
clean: all
strategy:
Expand All @@ -81,7 +123,17 @@ jobs:
buildConfiguration: 'Release'
steps:
- script: ./build.sh -c $(buildConfiguration)
displayName: './build.sh -c $(buildConfiguration)'
- script: ./test.sh -c $(buildConfiguration)
displayName: './test.sh -c $(buildConfiguration)'
displayName: 'Build'
- script: ./test.sh -c $(buildConfiguration) -p Unit
displayName: 'Unit tests'
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: 'testArtifacts'
targetPath: '$(Build.SourcesDirectory)/artifacts'
- script: ./tools/dotnet-linux/dotnet build -c $(buildConfiguration) ./test/TestAssets/TestAssets.sln
displayName: 'Build test assets'
- script: ./test.sh -c $(buildConfiguration) -p Acceptance
displayName: 'Acceptance tests'


4 changes: 2 additions & 2 deletions global.json
@@ -1,12 +1,12 @@
{
"sdk": {
"version": "5.0.100-rc.1.20453.7",
"version": "5.0.100",
"rollForward": "minor",
"allowPrerelease": false,
"architecture": "x64"
},
"tools": {
"dotnet": "5.0.100-rc.1.20453.7"
"dotnet": "5.0.100"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.20570.10",
Expand Down
55 changes: 40 additions & 15 deletions scripts/build.ps1
Expand Up @@ -45,7 +45,13 @@ Param(
# Build specific projects
[Parameter(Mandatory=$false)]
[Alias("p")]
[System.String[]] $ProjectNamePatterns = @()
[System.String[]] $ProjectNamePatterns = @(),

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

[Alias("s")]
[String[]] $Steps = @("InstallDotnet", "Restore", "UpdateLocalization", "Build", "Publish", "PrepareAcceptanceTests")
)

$ErrorActionPreference = "Stop"
Expand Down Expand Up @@ -82,7 +88,7 @@ $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
# Dotnet build doesn't support --packages yet. See https://github.com/dotnet/cli/issues/2712
$env:NUGET_PACKAGES = $env:TP_PACKAGES_DIR
$env:NUGET_EXE_Version = "3.4.3"
$env:DOTNET_CLI_VERSION = "5.0.100-rc.1.20453.7"
$env:DOTNET_CLI_VERSION = "5.0.100"
# $env:DOTNET_RUNTIME_VERSION = "LATEST"
$env:VSWHERE_VERSION = "2.0.2"
$env:MSBUILD_VERSION = "15.0"
Expand Down Expand Up @@ -270,6 +276,7 @@ function Copy-PackageIntoStaticDirectory {
# need to put them in folder that is not changing it's name based on config
$tpPackagesPath = "$env:TP_OUT_DIR\$TPB_Configuration\packages\"
$tpPackagesDestination = "$env:TP_TESTARTIFACTS"
New-Item -ItemType Directory -Force $tpPackagesDestination | Out-Null
Copy-Item $tpPackagesPath $tpPackagesDestination -Force -Filter *.nupkg -Verbose -Recurse
}

Expand Down Expand Up @@ -1103,19 +1110,37 @@ Write-Log "Test platform environment variables: "
Get-ChildItem env: | Where-Object -FilterScript { $_.Name.StartsWith("TP_") } | Format-Table
Write-Log "Test platform build variables: "
Get-Variable | Where-Object -FilterScript { $_.Name.StartsWith("TPB_") } | Format-Table
Install-DotNetCli
Clear-Package
Restore-Package
Update-LocalizedResources
Invoke-Build
Publish-Package
Create-VsixPackage
Create-NugetPackages
Generate-Manifest
Publish-PatchedDotnet
Copy-PackageIntoStaticDirectory
Invoke-TestAssetsBuild
Publish-Tests

if ($Force -or $Steps -contains "InstallDotnet") {
Install-DotNetCli
}

if ($Force -or $Steps -contains "Restore") {
Clear-Package
Restore-Package
}

if ($Force -or $Steps -contains "UpdateLocalization") {
Update-LocalizedResources
}

if ($Force -or $Steps -contains "Build") {
Invoke-Build
}

if ($Force -or $Steps -contains "Publish") {
Publish-Package
Create-VsixPackage
Create-NugetPackages
Generate-Manifest
Copy-PackageIntoStaticDirectory
}

if ($Force -or $Steps -contains "PrepareAcceptanceTests") {
Publish-PatchedDotnet
Invoke-TestAssetsBuild
Publish-Tests
}

Write-Log "Build complete. {$(Get-ElapsedTime($timer))}"
if ($Script:ScriptFailed) { Exit 1 } else { Exit 0 }
2 changes: 1 addition & 1 deletion scripts/build.sh
Expand Up @@ -111,7 +111,7 @@ VERSION=$(test -z $VERSION && grep TPVersionPrefix $TP_ROOT_DIR/scripts/build/Te
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
# Dotnet build doesnt support --packages yet. See https://github.com/dotnet/cli/issues/2712
export NUGET_PACKAGES=$TP_PACKAGES_DIR
DOTNET_CLI_VERSION="5.0.100-rc.1.20453.7"
DOTNET_CLI_VERSION="5.0.100"
#DOTNET_RUNTIME_VERSION="LATEST"

#
Expand Down
2 changes: 1 addition & 1 deletion scripts/perf/perf.ps1
Expand Up @@ -119,7 +119,7 @@ function Get-TestAdapterPath($testadapter)
{
if($testadapter -eq "MsTest")
{
return "$env:TP_PACKAGES_DIR\MSTest.TestAdapter\$($Script:TPT_DependencyProps.Project.PropertyGroup.MSTestAdapterVersion)\build\_common"
return "$env:TP_PACKAGES_DIR\mstest.testadapter\$($Script:TPT_DependencyProps.Project.PropertyGroup.MSTestAdapterVersion)\build\_common"
}
if($testadapter -eq "xUnit")
{
Expand Down
21 changes: 15 additions & 6 deletions scripts/test.sh
Expand Up @@ -15,11 +15,12 @@ NOCOLOR='\033[0m'
# Parse options
#
CONFIGURATION="Debug"
TARGET_RUNTIME="ubuntu.16.04-x64"
TARGET_RUNTIME="ubuntu.18.04-x64"
FAIL_FAST=false
VERBOSE=false

while [ $# -gt 0 ]; do
while [ $# -gt 0 ]
do
lowerI="$(echo ${1:-} | awk '{print tolower($0)}')"
case $lowerI in
-h | --help)
Expand All @@ -28,27 +29,35 @@ while [ $# -gt 0 ]; do
;;
-c)
CONFIGURATION=$2
shift
shift
;;
-r)
TARGET_RUNTIME=$2
shift
shift
;;
-p)
PROJECT_NAME_PATTERNS=$2
shift
shift
;;
-verbose)
VERBOSE=$2
shift
shift
;;
*)
break
echo Unknown parameter $key
shift
;;
esac
shift
done

#
# Variables
#
PROJECT_NAME_PATTERNS=**Unit*bin*$CONFIGURATION*netcoreapp2.1*UnitTests*dll
PROJECT_NAME_PATTERNS=**$PROJECT_NAME_PATTERNS*bin*$CONFIGURATION*netcoreapp2.1*${PROJECT_NAME_PATTERNS}Tests*dll
TP_ROOT_DIR=$(cd "$(dirname "$0")"; pwd -P)
TP_TOOLS_DIR="$TP_ROOT_DIR/tools"
TP_PACKAGES_DIR="$TP_ROOT_DIR/packages"
Expand Down Expand Up @@ -111,7 +120,7 @@ function invoke_test()
local dotnet=$(_get_dotnet_path)
local vstest=$TP_OUT_DIR/$TPB_Configuration/$TPB_TargetFrameworkCore/vstest.console.dll

find ./test -path $PROJECT_NAME_PATTERNS | xargs $dotnet $vstest --parallel --testcasefilter:"TestCategory!=Windows"
find ./test -path $PROJECT_NAME_PATTERNS | xargs $dotnet $vstest --parallel --testcasefilter:"TestCategory!=Windows&TestCategory!=Windows-Review"
}

#
Expand Down
1 change: 1 addition & 0 deletions src/package/nuspec/Microsoft.NET.Test.Sdk.props
Expand Up @@ -13,6 +13,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<TestProject>true</TestProject>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

Expand Down
2 changes: 2 additions & 0 deletions test/Microsoft.TestPlatform.AcceptanceTests/AppDomainTests.cs
Expand Up @@ -14,9 +14,11 @@ namespace Microsoft.TestPlatform.AcceptanceTests
using Microsoft.VisualStudio.TestTools.UnitTesting;

[TestClass]
[TestCategory("Windows-Review")]
public class AppDomainTests : AcceptanceTestBase
{
[TestMethod]
[TestCategory("Windows-Review")]
[NetFullTargetFrameworkDataSource]
public void RunTestExecutionWithDisableAppDomain(RunnerInfo runnerInfo)
{
Expand Down
Expand Up @@ -6,10 +6,12 @@ namespace Microsoft.TestPlatform.AcceptanceTests
using Microsoft.VisualStudio.TestTools.UnitTesting;

[TestClass]
[TestCategory("Windows-Review")]
public class ArgumentProcessorTests : AcceptanceTestBase
{

[TestMethod]
[TestCategory("Windows-Review")]
[NetFullTargetFrameworkDataSource]
public void PassingNoArgumentsToVsTestConsoleShouldPrintHelpMessage(RunnerInfo runnerInfo)
{
Expand All @@ -30,6 +32,7 @@ public void PassingNoArgumentsToVsTestConsoleShouldPrintHelpMessage(RunnerInfo r
}

[TestMethod]
[TestCategory("Windows-Review")]
[NetFullTargetFrameworkDataSource]
public void PassingInvalidArgumentsToVsTestConsoleShouldNotPrintHelpMessage(RunnerInfo runnerInfo)
{
Expand Down