Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Evangelink committed Jun 10, 2024
2 parents b27eb45 + afb1c87 commit dbec6ce
Show file tree
Hide file tree
Showing 73 changed files with 1,416 additions and 202 deletions.
4 changes: 1 addition & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-code-owners

* @Evangelink

src/Package/MSTest.Sdk @MarcoRossignoli
src/Platform @MarcoRossignoli @Evangelink
src/Platform @MarcoRossignoli @Evangelink
9 changes: 9 additions & 0 deletions azure-pipelines-official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@ extends:
filePath: './eng/install-windows-sdk.ps1'
failOnStderr: true
showWarnings: true

- task: PowerShell@2
displayName: 'Install procdump'
inputs:
targetType: filePath
filePath: ./eng/install-procdump.ps1
failOnStderr: true
showWarnings: true


- script: eng\common\CIBuild.cmd
-configuration $(_BuildConfig)
Expand Down
8 changes: 8 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ stages:
filePath: './eng/install-windows-sdk.ps1'
failOnStderr: true
showWarnings: true

- task: PowerShell@2
displayName: 'Install procdump'
inputs:
targetType: filePath
filePath: ./eng/install-procdump.ps1
failOnStderr: true
showWarnings: true

- script: eng\common\CIBuild.cmd
-configuration $(_BuildConfig)
Expand Down
12 changes: 6 additions & 6 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>2fb543a45580400a559b5ae41c96a815ea14dac5</Sha>
</Dependency>
<Dependency Name="Microsoft.Testing.Extensions.CodeCoverage" Version="17.11.2-preview.24280.3">
<Dependency Name="Microsoft.Testing.Extensions.CodeCoverage" Version="17.12.0-preview.24281.3">
<Uri>https://dev.azure.com/devdiv/DevDiv/_git/vs-code-coverage</Uri>
<Sha>e561b423c2b4158f4ba3efce2f3f9211650db5ac</Sha>
<Sha>fbc5c8316febc4897fe37cb6a1bb20a998917a87</Sha>
</Dependency>
<Dependency Name="Microsoft.Testing.Platform" Version="1.3.0-preview.24279.5">
<Dependency Name="Microsoft.Testing.Platform" Version="1.3.0-preview.24306.4">
<Uri>https://github.com/microsoft/testanywhere</Uri>
<Sha>da3aa940d2c59791d1c1f6bc00567c7cfeada675</Sha>
<Sha>a370bbced4cc92b0ba068222384cc85347eb9a79</Sha>
</Dependency>
<Dependency Name="MSTest.Engine" Version="1.0.0-alpha.24279.5">
<Dependency Name="MSTest.Engine" Version="1.0.0-alpha.24306.4">
<Uri>https://github.com/microsoft/testanywhere</Uri>
<Sha>da3aa940d2c59791d1c1f6bc00567c7cfeada675</Sha>
<Sha>a370bbced4cc92b0ba068222384cc85347eb9a79</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
6 changes: 3 additions & 3 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
</PropertyGroup>
<PropertyGroup Label="MSTest prod dependencies - darc updated">
<MicrosoftDotNetBuildTasksTemplatingPackageVersion>8.0.0-beta.24270.4</MicrosoftDotNetBuildTasksTemplatingPackageVersion>
<MicrosoftTestingExtensionsCodeCoverageVersion>17.11.2-preview.24280.3</MicrosoftTestingExtensionsCodeCoverageVersion>
<MicrosoftTestingExtensionsCodeCoverageVersion>17.12.0-preview.24281.3</MicrosoftTestingExtensionsCodeCoverageVersion>
<!-- comment to facilitate merge conflicts -->
<MicrosoftTestingPlatformVersion>1.3.0-preview.24279.5</MicrosoftTestingPlatformVersion>
<MSTestEngineVersion>1.0.0-alpha.24279.5</MSTestEngineVersion>
<MicrosoftTestingPlatformVersion>1.3.0-preview.24306.4</MicrosoftTestingPlatformVersion>
<MSTestEngineVersion>1.0.0-alpha.24306.4</MSTestEngineVersion>
</PropertyGroup>
</Project>
99 changes: 99 additions & 0 deletions eng/install-procdump.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
param(
[switch]$Force
)

function Download {
<#
.SYNOPSIS
Downloads a given uri and saves it to outputFile
.DESCRIPTION
Downloads a given uri and saves it to outputFile
PARAMETER uri
The uri to fetch
.PARAMETER outputFile
The outputh file path to save the uri
#>
param(
[Parameter(Mandatory = $true)]
$uri,

[Parameter(Mandatory = $true)]
$outputFile
)
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$ProgressPreference = 'SilentlyContinue' # Don't display the console progress UI - it's a huge perf hit

$maxRetries = 5
$retries = 1

while ($true) {
try {
Write-Host "GET $uri"
Invoke-WebRequest $uri -OutFile $outputFile
break
}
catch {
Write-Host "Failed to download '$uri'"
$error = $_.Exception.Message
}

if (++$retries -le $maxRetries) {
Write-Warning $error -ErrorAction Continue
$delayInSeconds = [math]::Pow(2, $retries) - 1 # Exponential backoff
Write-Host "Retrying. Waiting for $delayInSeconds seconds before next attempt ($retries of $maxRetries)."
Start-Sleep -Seconds $delayInSeconds
}
else {
Write-Error $error -ErrorAction Continue
throw "Unable to download file in $maxRetries attempts."
}
}

Write-Host "Download of '$uri' complete, saved to $outputFile..."

}

function Install-Procdump {
<#
.SYNOPSIS
Installs ProcDump into a folder in this repo.
.DESCRIPTION
This script downloads and extracts the ProcDump.
.PARAMETER Force
Overwrite the existing installation
#>
param(
[switch]$Force
)
$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138

Set-StrictMode -Version 1

$repoRoot = Resolve-Path "$PSScriptRoot\..\.."
$installDir = "$repoRoot\.tools\ProcDump\"

if (Test-Path "$installDir\procdump.exe") {
if ($Force) {
Remove-Item -Force -Recurse $installDir
}
else {
Write-Host "ProcDump already installed to $installDir. Exiting without action. Call this script again with -Force to overwrite."
exit 0
}
}

mkdir $installDir -ea Ignore | out-null
Write-Host "Starting ProcDump download"
Download "https://download.sysinternals.com/files/Procdump.zip" "$installDir/ProcDump.zip"
Write-Host "Done downloading ProcDump"
Expand-Archive "$installDir/ProcDump.zip" -d "$installDir"
Write-Host "Expanded ProcDump to $installDir"

if ($env:TF_BUILD) {
Write-Host "##vso[task.setvariable variable=PROCDUMP_PATH]$installDir"
Write-Host "##vso[task.prependpath]$installDir"
}
}

Install-Procdump -Force:$Force
18 changes: 15 additions & 3 deletions samples/public/DemoMSTestSdk/DemoMSTestSdk.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.34807.42
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectUsingVSTest", "ProjectUsingVSTest\ProjectUsingVSTest.csproj", "{0360A072-0ED6-4A27-9AE5-3C6DD055733E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProjectUsingVSTest", "ProjectUsingVSTest\ProjectUsingVSTest.csproj", "{0360A072-0ED6-4A27-9AE5-3C6DD055733E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectUsingMSTestRunner", "ProjectUsingMSTestRunner\ProjectUsingMSTestRunner.csproj", "{8DA3F43B-938F-4A1E-BE58-B7F80386187F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProjectUsingMSTestRunner", "ProjectUsingMSTestRunner\ProjectUsingMSTestRunner.csproj", "{8DA3F43B-938F-4A1E-BE58-B7F80386187F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectWithNativeAOT", "ProjectWithNativeAOT\ProjectWithNativeAOT.csproj", "{9EA03738-C4AA-4CD7-BF71-BA8E689522D7}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProjectWithNativeAOT", "ProjectWithNativeAOT\ProjectWithNativeAOT.csproj", "{9EA03738-C4AA-4CD7-BF71-BA8E689522D7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProjectUsingPlaywright", "ProjectUsingPlaywright\ProjectUsingPlaywright.csproj", "{D047E30F-BEC1-496A-A84B-D27E0966F7DD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectUsingAspire", "ProjectUsingAspire\ProjectUsingAspire.csproj", "{274001A3-B33E-4235-92D4-1A8F39595F5F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -27,6 +31,14 @@ Global
{9EA03738-C4AA-4CD7-BF71-BA8E689522D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9EA03738-C4AA-4CD7-BF71-BA8E689522D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9EA03738-C4AA-4CD7-BF71-BA8E689522D7}.Release|Any CPU.Build.0 = Release|Any CPU
{D047E30F-BEC1-496A-A84B-D27E0966F7DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D047E30F-BEC1-496A-A84B-D27E0966F7DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D047E30F-BEC1-496A-A84B-D27E0966F7DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D047E30F-BEC1-496A-A84B-D27E0966F7DD}.Release|Any CPU.Build.0 = Release|Any CPU
{274001A3-B33E-4235-92D4-1A8F39595F5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{274001A3-B33E-4235-92D4-1A8F39595F5F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{274001A3-B33E-4235-92D4-1A8F39595F5F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{274001A3-B33E-4235-92D4-1A8F39595F5F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
namespace Aspire.Tests1;

[TestClass]
public class IntegrationTest1
{
// Instructions:
// 1. Add a project reference to the target AppHost project, e.g.:
//
// <ItemGroup>
// <ProjectReference Include="../MyAspireApp.AppHost/MyAspireApp.AppHost.csproj" />
// </ItemGroup>
//
// 2. Uncomment the following example test and update 'Projects.MyAspireApp_AppHost' to match your AppHost project:
//
// [TestMethod]
// public async Task GetWebResourceRootReturnsOkStatusCode()
// {
// // Arrange
// var appHost = await DistributedApplicationTestingBuilder.CreateAsync<Projects.MyAspireApp_AppHost>();
// await using var app = await appHost.BuildAsync();
// await app.StartAsync();

// // Act
// var httpClient = app.CreateHttpClient("webfrontend");
// var response = await httpClient.GetAsync("/");

// // Assert
// Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);
// }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<Project Sdk="MSTest.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<!-- By default, MSTest Sdk uses MSTest runner -->
<EnableAspireTesting>true</EnableAspireTesting>
</PropertyGroup>

</Project>

<!--
Below is the equivalent project configuration when not using MSTest.Sdk
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<EnableMSTestRunner>true</EnableMSTestRunner>
<OutputType>Exe</OutputType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Aspire.Hosting.Testing" Version="$(AspireTestingVersion)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(VSTestVersion)" />
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" Version="$(CodeCoverageVersion)" />
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" Version="$(TestingPlatformVersion)" />
<PackageReference Include="MSTest.Analyzers" Version="$(MSTestVersion)" />
<PackageReference Include="MSTest.TestAdapter" Version="$(MSTestVersion)" />
<PackageReference Include="MSTest.TestFramework" Version="$(MSTestVersion)" />
</ItemGroup>
<ItemGroup>
<Using Include="Aspire.Hosting.Testing" />
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
</ItemGroup>
</Project>
-->
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,9 @@ Below is the equivalent project configuration when not using MSTest.Sdk
<PackageReference Include="MSTest.TestFramework" Version="$(MSTestVersion)" />
</ItemGroup>
<ItemGroup>
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
</ItemGroup>
</Project>
-->

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<Project Sdk="MSTest.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<!-- By default, MSTest Sdk uses MSTest runner -->
<EnablePlaywright>true</EnablePlaywright>
</PropertyGroup>

</Project>


<!--
Below is the equivalent project configuration when not using MSTest.Sdk
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<EnableMSTestRunner>true</EnableMSTestRunner>
<OutputType>Exe</OutputType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(VSTestVersion)" />
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" Version="$(CodeCoverageVersion)" />
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" Version="$(TestingPlatformVersion)" />
<PackageReference Include="MSTest.TestAdapter" Version="$(MSTestVersion)" />
<PackageReference Include="MSTest.TestFramework" Version="$(MSTestVersion)" />
<PackageReference Include="Microsoft.Playwright.MSTest" Version="$(PlaywrightVersion)" />
</ItemGroup>
<ItemGroup>
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
</ItemGroup>
</Project>
-->
33 changes: 33 additions & 0 deletions samples/public/DemoMSTestSdk/ProjectUsingPlaywright/UnitTest1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System.Text.RegularExpressions;

using Microsoft.Playwright;

namespace ProjectUsingPlaywright;

[TestClass]
public class UnitTest1 : PageTest
{
[TestMethod]
public async Task HomepageHasPlaywrightInTitleAndGetStartedLinkLinkingToTheIntroPage()
{
await Page.GotoAsync("https://playwright.dev");

// Expect a title "to contain" a substring.
await Expect(Page).ToHaveTitleAsync(new Regex("Playwright"));

// create a locator
ILocator getStarted = Page.Locator("text=Get Started");

// Expect an attribute "to be strictly equal" to the value.
await Expect(getStarted).ToHaveAttributeAsync("href", "/docs/intro");

// Click the get started link.
await getStarted.ClickAsync();

// Expects the URL to contain intro.
await Expect(Page).ToHaveURLAsync(new Regex(".*intro"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,9 @@ Below is the equivalent project configuration when not using MSTest.Sdk
<PackageReference Include="MSTest.TestFramework" Version="$(MSTestVersion)" />
</ItemGroup>
<ItemGroup>
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
</ItemGroup>
</Project>
-->
Loading

0 comments on commit dbec6ce

Please sign in to comment.