From 7310001c01c1f414dea24f858902af8cc6ef4722 Mon Sep 17 00:00:00 2001 From: Mike McLaughlin Date: Tue, 24 Mar 2020 17:51:54 -0700 Subject: [PATCH] Support testing internal service releases (#926) Support testing internal service releases Adds 3 pipeline variables that need to be set testing an internal service release: InternalRuntimeSourceVersion - the service release version i.e. 2.1.17, 3.1.3, etc. InternalRuntimeSourceFeed - the service release internal feed InternalRuntimeSourceFeedKey - the service release feed PAT No longer runs the tests on desktop framework if private build or internal service release. Remove dailytest option --- diagnostics.yml | 3 +- eng/InstallRuntimes.proj | 81 ++++++++++++++----- eng/build.ps1 | 27 +++++-- eng/build.sh | 59 +++++++++++--- eng/build.yml | 13 +++ .../Unix/Debugger.Tests.Config.txt | 43 +++++----- .../Windows/Debugger.Tests.Config.txt | 54 ++++++++----- 7 files changed, 201 insertions(+), 79 deletions(-) diff --git a/diagnostics.yml b/diagnostics.yml index 8fe76a879..34c0cd89e 100644 --- a/diagnostics.yml +++ b/diagnostics.yml @@ -17,7 +17,6 @@ variables: value: DotNetCore - name: _InternalBuildArgs value: '' - - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - name: _SignType value: real @@ -26,7 +25,7 @@ variables: - name: _InternalBuildArgs value: /p:DotNetSignType=$(_SignType) /p:TeamName=$(_TeamName) - /p:DotNetPublishUsingPipelines=$(PublishPackages) + /p:DotNetPublishUsingPipelines=true /p:OfficialBuildId=$(BUILD.BUILDNUMBER) stages: diff --git a/eng/InstallRuntimes.proj b/eng/InstallRuntimes.proj index 4b4b6255f..20e687a73 100644 --- a/eng/InstallRuntimes.proj +++ b/eng/InstallRuntimes.proj @@ -2,8 +2,14 @@ - false $(Platform) x64 + false + true + false + true + -runtimesourcefeed '$(RuntimeSourceFeed)' -runtimesourcefeedkey '$(RuntimeSourceFeedKey)' @@ -58,12 +68,24 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - diff --git a/eng/build.ps1 b/eng/build.ps1 index 820720139..6d3769d8f 100644 --- a/eng/build.ps1 +++ b/eng/build.ps1 @@ -7,9 +7,12 @@ Param( [switch] $ci, [switch] $skipmanaged, [switch] $skipnative, - [switch] $dailytest, [string] $privatebuildpath = "", [switch] $cleanupprivatebuild, + [ValidatePattern("(default|\d+\.\d+.\d+(-[a-z0-9\.]+)?)")][string] $dotnetruntimeversion = 'default', + [ValidatePattern("(default|\d+\.\d+.\d+(-[a-z0-9\.]+)?)")][string] $dotnetruntimedownloadversion= 'default', + [string] $runtimesourcefeed = '', + [string] $runtimesourcefeedkey = '', [Parameter(ValueFromRemainingArguments=$true)][String[]] $remainingargs ) @@ -47,16 +50,11 @@ $engroot = Join-Path $reporoot "eng" $artifactsdir = Join-Path $reporoot "artifacts" $logdir = Join-Path $artifactsdir "log" $logdir = Join-Path $logdir Windows_NT.$architecture.$configuration -$dailytestproperty = "false" if ($ci) { $remainingargs = "-ci " + $remainingargs } -if ($dailytest -or $privatebuildpath -ne "") { - $dailytestproperty = "true" -} - # Remove the private build registry keys if ($cleanupprivatebuild) { Invoke-Expression "& `"$engroot\common\msbuild.ps1`" $engroot\CleanupPrivateBuild.csproj /v:$verbosity /t:CleanupPrivateBuild /p:BuildArch=$architecture /p:TestArchitectures=$architecture" @@ -80,9 +78,22 @@ if (-not $skipnative) { } # Run the xunit tests -if ($test -or $dailytest) { +if ($test) { if (-not $crossbuild) { - & "$engroot\common\build.ps1" -test -configuration $configuration -verbosity $verbosity -ci:$ci /bl:$logdir\Test.binlog /p:BuildArch=$architecture /p:TestArchitectures=$architecture /p:DailyTest=$dailytestproperty /p:PrivateBuildPath=$privatebuildpath + & "$engroot\common\build.ps1" ` + -test ` + -configuration $configuration ` + -verbosity $verbosity ` + -ci:$ci ` + /bl:$logdir\Test.binlog ` + /p:BuildArch=$architecture ` + /p:TestArchitectures=$architecture ` + /p:PrivateBuildPath="$privatebuildpath" ` + /p:DotnetRuntimeVersion="$dotnetruntimeversion" ` + /p:DotnetRuntimeDownloadVersion="$dotnetruntimedownloadversion" ` + /p:RuntimeSourceFeed="$runtimesourcefeed" ` + /p:RuntimeSourceFeedKey="$runtimesourcefeedkey" + if ($lastExitCode -ne 0) { exit $lastExitCode } diff --git a/eng/build.sh b/eng/build.sh index bf621c979..da7042e18 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -29,13 +29,16 @@ __ManagedBuild=true __NativeBuild=true __CrossBuild=false __Test=false -__DailyTest=false __PrivateBuildPath="" __CI=false __Verbosity=minimal __ManagedBuildArgs= __TestArgs= __UnprocessedBuildArgs= +__DotnetRuntimeVersion='default' +__DotnetRuntimeDownloadVersion='default' +__RuntimeSourceFeed='' +__RuntimeSourceFeedKey='' usage() { @@ -43,7 +46,6 @@ usage() echo "--skipmanaged- Skip building managed components" echo "--skipnative - Skip building native components" echo "--test - run xunit tests" - echo "--dailytest - test components for daily build job" echo "--privatebuildpath - path to local private runtime build to test" echo "--architecture " echo "--configuration " @@ -175,13 +177,28 @@ while :; do __Test=true ;; - -dailytest) - __DailyTest=true + -privatebuildpath) + __PrivateBuildPath="$2" + shift ;; - -privatebuildpath) - __PrivateBuildPath=$2 - __DailyTest=true + -dotnetruntimeversion) + __DotnetRuntimeVersion="$2" + shift + ;; + + -dotnetruntimedownloadversion) + __DotnetRuntimeDownloadVersion="$2" + shift + ;; + + -runtimesourcefeed) + __RuntimeSourceFeed="$2" + shift + ;; + + -runtimesourcefeedkey) + __RuntimeSourceFeedKey="$2" shift ;; @@ -451,7 +468,19 @@ fi if [ $__NativeBuild == true ]; then echo "Generating Version Source File" __GenerateVersionLog="$__LogDir/GenerateVersion.binlog" - "$__ProjectRoot/eng/common/msbuild.sh" $__ProjectRoot/eng/CreateVersionFile.csproj /v:$__Verbosity /bl:$__GenerateVersionLog /t:GenerateVersionFiles /restore /p:GenerateVersionSourceFile=true /p:NativeVersionSourceFile="$__IntermediatesDir/version.cpp" /p:Configuration="$__BuildType" /p:Platform="$__BuildArch" $__UnprocessedBuildArgs + + "$__ProjectRoot/eng/common/msbuild.sh" \ + $__ProjectRoot/eng/CreateVersionFile.csproj \ + /v:$__Verbosity \ + /bl:$__GenerateVersionLog \ + /t:GenerateVersionFiles \ + /restore \ + /p:GenerateVersionSourceFile=true \ + /p:NativeVersionSourceFile="$__IntermediatesDir/version.cpp" \ + /p:Configuration="$__BuildType" \ + /p:Platform="$__BuildArch" \ + $__UnprocessedBuildArgs + if [ $? != 0 ]; then echo "Generating Version Source File FAILED" exit 1 @@ -506,7 +535,19 @@ if [ $__Test == true ]; then echo "lldb: '$LLDB_PATH' gdb: '$GDB_PATH'" - "$__ProjectRoot/eng/common/build.sh" --test --configuration "$__BuildType" --verbosity "$__Verbosity" /bl:$__LogDir/Test.binlog /p:BuildArch=$__BuildArch /p:DailyTest=$__DailyTest /p:PrivateBuildPath=$__PrivateBuildPath $__TestArgs + "$__ProjectRoot/eng/common/build.sh" \ + --test \ + --configuration "$__BuildType" \ + --verbosity "$__Verbosity" \ + /bl:$__LogDir/Test.binlog \ + /p:BuildArch="$__BuildArch" \ + /p:PrivateBuildPath="$__PrivateBuildPath" \ + /p:DotnetRuntimeVersion="$__DotnetRuntimeVersion" \ + /p:DotnetRuntimeDownloadVersion="$__DotnetRuntimeDownloadVersion" \ + /p:RuntimeSourceFeed="$__RuntimeSourceFeed" \ + /p:RuntimeSourceFeedKey="$__RuntimeSourceFeedKey" \ + $__TestArgs + if [ $? != 0 ]; then exit 1 fi diff --git a/eng/build.yml b/eng/build.yml index c51ac37d1..ba780b413 100644 --- a/eng/build.yml +++ b/eng/build.yml @@ -85,6 +85,16 @@ jobs: - _HelixType: build/product - _HelixBuildConfig: $(_BuildConfig) - _Pipeline_StreamDumpDir: $(Build.SourcesDirectory)/artifacts/tmp/$(_BuildConfig)/streams + - _InternalInstallArgs: '' + + # For testing msrc's and service releases. The RuntimeSourceVersion is either "default" or the service release version to test + - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + - group: DotNet-MSRC-Storage + - _InternalInstallArgs: + -dotnetruntimeversion '$(DotnetRuntimeVersion)' + -dotnetruntimedownloadversion '$(DotnetRuntimeDownloadVersion)' + -runtimesourcefeed '$(dotnetfeedmsrc-private-feed-url)' + -runtimesourcefeedkey '$(dotnetclimsrc-read-sas-token-base64)' # Only enable publishing in non-public, non PR scenarios. - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: @@ -110,6 +120,7 @@ jobs: -architecture $(_BuildArch) -prepareMachine /p:OfficialBuildId=$(BUILD.BUILDNUMBER) + $(_InternalInstallArgs) displayName: Build / Test condition: succeeded() @@ -132,6 +143,7 @@ jobs: --prepareMachine /p:OfficialBuildId=$(BUILD.BUILDNUMBER) /p:BUILD_BUILDNUMBER=$(BUILD.BUILDNUMBER) + $(_InternalInstallArgs) displayName: Docker Build / Test condition: succeeded() @@ -143,6 +155,7 @@ jobs: --architecture $(_BuildArch) --prepareMachine /p:OfficialBuildId=$(BUILD.BUILDNUMBER) + $(_InternalInstallArgs) displayName: Build / Test condition: succeeded() diff --git a/src/SOS/SOS.UnitTests/ConfigFiles/Unix/Debugger.Tests.Config.txt b/src/SOS/SOS.UnitTests/ConfigFiles/Unix/Debugger.Tests.Config.txt index 1a57d4fd4..e937c4aa4 100644 --- a/src/SOS/SOS.UnitTests/ConfigFiles/Unix/Debugger.Tests.Config.txt +++ b/src/SOS/SOS.UnitTests/ConfigFiles/Unix/Debugger.Tests.Config.txt @@ -21,6 +21,18 @@ $(RootBinDir)/TestResults/$(TargetConfiguration)/sos.unittests_$(Timestamp) $(RootBinDir)/tmp/$(TargetConfiguration)\dumps + false + true + true + + true + false + + + netcoreapp3.0 + netcoreapp3.0 + netcoreapp2.1 + $(RepoRootDir)/src/SOS/SOS.UnitTests/Debuggees sdk.prebuilt $(RootBinDir) @@ -36,20 +48,19 @@ Default (prebuilt) --> - - - @@ -62,25 +73,20 @@ SOS.StackAndOtherTests - - - @@ -88,22 +94,21 @@ -