Skip to content

Commit

Permalink
Add hello world winforms and wpf tests (dotnet#3258)
Browse files Browse the repository at this point in the history
  • Loading branch information
William Li authored May 29, 2019
1 parent 0188d52 commit 71e56e0
Show file tree
Hide file tree
Showing 26 changed files with 1,024 additions and 6 deletions.
27 changes: 27 additions & 0 deletions .vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,20 @@ jobs:
_SignType: test
_DotNetPublishToBlobFeed: false

- ${{ if ne(variables['System.TeamProject'], 'public') }}:
- template: /eng/build.yml
parameters:
agentOs: Windows_Perf_Helix_Fullframework
pool:
name: Hosted VS2017
strategy:
matrix:
Build_Release:
_BuildConfig: Release
_PublishType: none
_SignType: test
_DotNetPublishToBlobFeed: false

- template: /eng/build.yml
parameters:
agentOs: Linux_Perf_Helix
Expand Down Expand Up @@ -165,6 +179,19 @@ jobs:
_PublishType: none
_SignType: test

- template: /eng/build.yml
parameters:
agentOs: Windows_Perf_CI_FullFramework
pool:
name: NetCorePublic-Pool
queue: buildpool.windows.10.amd64.vs2017.open
strategy:
matrix:
Build_Release:
_BuildConfig: Release
_PublishType: none
_SignType: test

- template: /eng/build.yml
parameters:
agentOs: Linux_Perf_CI
Expand Down
16 changes: 13 additions & 3 deletions build/RunPerfTestsOnHelix.cmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@echo on
setlocal EnableDelayedExpansion

if "%BV_UPLOAD_SAS_TOKEN%" == "" (
if "%BV_UPLOAD_SAS_TOKEN%" == "" (
echo EnvVar BV_UPLOAD_SAS_TOKEN should be set; exiting...
exit /b 1)
if "%HELIX_CORRELATION_PAYLOAD%" == "" (
Expand All @@ -13,6 +13,7 @@ set PerfIterations=%2
set GIT_COMMIT=%3
set GIT_BRANCH=%4
set runType=%5
set TestFullMSBuild=%6

REM Since dotnet.exe was locked; we exclude it from the helix-payload.
REM Run a restore to re-install the SDK.
Expand All @@ -25,15 +26,24 @@ echo "Building:'Microsoft.NET.PerformanceTests.dll'"
%HELIX_CORRELATION_PAYLOAD%\.dotnet\dotnet.exe msbuild %HELIX_CORRELATION_PAYLOAD%\src\Tests\Microsoft.NET.PerformanceTests\Microsoft.NET.PerformanceTests.csproj /t:build /p:configuration=%configuration% /p:NUGET_PACKAGES=%HELIX_CORRELATION_PAYLOAD%\.packages

REM Run the performance tests and collect performance data.
REM -restore is required to make TestFullMSBuild to take effect
echo "Running the performance tests and collecting data"
powershell -NoLogo -NoProfile -ExecutionPolicy ByPass -Command "& """%HELIX_CORRELATION_PAYLOAD%\eng\common\build.ps1""" -configuration %configuration% -ci -msbuildEngine dotnet -performanceTest /p:PerfIterations=%PerfIterations%"
SETLOCAL
if "%TestFullMSBuild%"=="true" (
set _MsbuildEngineArg=
) else (
set _MsbuildEngineArg=-msbuildEngine dotnet
)
Set _Commission=30
powershell -NoLogo -NoProfile -ExecutionPolicy ByPass -Command "& """%HELIX_CORRELATION_PAYLOAD%\eng\common\build.ps1""" -restore -configuration %configuration% -ci %_MsbuildEngineArg% -performanceTest /p:PerfIterations=%PerfIterations%"
IF %ERRORLEVEL% GTR 0 exit %ERRORLEVEL%
ENDLOCAL
echo "Performance tests completed"

REM Upload the performance data to BenchView.
set perfWorkingDirectory=%HELIX_CORRELATION_PAYLOAD%\artifacts\TestResults\%configuration%\Performance
set architecture=%PROCESSOR_ARCHITECTURE%
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" (set architecture=x64)
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (set architecture=x64)

echo "Uploading data to Benchview: uploadperftobenchview.cmd"
pushd %HELIX_CORRELATION_PAYLOAD%
Expand Down
6 changes: 5 additions & 1 deletion build/uploadperftobenchview.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ if "%architecture%" == "" (
if "%OS%" == "" (
echo EnvVar OS should be set; exiting...
exit /b 1)
if "%TestFullMSBuild%" == "" (
set TestFullMSBuild=false
)
if /I not "%runType%" == "private" if /I not "%runType%" == "rolling" (
echo EnvVar runType should be set; exiting...
exit /b 1)
Expand Down Expand Up @@ -46,7 +49,7 @@ if "%GIT_BRANCH:~0,7%" == "origin/" (set GIT_BRANCH_WITHOUT_ORIGIN=%GIT_BRANCH:o

for /f %%x in ('powershell -NoProfile -NoLogo -Command "Get-Date -Date (Get-Date).ToUniversalTime() -UFormat '%%Y-%%m-%%dT%%H:%%M:%%SZ'"') do (set timeStamp=%%x)

set benchViewName=SDK perf %OS% %architecture% %configuration% %runType% %GIT_BRANCH_WITHOUT_ORIGIN%
set benchViewName=SDK perf %OS% %architecture% %configuration% TestFullMSBuild-%TestFullMSBuild% %runType% %GIT_BRANCH_WITHOUT_ORIGIN%
if /I "%runType%" == "private" (set benchViewName=%benchViewName% %BenchviewCommitName%)
if /I "%runType%" == "rolling" (set benchViewName=%benchViewName% %GIT_COMMIT%)
echo BenchViewName: "%benchViewName%"
Expand Down Expand Up @@ -77,6 +80,7 @@ echo Creating: "%perfWorkingDirectory%\submission.json"
--type "%runType%" ^
--config-name "%configuration%" ^
--config Configuration "%configuration%" ^
--config TestFullMSBuild "%TestFullMSBuild%" ^
--config OS "%OS%" ^
--architecture "%architecture%" ^
--machinepool "perfsnake" ^
Expand Down
44 changes: 42 additions & 2 deletions eng/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,16 @@ jobs:
env:
BuildConfig: $(_BuildConfig)

- ${{ if eq(parameters.agentOs, 'Windows_Perf_CI_FullFramework') }}:
- script: build.cmd
-configuration $(_BuildConfig)
-ci
-performanceTest
displayName: Build
env:
BuildConfig: $(_BuildConfig)
TestFullMSBuild: 'true'

- ${{ if eq(parameters.agentOs, 'Linux_Perf_CI') }}:
- script: ./build.sh
--configuration $(_BuildConfig)
Expand All @@ -122,8 +132,38 @@ jobs:

WorkItemTimeout: 2:00
WorkItemDirectory: '$(Build.SourcesDirectory)\build'
WorkItemCommand: '%HELIX_CORRELATION_PAYLOAD%\build\RunPerfTestsOnHelix.cmd $(_BuildConfig) $(_PerfIterations) $(Build.SourceVersion) $(Build.SourceBranchName) rolling'
WorkItemCommand: '%HELIX_CORRELATION_PAYLOAD%\build\RunPerfTestsOnHelix.cmd $(_BuildConfig) $(_PerfIterations) $(Build.SourceVersion) $(Build.SourceBranchName) rolling false'
CorrelationPayloadDirectory: '$(Build.SourcesDirectory)\helix-package'
HelixConfiguration: 'CoreMSBuild'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.SourcesDirectory)\artifacts\log
artifactName: logs

- ${{ if eq(parameters.agentOs, 'Windows_Perf_Helix_Fullframework') }}:
- checkout: self
clean: true
- script: $(Build.SourcesDirectory)\build.cmd -configuration $(_BuildConfig) -ci
displayName: Pre-Build
- script: (robocopy $(Build.SourcesDirectory) $(Build.SourcesDirectory)\helix-package /NP /E /XD $(Build.SourcesDirectory)\helix-package $(Build.SourcesDirectory)\.dotnet $(Build.SourcesDirectory)\artifacts\bin\Tests $(Build.SourcesDirectory)\artifacts\obj\$(_BuildConfig)\Sdks\Microsoft.NET.Build.Extensions $(Build.SourcesDirectory)\artifacts\bin\$(_BuildConfig)\Sdks\Microsoft.NET.Build.Extensions) ^& IF %ERRORLEVEL% LEQ 1 exit 0
displayName: Selection of sources
- template: /eng/common/templates/steps/send-to-helix.yml
parameters:
HelixSource: 'pr/dotnet/sdk/$(Build.SourceBranch)'
HelixType: 'test/sdk_$(_BuildConfig)/'
HelixAccessToken: $(HelixApiAccessToken)
HelixTargetQueues: 'Windows.10.Amd64.ClientRS1.Perf' # using a dedicated private Helix queue (perfsnakes)
HelixPreCommands: 'set "BV_UPLOAD_SAS_TOKEN=$(BenchViewUploadToken)"'

WorkItemTimeout: 2:00
WorkItemDirectory: '$(Build.SourcesDirectory)\build'
WorkItemCommand: '%HELIX_CORRELATION_PAYLOAD%\build\RunPerfTestsOnHelix.cmd $(_BuildConfig) $(_PerfIterations) $(Build.SourceVersion) $(Build.SourceBranchName) rolling true'
CorrelationPayloadDirectory: '$(Build.SourcesDirectory)\helix-package'
HelixConfiguration: 'FullMSBuild'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.SourcesDirectory)\artifacts\log
artifactName: logs

- ${{ if eq(parameters.agentOs, 'Linux_Perf_Helix') }}:
- checkout: self
Expand All @@ -140,7 +180,7 @@ jobs:
WorkItemDirectory: '$(Build.SourcesDirectory)'
WorkItemCommand: './build/RunPerfTestsOnHelix.sh $(_BuildConfig) $(_PerfIterations) $(Build.SourceVersion) $(Build.SourceBranchName) rolling x64 Ubuntu_16.04'

- ${{ if notIn(parameters.agentOs, 'Windows_NT', 'Windows_NT_FullFramework', 'Windows_NT_TestAsTools', 'Windows_Perf_CI', 'Linux_Perf_CI', 'Windows_Perf_Helix', 'Linux_Perf_Helix') }}:
- ${{ if notIn(parameters.agentOs, 'Windows_NT', 'Windows_NT_FullFramework', 'Windows_NT_TestAsTools', 'Windows_Perf_CI', 'Linux_Perf_CI', 'Windows_Perf_Helix', 'Windows_Perf_CI_FullFramework', 'Windows_Perf_Helix_Fullframework', 'Linux_Perf_Helix') }}:
- script: eng/common/cibuild.sh
--configuration $(_BuildConfig)
$(_PublishArgs)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsHelloWorldFullFramework
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsHelloWorldFullFramework
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("WindowsFormsHelloWorldFullFramework")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WindowsFormsHelloWorldFullFramework")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("6ecd7363-c3d0-4bd4-a9d2-85e46f2e9103")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 71e56e0

Please sign in to comment.