From 65882a374d7a3d1b6b5e63d952dbb0be10e66ea9 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Fri, 8 Mar 2019 10:03:51 -0800 Subject: [PATCH] Revert "Helix proof of concept for unit tests (#224)" This reverts commit 86bbead76b5925a71ed1434836ec51dc71667951. --- eng/Version.Details.xml | 4 -- eng/Versions.props | 12 +---- eng/ci-helix-test.yml | 30 ----------- eng/ci.yml | 53 ++++++++----------- eng/common/templates/steps/send-to-helix.yml | 53 +++++++++---------- global.json | 3 +- .../InternalUtilitiesForTests.csproj | 2 +- ....Windows.Forms.Design.Editors.Tests.csproj | 4 +- .../System.Windows.Forms.Design.Tests.csproj | 5 -- ...stem.Windows.Forms.IntegrationTests.csproj | 1 - .../TestHelpers.cs | 10 ++-- 11 files changed, 59 insertions(+), 118 deletions(-) delete mode 100644 eng/ci-helix-test.yml diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 442be192bad..8576e5163c9 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -57,9 +57,5 @@ Note: if the Uri is a new place, you will need to add a subscription from that p https://github.com/dotnet/arcade 1d2edb248bc2dc37fa0669053b0c88f3bffffb26 - - https://github.com/dotnet/arcade - b94a591377451bda3ac80e597d7faff03a06c29e - diff --git a/eng/Versions.props b/eng/Versions.props index f52256927f2..25b6901f121 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -24,18 +24,10 @@ 1.0.0-beta.19156.20 2.4.0-beta.19156.20 - - - 2.4.1-pre.build.4059 - $(XUnitVersion) - $(XUnitVersion) - $(XUnitVersion) - $(XUnitVersion) - 0.3.5 - - + 4.6.0-alpha-27122-5 + 0.3.5 4.10.0 1.0.0 diff --git a/eng/ci-helix-test.yml b/eng/ci-helix-test.yml deleted file mode 100644 index 301d83cdaab..00000000000 --- a/eng/ci-helix-test.yml +++ /dev/null @@ -1,30 +0,0 @@ -parameters: - # All parameters are required for our purposes (except HelixType); see send-to-helix.yml for details - RepoName: '' - HelixType: 'tests/default' - HelixTargetQueues: '' - HelixAccessToken: '' - XUnitProjects: '' - DisplayNamePrefix: '' - -steps: -- template: /eng/common/templates/steps/send-to-helix.yml - parameters: - HelixSource: ${{ parameters.RepoName }} - HelixType: ${{ parameters.HelixType }} - HelixBuild: $(Build.BuildNumber) - HelixTargetQueues: ${{ parameters.HelixTargetQueues }} - HelixAccessToken: ${{ parameters.HelixAccessToken }} # only defined for internal CI - Creator: ${{ parameters.RepoName }} # required for public / external (when there is no access token) - XUnitProjects: ${{ parameters.XUnitProjects }} - XUnitPublishTargetFramework: netcoreapp3.0 # Whatever tfm will work for our test projects for `dotnet publish` - XUnitRuntimeTargetFramework: netcoreapp2.0 # Whatever tfm to pick from the xunit package, it must exist in that package or the helix job will fail - XUnitRunnerVersion: '2.4.1' # Should match XUnitRunnerConsoleVersion in eng/Versions.props - IncludeDotNetCli: true - DotNetCliPackageType: 'sdk' - DotNetCliVersion: '3.0.100-preview-010184' # MUST be official release: https://dotnet.microsoft.com/download/dotnet-core/3.0 ; does not need to match sdk we build against - EnableXUnitReporter: true - WaitForWorkItemCompletion: true - DisplayNamePrefix: ${{ parameters.DisplayNamePrefix }} - condition: succeeded() - continueOnError: false \ No newline at end of file diff --git a/eng/ci.yml b/eng/ci.yml index 5d9a4eb6736..f6516209841 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -1,8 +1,10 @@ parameters: - # This section is required because agent pool can't be read from a user-defined variable (Azure DevOps limitation) - agentPool: dotnet-external-temp-vs2019 - runAsPublic: true - repoName: dotnet/winforms + + # Needed because agent pool can't be read from a user-defined variable (Azure DevOps limitation) + agentPool: dotnet-external-temp-vs2019 + + # Needed because runAsPublic is used in template expressions, which can't read from user-defined variables + runAsPublic: true jobs: - template: /eng/common/templates/jobs/jobs.yml @@ -13,7 +15,7 @@ jobs: enablePublishTestResults: true enablePublishBuildAssets: true enableTelemetry: true - helixRepo: $(repoName) + helixRepo: dotnet/winforms jobs: - job: Windows_NT @@ -42,7 +44,7 @@ jobs: value: '' # needed for helix jobs - - name: _UnitTestHelixAgentPool + - name: _HelixAgentPool value: 'Windows.10.Amd64.Open' - name: _WinformsControlsTestBinDir value: $(BUILD.SOURCESDIRECTORY)\artifacts\bin\WinformsControlsTest\$(_BuildConfig)\netcoreapp3.0 @@ -50,11 +52,8 @@ jobs: value: $(BUILD.SOURCESDIRECTORY)\artifacts\bin\System.Windows.Forms.Func.Tests\$(_BuildConfig)\netcoreapp3.0 - name: _HelixStagingDir value: $(BUILD.STAGINGDIRECTORY)\helix\functests - - name: _HelixToken - value: '' - - # Override some values if we're building internally (not public) + # Override some values if we're building internally - ${{ if eq(parameters.runAsPublic, 'false') }}: # note: You have to use list syntax here (-name: value) or you will get errors about declaring the same variable multiple times @@ -69,8 +68,9 @@ jobs: - name: _PublishBlobFeedUrl value: https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json - # note: Even though they are referenced here, user defined variables (like $(_SignType)) are not resolved until the agent - # is running on the machine. They can be overridden any time before they are resolved, like in the job matrix below (see Build_Debug) + # note: Even though they are referenced here, user defined variables (like $(_SignType)) are not resolved + # until the agent is running on the machine. They can be overridden any time before they are resolved, + # like in the job matrix below (see Build_Debug) - name: _SignArgs value: /p:DotNetSignType=$(_SignType) /p:TeamName=$(_TeamName) /p:Sign=$(_Sign) - name: _PublishArgs @@ -82,11 +82,8 @@ jobs: - name: _OfficialBuildIdArgs value: /p:OfficialBuildId=$(BUILD.BUILDNUMBER) - # Windows.81.Amd64 will fail on Debug.Assert in TryGetSystemMetricsForDpi in UnsafeNativeMethods - - name: _UnitTestHelixAgentPool + - name: _HelixAgentPool value: 'Windows.10.Amd64' - - name: _HelixToken - value: '$(helix-token)' strategy: matrix: @@ -112,21 +109,15 @@ jobs: /bl:$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\Build.binlog displayName: Build - # Run unit tests on Helix - - template: /eng/ci-helix-test.yml - parameters: - RepoName: ${{ parameters.repoName }} - HelixType: 'tests/unit' - HelixTargetQueues: $(_UnitTestHelixAgentPool) - HelixAccessToken: $(_HelixToken) # only defined for internal CI - # Should be $(BUILD.SOURCESDIRECTOR)System.Windows.Forms/src/**/*.Tests.csproj, but cannot until https://github.com/dotnet/arcade/issues/2156 is fixed - XUnitProjects: '$(BUILD.SOURCESDIRECTORY)\src\System.Windows.Forms\tests\UnitTests\System.Windows.Forms.Tests.csproj;$(BUILD.SOURCESDIRECTORY)\src\System.Windows.Forms.Design\tests\UnitTests\System.Windows.Forms.Design.Tests.csproj;$(BUILD.SOURCESDIRECTORY)\src\System.Windows.Forms.Design.Editors\tests\UnitTests\System.Windows.Forms.Design.Editors.Tests.csproj' - DisplayNamePrefix: 'Send Unit Tests (Windows.10) to Helix' - + # Run unit tests and rename binlog + - script: eng\cibuild.cmd + -configuration $(_BuildConfig) + $(_OfficialBuildIdArgs) + -test + /bl:$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\Test.binlog + displayName: Run Unit Tests + # Run integration tests and rename binlog - # These are not ready to run on Helix because: - # 1. Helix doesn't build projects (it only uses publish); we need .dotnet and also bin from build - # 2. we need an interactive pool for SendKeys to work - script: eng\cibuild.cmd -configuration $(_BuildConfig) $(_OfficialBuildIdArgs) @@ -159,4 +150,4 @@ jobs: # Run component governance detection (only for release; only for internal) - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 displayName: Component Governance Detection - condition: and(succeeded(), eq(variables['_BuildConfig'], 'Release')) + condition: and(succeeded(), eq(variables['_BuildConfig'], 'Release')) \ No newline at end of file diff --git a/eng/common/templates/steps/send-to-helix.yml b/eng/common/templates/steps/send-to-helix.yml index 992c2106632..3a449210f5b 100644 --- a/eng/common/templates/steps/send-to-helix.yml +++ b/eng/common/templates/steps/send-to-helix.yml @@ -1,33 +1,32 @@ parameters: - HelixSource: 'pr/default' # required -- sources must start with pr/, official/, prodcon/, or agent/ - HelixType: 'tests/default/' # required -- Helix telemetry which identifies what type of data this is; should include "test" for clarity and must end in '/' - HelixBuild: $(Build.BuildNumber) # required -- the build number Helix will use to identify this -- automatically set to the AzDO build number - HelixTargetQueues: '' # required -- semicolon delimited list of Helix queues to test on; see https://helix.dot.net/api/2018-03-14/info/queues for a list of queues - HelixAccessToken: '' # required -- access token to make Helix API requests; should be provided by the appropriate variable group - HelixPreCommands: '' # optional -- commands to run before Helix work item execution - HelixPostCommands: '' # optional -- commands to run after Helix work item execution - WorkItemDirectory: '' # optional -- a payload directory to zip up and send to Helix; requires WorkItemCommand; incompatible with XUnitProjects - WorkItemCommand: '' # optional -- a command to execute on the payload; requires WorkItemDirectory; incompatible with XUnitProjects - WorkItemTimeout: '' # optional -- a timeout in seconds for the work item command; requires WorkItemDirectory; incompatible with XUnitProjects - CorrelationPayloadDirectory: '' # optional -- a directory to zip up and send to Helix as a correlation payload - XUnitProjects: '' # optional -- semicolon delimited list of XUnitProjects to parse and send to Helix; requires XUnitRuntimeTargetFramework, XUnitPublishTargetFramework, XUnitRunnerVersion, and IncludeDotNetCli=true - XUnitPublishTargetFramework: '' # optional -- framework to use to publish your xUnit projects - XUnitRuntimeTargetFramework: '' # optional -- framework to use for the xUnit console runner - XUnitRunnerVersion: '' # optional -- version of the xUnit nuget package you wish to use on Helix; required for XUnitProjects - IncludeDotNetCli: false # optional -- true will download a version of the .NET CLI onto the Helix machine as a correlation payload; requires DotNetCliPackageType and DotNetCliVersion - DotNetCliPackageType: '' # optional -- either 'sdk' or 'runtime'; determines whether the sdk or runtime will be sent to Helix; see https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json - DotNetCliVersion: '' # optional -- version of the CLI to send to Helix; based on this: https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json - EnableXUnitReporter: false # optional -- true enables XUnit result reporting to Mission Control - WaitForWorkItemCompletion: true # optional -- true will make the task wait until work items have been completed and fail the build if work items fail. False is "fire and forget." - IsExternal: false # [DEPRECATED] -- doesn't do anything, jobs are external if HelixAccessToken is empty and Creator is set - Creator: '' # optional -- if the build is external, use this to specify who is sending the job - DisplayNamePrefix: 'Send job to Helix' # optional -- rename the beginning of the displayName of the steps in AzDO - condition: succeeded() # optional -- condition for step to execute; defaults to succeeded() - continueOnError: false # optional -- determines whether to continue the build if the step errors; defaults to false + HelixSource: 'pr/default' # required -- sources must start with pr/, official/, prodcon/, or agent/ + HelixType: 'tests/default/' # required -- Helix telemetry which identifies what type of data this is; should include "test" for clarity and must end in '/' + HelixBuild: $(Build.BuildNumber) # required -- the build number Helix will use to identify this -- automatically set to the AzDO build number + HelixTargetQueues: '' # required -- semicolon delimited list of Helix queues to test on; see https://helix.dot.net/api/2018-03-14/info/queues for a list of queues + HelixAccessToken: '' # required -- access token to make Helix API requests; should be provided by the appropriate variable group + HelixPreCommands: '' # optional -- commands to run before Helix work item execution + HelixPostCommands: '' # optional -- commands to run after Helix work item execution + WorkItemDirectory: '' # optional -- a payload directory to zip up and send to Helix; requires WorkItemCommand; incompatible with XUnitProjects + WorkItemCommand: '' # optional -- a command to execute on the payload; requires WorkItemDirectory; incompatible with XUnitProjects + WorkItemTimeout: '' # optional -- a timeout in seconds for the work item command; requires WorkItemDirectory; incompatible with XUnitProjects + CorrelationPayloadDirectory: '' # optional -- a directory to zip up and send to Helix as a correlation payload + XUnitProjects: '' # optional -- semicolon delimited list of XUnitProjects to parse and send to Helix; requires XUnitRuntimeTargetFramework, XUnitPublishTargetFramework, XUnitRunnerVersion, and IncludeDotNetCli=true + XUnitPublishTargetFramework: '' # optional -- framework to use to publish your xUnit projects + XUnitRuntimeTargetFramework: '' # optional -- framework to use for the xUnit console runner + XUnitRunnerVersion: '' # optional -- version of the xUnit nuget package you wish to use on Helix; required for XUnitProjects + IncludeDotNetCli: false # optional -- true will download a version of the .NET CLI onto the Helix machine as a correlation payload; requires DotNetCliPackageType and DotNetCliVersion + DotNetCliPackageType: '' # optional -- either 'sdk' or 'runtime'; determines whether the sdk or runtime will be sent to Helix; see https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json + DotNetCliVersion: '' # optional -- version of the CLI to send to Helix; based on this: https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json + EnableXUnitReporter: false # optional -- true enables XUnit result reporting to Mission Control + WaitForWorkItemCompletion: true # optional -- true will make the task wait until work items have been completed and fail the build if work items fail. False is "fire and forget." + IsExternal: false # [DEPRECATED] -- doesn't do anything, jobs are external if HelixAccessToken is empty and Creator is set + Creator: '' # optional -- if the build is external, use this to specify who is sending the job + condition: succeeded() # optional -- condition for step to execute; defaults to succeeded() + continueOnError: false # optional -- determines whether to continue the build if the step errors; defaults to false steps: - powershell: 'powershell "$env:BUILD_SOURCESDIRECTORY\eng\common\msbuild.ps1 $env:BUILD_SOURCESDIRECTORY\eng\common\helixpublish.proj /restore /t:Test /bl:$env:BUILD_SOURCESDIRECTORY\artifacts\log\$env:BuildConfig\SendToHelix.binlog"' - displayName: ${{ parameters.DisplayNamePrefix }} (Windows) + displayName: Send job to Helix (Windows) env: BuildConfig: $(_BuildConfig) HelixSource: ${{ parameters.HelixSource }} @@ -55,7 +54,7 @@ steps: condition: and(${{ parameters.condition }}, eq(variables['Agent.Os'], 'Windows_NT')) continueOnError: ${{ parameters.continueOnError }} - script: $BUILD_SOURCESDIRECTORY/eng/common/msbuild.sh $BUILD_SOURCESDIRECTORY/eng/common/helixpublish.proj /restore /t:Test /bl:$BUILD_SOURCESDIRECTORY/artifacts/log/$BuildConfig/SendToHelix.binlog - displayName: ${{ parameters.DisplayNamePrefix }} (Unix) + displayName: Send job to Helix (Unix) env: BuildConfig: $(_BuildConfig) HelixSource: ${{ parameters.HelixSource }} diff --git a/global.json b/global.json index 215e023215b..4222df4c5d6 100644 --- a/global.json +++ b/global.json @@ -9,7 +9,6 @@ "version": "3.0.100-preview-010024" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19156.20", - "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19156.20" + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19156.20" } } diff --git a/src/Common/tests/InternalUtilitiesForTests/InternalUtilitiesForTests.csproj b/src/Common/tests/InternalUtilitiesForTests/InternalUtilitiesForTests.csproj index f9ca6024255..8bfcd13b8bf 100644 --- a/src/Common/tests/InternalUtilitiesForTests/InternalUtilitiesForTests.csproj +++ b/src/Common/tests/InternalUtilitiesForTests/InternalUtilitiesForTests.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/System.Windows.Forms.Design.Editors/tests/UnitTests/System.Windows.Forms.Design.Editors.Tests.csproj b/src/System.Windows.Forms.Design.Editors/tests/UnitTests/System.Windows.Forms.Design.Editors.Tests.csproj index cfc914f9f80..0a3cde733cc 100644 --- a/src/System.Windows.Forms.Design.Editors/tests/UnitTests/System.Windows.Forms.Design.Editors.Tests.csproj +++ b/src/System.Windows.Forms.Design.Editors/tests/UnitTests/System.Windows.Forms.Design.Editors.Tests.csproj @@ -5,8 +5,8 @@ System.Windows.Forms.Design.Editors.Tests - - + + diff --git a/src/System.Windows.Forms.Design/tests/UnitTests/System.Windows.Forms.Design.Tests.csproj b/src/System.Windows.Forms.Design/tests/UnitTests/System.Windows.Forms.Design.Tests.csproj index 72fa43c115d..c7a9241902a 100644 --- a/src/System.Windows.Forms.Design/tests/UnitTests/System.Windows.Forms.Design.Tests.csproj +++ b/src/System.Windows.Forms.Design/tests/UnitTests/System.Windows.Forms.Design.Tests.csproj @@ -6,11 +6,6 @@ 7.3 - - - - - diff --git a/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/System.Windows.Forms.IntegrationTests.csproj b/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/System.Windows.Forms.IntegrationTests.csproj index 0a96110b08c..66a0132e833 100644 --- a/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/System.Windows.Forms.IntegrationTests.csproj +++ b/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/System.Windows.Forms.IntegrationTests.csproj @@ -13,7 +13,6 @@ - diff --git a/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/TestHelpers.cs b/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/TestHelpers.cs index d60f58dc7f7..efa922880ae 100644 --- a/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/TestHelpers.cs +++ b/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/TestHelpers.cs @@ -34,15 +34,15 @@ public static Process StartProcess(string byPathFromBinToExe) throw new ArgumentException(nameof(byPathFromBinToExe) + " must end in a .exe"); } - var dotnetPath = DotNetPath(); - if (!Directory.Exists(dotnetPath)) - { - throw new DirectoryNotFoundException(dotnetPath + " directory cannot be found."); + var dotnetPath = DotNetPath(); + if (!Directory.Exists(dotnetPath)) + { + throw new DirectoryNotFoundException(dotnetPath + " directory cannot be found."); } ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = Path.Combine(BinPath(), byPathFromBinToExe.Trim('\\')); - startInfo.EnvironmentVariables["DOTNET_ROOT"] = dotnetPath; // required + startInfo.EnvironmentVariables["DOTNET_ROOT"] = dotnetPath; // ... return StartProcess(startInfo);