Add "daily-test" option to scripts/config.
**Currently under construction**
-This repository contains the source code for various .NET Core runtime diagnostic tools. It currently contains SOS, the managed portion of SOS and the lldb SOS plugin. One of goals of this repo is to build SOS and the lldb SOS plugin for the portable Linux platform (Centos 7) and the platforms not supported by the portable build (Centos 6, Alpine, eventually macOS) and to test across various indexes in a very large matrix: OSs/distros (Centos 6/7, Ubuntu, Alpine, Fedora, Debian, RHEL 7.2), architectures (x64, x86, arm, arm64), lldb versions (3.9, 4.0, 5.0, 6.0) and even .NET Core versions (1.1, 2.0.x, 2.1).
+This repository contains the source code for various .NET Core runtime diagnostic tools. It currently contains SOS, the managed portion of SOS and the lldb SOS plugin. The goals of this repo is to build SOS and the lldb SOS plugin for the portable (glibc based) Linux platform (Centos 7) and the platforms not supported by the portable (musl based) build (Centos 6, Alpine, and macOS) and to test across various indexes in a very large matrix: OSs/distros (Centos 6/7, Ubuntu, Alpine, Fedora, Debian, RHEL 7.2), architectures (x64, x86, arm, arm64), lldb versions (3.9, 4.0, 5.0, 6.0) and .NET Core versions (1.1, 2.0.x, 2.1).
Another goal to make it easier to obtain a version of lldb (currently 3.9) with scripts and documentation for platforms/distros like Centos, Alpine, Fedora, etc. that by default provide really old versions.
BUILD: Product binaries are available at c:\git\diagnostics\artifacts\Debug\bin\Windows_NT.x64
```
+To build for x86:
+
+```bat
+> build.cmd -architecture x86
+```
+
To test the resulting SOS:
```bat
set __BuildOS=Windows_NT
set __Build=0
set __Test=0
+set __DailyTest=
set __Verbosity=minimal
set __TestArgs=
if /i "%1" == "-build-native" (set __Build=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "-test" (set __Test=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
+if /i "%1" == "-daily-test" (set __DailyTest=-DailyTest&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "-configuration" (set __BuildType=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
if /i "%1" == "-architecture" (set __BuildArch=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
if /i "%1" == "-verbosity" (set __Verbosity=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
:: Test components
if %__Test% EQU 1 (
- :: Install the other versions of .NET Core runtime we are going to test on (2.0.9 and 1.1.9)
- powershell -ExecutionPolicy ByPass -NoProfile -command "& """%__ProjectDir%\.dotnet\dotnet-install.ps1""" -Version 2.0.9 -Architecture %__BuildArch% -SkipNonVersionedFiles -Runtime dotnet -InstallDir %__ProjectDir%\.dotnet"
- powershell -ExecutionPolicy ByPass -NoProfile -command "& """%__ProjectDir%\.dotnet\dotnet-install.ps1""" -Version 1.1.9 -Architecture %__BuildArch% -SkipNonVersionedFiles -Runtime dotnet -InstallDir %__ProjectDir%\.dotnet"
+ :: Install the other versions of .NET Core runtime we are going to test on
+ powershell -ExecutionPolicy ByPass -NoProfile -command "& """%__ProjectDir%\eng\install-test-runtimes.ps1""" -DotNetDir %__ProjectDir%\.dotnet -TempDir %__IntermediatesDir% -BuildArch %__BuildArch%" %__DailyTest%
:: Run the xunit tests
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%__ProjectDir%\eng\common\Build.ps1""" -test -configuration %__BuildType% -verbosity %__Verbosity% %__TestArgs%"
echo.-? -h -help --help: view this message.
echo -build-native - build native components
echo -test - test components
+echo -daily-test - test components for daily build job
echo -architecture <x64|x86|arm|arm64>
echo -configuration <debug|release>
echo -verbosity <q[uiet]|m[inimal]|n[ormal]|d[etailed]|diag[nostic]>
:: remove the -test and -build-native options and pass it to build-native.cmd
set __args="%*"
-set __args=%__args:-test=%
set __args=%__args:-build-native=%
+set __args=%__args:-daily-test=%
+set __args=%__args:-test=%
if %__args% == "" set __args=
:: build managed components
__NumProc=1
__Build=0
__Test=0
+__DailyTest=
__CI=0
__TestArgs=
__UnprocessedBuildArgs=
echo "Usage: $0 [options]"
echo "--build-native - build native components"
echo "--test - test native components"
+ echo "--daily-test - test native components for daily build job"
echo "--architecture <x64|x86|arm|armel|arm64>"
echo "--configuration <debug|release>"
echo "--clangx.y - optional argument to build using clang version x.y"
__Test=1
;;
+ --daily-test)
+ __DailyTest="--daily-test"
+ ;;
+
--ci)
__CI=1
__TestArgs="$__TestArgs $1"
# Run SOS/lldbplugin tests
if [ $__Test == 1 ]; then
- # Install the other versions of .NET Core runtime we are going to test on (2.0.9 and 1.1.9)
- bash "$__ProjectRoot/.dotnet/dotnet-install.sh" --version 2.0.9 --architecture "$__BuildArch" --skip-non-versioned-files --runtime dotnet --install-dir "$__ProjectRoot/.dotnet"
- bash "$__ProjectRoot/.dotnet/dotnet-install.sh" --version 1.1.9 --architecture "$__BuildArch" --skip-non-versioned-files --runtime dotnet --install-dir "$__ProjectRoot/.dotnet"
+ # Install the other versions of .NET Core runtime we are going to test on
+ "$__ProjectRoot/eng/install-test-runtimes.sh" --dotnet-directory "$__ProjectRoot/.dotnet" --temp-directory "$__IntermediatesDir" --architecture "$__BuildArch" $__DailyTest
if [ "$LLDB_PATH" = "" ]; then
export LLDB_PATH="$(which lldb-3.9.1 2> /dev/null)"
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
# remove the options that build.sh can't handle and pass it to build-native.sh
-__args="$(echo $@ | sed 's/--test//g;s/--build-native//g;s/--clang[0-9]\.[0-9]//g')"
+__args="$(echo $@ | sed 's/--build-native//g;s/--daily-test//g;s/--test//g;s/--clang[0-9]\.[0-9]//g')"
# build managed components
"$scriptroot/common/build.sh" $__args
--- /dev/null
+[cmdletbinding()]
+param(
+ [string]$DotNetDir,
+ [string]$TempDir,
+ [string]$BuildArch,
+ [switch]$DailyTest,
+ [string]$Branch="master",
+ [string]$UncachedFeed="https://dotnetcli.blob.core.windows.net/dotnet"
+)
+
+Set-StrictMode -Version Latest
+$ErrorActionPreference="Stop"
+
+$RuntimeVersion11="1.1.9"
+$RuntimeVersion20="2.0.9"
+$RuntimeVersion21="2.1.0"
+$DailyTestText="true"
+
+# Install the other versions of .NET Core runtime we are going to test. 1.1.x, 2.0.x, 2.1.x (installed with the CLI)
+# and latest. Only install the latest master for daily jobs and leave the RuntimeVersion* config properties blank.
+if (!$DailyTest) {
+ $DailyTestText="false"
+ . $DotNetDir\dotnet-install.ps1 -Version $RuntimeVersion11 -Architecture $BuildArch -SkipNonVersionedFiles -Runtime dotnet -InstallDir $DotNetDir
+ . $DotNetDir\dotnet-install.ps1 -Version $RuntimeVersion20 -Architecture $BuildArch -SkipNonVersionedFiles -Runtime dotnet -InstallDir $DotNetDir
+}
+
+. $DotNetDir\dotnet-install.ps1 -Channel $Branch -Version latest -Architecture $BuildArch -SkipNonVersionedFiles -Runtime dotnet -InstallDir $DotNetDir
+
+# Now download the latest runtime version and create a config file containing it
+$VersionFileUrl = "$UncachedFeed/Runtime/$Branch/latest.version"
+$VersionFile = Join-Path -Path $TempDir latest.version
+$ConfigFile = Join-Path -Path $DotNetDir Debugger.Tests.Versions.txt
+
+Invoke-WebRequest $VersionFileUrl -OutFile $VersionFile
+
+if (Test-Path $VersionFile) {
+ $VersionText = cat $VersionFile
+ $Data = @($VersionText.Split([char[]]@(), [StringSplitOptions]::RemoveEmptyEntries));
+ $RuntimeVersionLatest = $Data[1].Trim()
+
+ Write-Host "Latest version: $RuntimeVersionLatest"
+
+ '<Configuration>
+<DailyTest>' + $DailyTestText +'</DailyTest>
+<RuntimeVersion11>' + $RuntimeVersion11 + '</RuntimeVersion11>
+<RuntimeVersion20>' + $RuntimeVersion20 + '</RuntimeVersion20>
+<RuntimeVersion21>' + $RuntimeVersion21 + '</RuntimeVersion21>
+<RuntimeVersionLatest>' + $RuntimeVersionLatest + '</RuntimeVersionLatest>
+</Configuration>' | Set-Content $ConfigFile
+
+}
+else {
+ Write-Host "Could not download latest runtime version file"
+}
--- /dev/null
+#!/usr/bin/env bash
+# Copyright (c) .NET Foundation and contributors. All rights reserved.
+# Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+dotnet_dir=
+temp_dir=
+build_arch=
+daily_test=0
+branch="master"
+uncached_feed="https://dotnetcli.blob.core.windows.net/dotnet"
+
+while [ $# -ne 0 ]; do
+ name=$1
+ case $name in
+ --dotnet-directory)
+ shift
+ dotnet_dir=$1
+ ;;
+ --temp-directory)
+ shift
+ temp_dir=$1
+ ;;
+ --architecture)
+ shift
+ build_arch=$1
+ ;;
+ --branch)
+ shift
+ branch=$1
+ ;;
+ --daily-test)
+ daily_test=1
+ ;;
+ *)
+ args="$args $1"
+ ;;
+ esac
+ shift
+done
+
+runtime_version_11="1.1.9"
+runtime_version_20="2.0.9"
+runtime_version_21="2.1.0"
+daily_test_text="true"
+
+# Install the other versions of .NET Core runtime we are going to test. 1.1.x, 2.0.x, 2.1.x (installed with the CLI)
+# and latest. Only install the latest master for daily jobs and leave the RuntimeVersion* config properties blank.
+if [ $daily_test == 0 ]; then
+ daily_test_text="false"
+ bash "$dotnet_dir/dotnet-install.sh" --version "$runtime_version_11" --architecture "$build_arch" --skip-non-versioned-files --runtime dotnet --install-dir "$dotnet_dir"
+ bash "$dotnet_dir/dotnet-install.sh" --version "$runtime_version_20" --architecture "$build_arch" --skip-non-versioned-files --runtime dotnet --install-dir "$dotnet_dir"
+fi
+
+bash "$dotnet_dir/dotnet-install.sh" --channel $branch --version latest --architecture "$build_arch" --skip-non-versioned-files --runtime dotnet --install-dir "$dotnet_dir"
+
+# Now download the latest runtime version and create a config file containing it
+version_file_url="$uncached_feed/Runtime/$branch/latest.version"
+version_file="$temp_dir/latest.version"
+config_file="$dotnet_dir/Debugger.Tests.Versions.txt"
+
+# Use curl if available, otherwise use wget
+if command -v curl > /dev/null; then
+ curl "$version_file_url" -sSL --retry 10 --create-dirs -o "$version_file"
+else
+ wget -q -O "$version_file" "$version_file_url"
+fi
+
+if [ -f "$version_file" ]; then
+ runtime_version_latest=$(cat $version_file | tail -n 1 | sed 's/\r$//')
+
+ echo "Latest version: $runtime_version_latest"
+
+ echo "<Configuration>
+<DailyTest>$daily_test_text</DailyTest>
+<RuntimeVersion11>$runtime_version_11</RuntimeVersion11>
+<RuntimeVersion20>$runtime_version_20</RuntimeVersion20>
+<RuntimeVersion21>$runtime_version_21</RuntimeVersion21>
+<RuntimeVersionLatest>$runtime_version_latest</RuntimeVersionLatest>
+</Configuration>" > $config_file
+
+else
+ echo "Could not download latest runtime version file"
+fi
{
foreach (XAttribute attr in node.Attributes("ConfigFile"))
{
- string file = Path.Combine(TestConfiguration.BaseDir, attr.Value);
+ string file = ResolveProperties(currentTemplate, attr.Value).Trim();
+ if (!Path.IsPathRooted(file))
+ {
+ file = Path.Combine(TestConfiguration.BaseDir, file);
+ }
templates = ParseConfigFile(file, templates);
}
}
-->
<Configuration>
+ <RepoRootDir>../../../../..</RepoRootDir>
<Import ConfigFile="Debugger.Tests.Common.txt" />
+ <Import ConfigFile="$(RepoRootDir)/.dotnet/Debugger.Tests.Versions.txt" />
<TestProduct>ProjectK</TestProduct>
- <RepoRootDir>../../../../..</RepoRootDir>
<ScriptRootDir>$(RepoRootDir)/src/SOS/SOS.UnitTests/Scripts</ScriptRootDir>
<RootBinDir>$(RepoRootDir)/artifacts</RootBinDir>
<InstallDir>$(RootBinDir)/$(TargetConfiguration)/bin/$(OS).$(TargetArchitecture)</InstallDir>
<Options>
<Option>
- <BuildProjectMicrosoftNetCoreAppVersion>2.1.0</BuildProjectMicrosoftNetCoreAppVersion>
+ <!-- Build the debuggee for 2.1 but run it on latest -->
+ <BuildProjectMicrosoftNetCoreAppVersion>$(RuntimeVersion21)</BuildProjectMicrosoftNetCoreAppVersion>
<BuildProjectFramework>netcoreapp2.1</BuildProjectFramework>
- <RuntimeFrameworkVersion>2.1.0</RuntimeFrameworkVersion>
+ <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
</Option>
- <Option>
- <BuildProjectMicrosoftNetCoreAppVersion>2.0.9</BuildProjectMicrosoftNetCoreAppVersion>
+ <Option Condition="'$(DailyTest)' != 'true'">
+ <BuildProjectMicrosoftNetCoreAppVersion>$(RuntimeVersion21)</BuildProjectMicrosoftNetCoreAppVersion>
+ <BuildProjectFramework>netcoreapp2.1</BuildProjectFramework>
+ <RuntimeFrameworkVersion>$(RuntimeVersion21)</RuntimeFrameworkVersion>
+ </Option>
+ <Option Condition="'$(DailyTest)' != 'true'">
+ <BuildProjectMicrosoftNetCoreAppVersion>$(RuntimeVersion20)</BuildProjectMicrosoftNetCoreAppVersion>
<BuildProjectFramework>netcoreapp2.0</BuildProjectFramework>
- <RuntimeFrameworkVersion>2.0.9</RuntimeFrameworkVersion>
+ <RuntimeFrameworkVersion>$(RuntimeVersion20)</RuntimeFrameworkVersion>
</Option>
- <Option Condition="Exists('$(RepoRootDir)/.dotnet/shared/Microsoft.NETCore.App/1.1.9')">
- <BuildProjectMicrosoftNetCoreAppVersion>1.1.9</BuildProjectMicrosoftNetCoreAppVersion>
+ <Option Condition="Exists('$(RepoRootDir)/.dotnet/shared/Microsoft.NETCore.App/$(RuntimeVersion11)')">
+ <BuildProjectMicrosoftNetCoreAppVersion>$(RuntimeVersion11)</BuildProjectMicrosoftNetCoreAppVersion>
<BuildProjectFramework>netcoreapp1.1</BuildProjectFramework>
- <RuntimeFrameworkVersion>1.1.9</RuntimeFrameworkVersion>
+ <RuntimeFrameworkVersion>$(RuntimeVersion11)</RuntimeFrameworkVersion>
<!-- createdump doesn't exists in 1.1 -->
<GenerateDumpWithGDB>true</GenerateDumpWithGDB>
<!-- SOS needs at least 2.0 to run. The default without this is to use the runtime being debuggged to host SOS.NETCore -->
- <SOSHostRuntime>$(RepoRootDir)/.dotnet/shared/Microsoft.NETCore.App/2.0.9</SOSHostRuntime>
+ <SOSHostRuntime>$(RepoRootDir)/.dotnet/shared/Microsoft.NETCore.App/$(RuntimeVersion20)</SOSHostRuntime>
</Option>
</Options>
-->
<Configuration>
+ <RepoRootDir>..\..\..\..\..</RepoRootDir>
<Import ConfigFile="Debugger.Tests.Common.txt" />
+ <Import ConfigFile="$(RepoRootDir)\.dotnet\Debugger.Tests.Versions.txt" />
- <RepoRootDir>..\..\..\..\..</RepoRootDir>
<ScriptRootDir>$(RepoRootDir)\src\SOS\SOS.UnitTests\Scripts</ScriptRootDir>
<RootBinDir>$(RepoRootDir)\artifacts</RootBinDir>
-
<InstallDir>$(RootBinDir)\$(TargetConfiguration)\bin\Windows_NT.$(TargetArchitecture)</InstallDir>
<LogDir>$(RootBinDir)\$(TargetConfiguration)\TestResults\sos.unittests_$(Timestamp)</LogDir>
<DumpDir>$(RootBinDir)\$(TargetConfiguration)\tmp\dumps</DumpDir>
<TestProduct>ProjectK</TestProduct>
<Options>
<Option>
- <BuildProjectMicrosoftNetCoreAppVersion>2.1.0</BuildProjectMicrosoftNetCoreAppVersion>
+ <!-- Build the debuggee for 2.1 but run it on latest -->
+ <BuildProjectMicrosoftNetCoreAppVersion>$(RuntimeVersion21)</BuildProjectMicrosoftNetCoreAppVersion>
<BuildProjectFramework>netcoreapp2.1</BuildProjectFramework>
- <RuntimeFrameworkVersion>2.1.0</RuntimeFrameworkVersion>
+ <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
</Option>
- <Option>
- <BuildProjectMicrosoftNetCoreAppVersion>2.0.9</BuildProjectMicrosoftNetCoreAppVersion>
+ <Option Condition="'$(DailyTest)' != 'true'">
+ <BuildProjectMicrosoftNetCoreAppVersion>$(RuntimeVersion21)</BuildProjectMicrosoftNetCoreAppVersion>
+ <BuildProjectFramework>netcoreapp2.1</BuildProjectFramework>
+ <RuntimeFrameworkVersion>$(RuntimeVersion21)</RuntimeFrameworkVersion>
+ </Option>
+ <Option Condition="'$(DailyTest)' != 'true'">
+ <BuildProjectMicrosoftNetCoreAppVersion>$(RuntimeVersion20)</BuildProjectMicrosoftNetCoreAppVersion>
<BuildProjectFramework>netcoreapp2.0</BuildProjectFramework>
- <RuntimeFrameworkVersion>2.0.9</RuntimeFrameworkVersion>
+ <RuntimeFrameworkVersion>$(RuntimeVersion20)</RuntimeFrameworkVersion>
</Option>
- <Option>
- <BuildProjectMicrosoftNetCoreAppVersion>1.1.9</BuildProjectMicrosoftNetCoreAppVersion>
+ <Option Condition="'$(DailyTest)' != 'true'">
+ <BuildProjectMicrosoftNetCoreAppVersion>$(RuntimeVersion11)</BuildProjectMicrosoftNetCoreAppVersion>
<BuildProjectFramework>netcoreapp1.1</BuildProjectFramework>
- <RuntimeFrameworkVersion>1.1.9</RuntimeFrameworkVersion>
+ <RuntimeFrameworkVersion>$(RuntimeVersion11)</RuntimeFrameworkVersion>
<!-- SOS needs at least 2.0 to run. The default without this is to use the runtime being debuggged to host SOS.NETCore -->
- <SOSHostRuntime>$(RepoRootDir)\.dotnet\shared\Microsoft.NETCore.App\2.0.9</SOSHostRuntime>
+ <SOSHostRuntime>$(RepoRootDir)\.dotnet\shared\Microsoft.NETCore.App\$(RuntimeVersion20)</SOSHostRuntime>
</Option>
</Options>
<HostExe>$(RepoRootDir)\.dotnet\dotnet.exe</HostExe>