Skip to content

Commit

Permalink
Redo #224 which failed internal build (#547)
Browse files Browse the repository at this point in the history
* add creator, set to empty in internal, comment edits

* helix token is secret AzDO pipeline variable

* add xunit assert version

* helix access token

* helix source, differ from internal to public
  • Loading branch information
zsd4yr authored Mar 11, 2019
1 parent 5f065a7 commit 1779e07
Show file tree
Hide file tree
Showing 13 changed files with 152 additions and 74 deletions.
16 changes: 10 additions & 6 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,21 @@ Note: if the Uri is a new place, you will need to add a subscription from that p
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>8a730a6ecd96fef04d74e1807c8b1d193e0a5f16</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19156.20">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19158.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>1d2edb248bc2dc37fa0669053b0c88f3bffffb26</Sha>
<Sha>b9f7cb3de92127532bd57619972ebbebc3fe685b</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.GenFacades" Version="1.0.0-beta.19156.20">
<Dependency Name="Microsoft.DotNet.GenFacades" Version="1.0.0-beta.19158.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>1d2edb248bc2dc37fa0669053b0c88f3bffffb26</Sha>
<Sha>b9f7cb3de92127532bd57619972ebbebc3fe685b</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XUnitExtensions" Version="2.4.0-beta.19156.20">
<Dependency Name="Microsoft.DotNet.XUnitExtensions" Version="2.4.0-beta.19158.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>1d2edb248bc2dc37fa0669053b0c88f3bffffb26</Sha>
<Sha>b9f7cb3de92127532bd57619972ebbebc3fe685b</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="2.0.0-beta.19158.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>b9f7cb3de92127532bd57619972ebbebc3fe685b</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
16 changes: 12 additions & 4 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,21 @@
</PropertyGroup>
<!-- Arcade-updated dependencies -->
<PropertyGroup>
<MicrosoftDotNetGenFacadesPackageVersion>1.0.0-beta.19156.20</MicrosoftDotNetGenFacadesPackageVersion>
<MicrosoftDotNetXUnitExtensionsPackageVersion>2.4.0-beta.19156.20</MicrosoftDotNetXUnitExtensionsPackageVersion>
<MicrosoftDotNetGenFacadesPackageVersion>1.0.0-beta.19158.2</MicrosoftDotNetGenFacadesPackageVersion>
<MicrosoftDotNetXUnitExtensionsPackageVersion>2.4.0-beta.19158.2</MicrosoftDotNetXUnitExtensionsPackageVersion>
</PropertyGroup>
<!-- Additional dependencies -->
<!-- XUnit-related unchanging dependencies -->
<PropertyGroup>
<AccessibilityPackageVersion>4.6.0-alpha-27122-5</AccessibilityPackageVersion>
<XUnitVersion>2.4.1-pre.build.4059</XUnitVersion>
<XUnitAssertVersion>$(XUnitVersion)</XUnitAssertVersion>
<XUnitRunnerConsoleVersion>$(XUnitVersion)</XUnitRunnerConsoleVersion>
<XUnitRunnerVisualStudioVersion>$(XUnitVersion)</XUnitRunnerVisualStudioVersion>
<XUnitExtensibilityExecutionVersion>$(XUnitVersion)</XUnitExtensibilityExecutionVersion>
<XUnitStaFactPackageVersion>0.3.5</XUnitStaFactPackageVersion>
</PropertyGroup>
<!-- Additional unchanging dependencies -->
<PropertyGroup>
<AccessibilityPackageVersion>4.6.0-alpha-27122-5</AccessibilityPackageVersion>
<MoqPackageVersion>4.10.0</MoqPackageVersion>
<MicrosoftTargetingPackNETFrameworkv472PackageVersion>1.0.0</MicrosoftTargetingPackNETFrameworkv472PackageVersion>
</PropertyGroup>
Expand Down
31 changes: 31 additions & 0 deletions eng/ci-helix-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
parameters:
# All parameters are required for our purposes (except HelixType); see send-to-helix.yml for details
HelixSource: ''
HelixType: 'tests/default'
HelixTargetQueues: ''
HelixAccessToken: ''
Creator: ''
XUnitProjects: ''
DisplayNamePrefix: ''

steps:
- template: /eng/common/templates/steps/send-to-helix.yml
parameters:
HelixSource: ${{ parameters.HelixSource }}
HelixType: ${{ parameters.HelixType }}
HelixBuild: $(Build.BuildNumber)
HelixTargetQueues: ${{ parameters.HelixTargetQueues }}
HelixAccessToken: ${{ parameters.HelixAccessToken }} # only defined for internal CI
Creator: ${{ parameters.Creator }} # 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
69 changes: 46 additions & 23 deletions eng/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
parameters:

# 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
# 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

jobs:
- template: /eng/common/templates/jobs/jobs.yml
Expand All @@ -15,7 +14,7 @@ jobs:
enablePublishTestResults: true
enablePublishBuildAssets: true
enableTelemetry: true
helixRepo: dotnet/winforms
helixRepo: $(repoName)

jobs:
- job: Windows_NT
Expand Down Expand Up @@ -44,19 +43,27 @@ jobs:
value: ''

# needed for helix jobs
- name: _HelixAgentPool
- name: _UnitTestHelixAgentPool
value: 'Windows.10.Amd64.Open'
- name: _WinformsControlsTestBinDir
value: $(BUILD.SOURCESDIRECTORY)\artifacts\bin\WinformsControlsTest\$(_BuildConfig)\netcoreapp3.0
- name: _WinformsFuncTestBinDir
value: $(BUILD.SOURCESDIRECTORY)\artifacts\bin\System.Windows.Forms.Func.Tests\$(_BuildConfig)\netcoreapp3.0
- name: _HelixStagingDir
value: $(BUILD.STAGINGDIRECTORY)\helix\functests
- name: _HelixSource
value: ${{ parameters.repoName }}/$(Build.SourceBranch)
- name: _HelixToken
value: ''
- name: _HelixCreator
value: ${{ parameters.repoName }}

# Override some values if we're building internally

# Override some values if we're building internally (not public)
- ${{ 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
# note: You have to use list syntax here (-name: value) or
# you will get errors about declaring the same variable multiple times
- name: _PublishType
value: blob
- name: _SignType
Expand All @@ -65,12 +72,14 @@ jobs:
value: true
- group: DotNet-Blob-Feed
- group: DotNet-Symbol-Server-Pats
# DotNet-HelixApi-Access provides: HelixApiAccessToken
- group: DotNet-HelixApi-Access
- 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
Expand All @@ -82,8 +91,15 @@ jobs:
- name: _OfficialBuildIdArgs
value: /p:OfficialBuildId=$(BUILD.BUILDNUMBER)

- name: _HelixAgentPool
# Windows.81.Amd64 will fail on Debug.Assert in TryGetSystemMetricsForDpi in UnsafeNativeMethods
- name: _UnitTestHelixAgentPool
value: 'Windows.10.Amd64'
- name: _HelixSource
value: official/${{ parameters.repoName }}/$(Build.SourceBranch)
- name: _HelixToken
value: '$(HelixApiAccessToken)' # from DotNet-HelixApi-Access group
- name: _HelixCreator
value: '' #if _HelixToken is set, Creator must be empty

strategy:
matrix:
Expand All @@ -109,15 +125,22 @@ jobs:
/bl:$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\Build.binlog
displayName: Build

# 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 unit tests on Helix
- template: /eng/ci-helix-test.yml
parameters:
HelixSource: $(_HelixSource)
HelixType: 'tests/unit'
HelixTargetQueues: $(_UnitTestHelixAgentPool)
HelixAccessToken: $(_HelixToken) # only defined for internal CI
Creator: $(_HelixCreator)
# 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 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)
Expand Down Expand Up @@ -150,4 +173,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'))
9 changes: 6 additions & 3 deletions eng/common/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,16 @@ while [[ $# > 0 ]]; do
node_reuse=$2
shift
;;
/p:*)
-p:*|/p:*)
properties="$properties $1"
;;
/m:*)
-m:*|/m:*)
properties="$properties $1"
;;
/bl:*)
-bl:*|/bl:*)
properties="$properties $1"
;;
-dl:*|/dl:*)
properties="$properties $1"
;;
*)
Expand Down
4 changes: 2 additions & 2 deletions eng/common/templates/job/job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ jobs:
continueOnError: true
condition: always()

- ${{ if and(eq(parameters.enablePublishBuildAssets, true), eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- ${{ if and(eq(parameters.enablePublishBuildAssets, true), ne(variables['_PublishUsingPipelines'], 'true'), eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- task: CopyFiles@2
displayName: Gather Asset Manifests
inputs:
Expand All @@ -194,4 +194,4 @@ jobs:
PublishLocation: Container
ArtifactName: AssetManifests
continueOnError: ${{ parameters.continueOnError }}
condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true'))
condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true'))
Loading

0 comments on commit 1779e07

Please sign in to comment.