Merge pull request #8914 from livarcocc/new_distros_ci

Adding Fedora 27, OpenSuse 43.2 and Ubuntu 18.04 to CI for release/2.1.1xx
This commit is contained in:
Livar 2018-03-29 14:22:57 -07:00 committed by GitHub
commit a2e06535b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 126 additions and 312 deletions

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MicrosoftNETCoreAppPackageVersion>2.0.6</MicrosoftNETCoreAppPackageVersion>
<MicrosoftNETCoreAppPackageVersion>2.0.7-servicing-26322-01</MicrosoftNETCoreAppPackageVersion>
<MicrosoftNETCoreDotNetHostResolverPackageVersion>$(MicrosoftNETCoreAppPackageVersion)</MicrosoftNETCoreDotNetHostResolverPackageVersion>
<MicrosoftBuildPackageVersion>15.6.82</MicrosoftBuildPackageVersion>
<MicrosoftBuildFrameworkPackageVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildFrameworkPackageVersion>

View file

@ -19,6 +19,7 @@
<NugetConfigCLIFeeds>
<![CDATA[
<add key="BlobFeed" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
<add key="templating" value="https://dotnet.myget.org/F/templating/api/v3/index.json" />
<add key="aspnet" value="https://dotnet.myget.org/F/aspnetcore-release/api/v3/index.json" />
<add key="websdkfeed" value="https://dotnet.myget.org/F/dotnet-web/api/v3/index.json" />

View file

@ -74,6 +74,8 @@
Projects="@(ProjectsToTest)">
</MSBuild>
<Exec Command="$(DotnetInOutputDirectory) exec $(RoslynDirectory)/bincore/VBCSCompiler.dll -shutdown" />
<Message Text="Finished test execution" Importance="High" />
<!-- Begin Workaround lack of a stable package version for depedencies; remove simulated stable version folder. -->

View file

@ -9,7 +9,7 @@ def project = GithubProject
def branch = GithubBranchName
def isPR = true
def platformList = ['Linux:x64:Release', 'Debian8.2:x64:Debug', 'Ubuntu:x64:Release', 'Ubuntu16.04:x64:Debug', 'OSX10.12:x64:Release', 'Windows_NT:x64:Release', 'Windows_NT:x86:Debug', 'RHEL7.2:x64:Release', 'CentOS7.1:x64:Debug']
def platformList = ['Linux:x64:Release', 'Debian8.2:x64:Debug', 'Ubuntu:x64:Release', 'Ubuntu16.04:x64:Debug', 'OSX10.12:x64:Release', 'Windows_NT:x64:Release', 'Windows_NT:x86:Debug', 'RHEL7.2:x64:Release', 'CentOS7.1:x64:Debug', 'ubuntu.18.04:x64:Debug', 'fedora.27:x64:Debug', 'opensuse.43.2:x64:Debug']
def static getBuildJobName(def configuration, def os, def architecture) {
return configuration.toLowerCase() + '_' + os.toLowerCase() + '_' + architecture.toLowerCase()
@ -20,6 +20,7 @@ platformList.each { platform ->
// Calculate names
def (os, architecture, configuration) = platform.tokenize(':')
def osUsedForMachineAffinity = os;
def osVersionUsedForMachineAffinity = 'latest-or-auto';
// Calculate job name
def jobName = getBuildJobName(configuration, os, architecture)
@ -39,6 +40,11 @@ platformList.each { platform ->
osUsedForMachineAffinity = 'Ubuntu16.04';
buildCommand = "./build.sh --linux-portable --skip-prereqs --configuration ${configuration} --targets Default"
}
else if (os == 'ubuntu.18.04' || os == 'fedora.27' || os == 'opensuse.43.2') {
osUsedForMachineAffinity = 'Ubuntu16.04'
osVersionUsedForMachineAffinity = 'latest-docker'
buildCommand = "./build.sh --linux-portable --skip-prereqs --configuration ${configuration} --docker ${os} --targets Default"
}
else {
// Jenkins non-Ubuntu CI machines don't have docker
buildCommand = "./build.sh --skip-prereqs --configuration ${configuration} --targets Default"
@ -58,7 +64,7 @@ platformList.each { platform ->
}
}
Utilities.setMachineAffinity(newJob, osUsedForMachineAffinity, 'latest-or-auto')
Utilities.setMachineAffinity(newJob, osUsedForMachineAffinity, osVersionUsedForMachineAffinity)
Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
Utilities.addMSTestResults(newJob, '**/*.trx')
Utilities.addGithubPRTriggerForBranch(newJob, branch, "${os} ${architecture} ${configuration} Build")

View file

@ -53,20 +53,6 @@ if (!(Test-Path $env:DOTNET_INSTALL_DIR))
mkdir $env:DOTNET_INSTALL_DIR | Out-Null
}
# We also need to pull down a project.json based CLI that is used by some tests
# so create another directory for that.
if (!$env:DOTNET_INSTALL_DIR_PJ)
{
$env:DOTNET_INSTALL_DIR_PJ="$RepoRoot\.dotnet_stage0PJ\$Architecture"
}
if (!(Test-Path $env:DOTNET_INSTALL_DIR_PJ))
{
mkdir $env:DOTNET_INSTALL_DIR_PJ | Out-Null
}
# Disable first run since we want to control all package sources
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
@ -88,14 +74,6 @@ if ($LastExitCode -ne 0)
exit $LastExitCode
}
Write-Output "$dotnetInstallPath -InstallDir $env:DOTNET_INSTALL_DIR_PJ -Architecture ""$Architecture"" -Version 1.0.0-preview2-1-003177"
Invoke-Expression "$dotnetInstallPath -InstallDir $env:DOTNET_INSTALL_DIR_PJ -Architecture ""$Architecture"" -Version 1.0.0-preview2-1-003177"
if ($LastExitCode -ne 0)
{
Write-Output "The .NET CLI installation failed with exit code $LastExitCode"
exit $LastExitCode
}
# Put the stage0 on the path
$env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH"

View file

@ -163,14 +163,6 @@ if [ $EXIT_CODE != 0 ]; then
exit $EXIT_CODE
fi
# Install a project.json based CLI for use by tests
(set -x ; "$REPOROOT/scripts/obtain/dotnet-install.sh" --channel "master" --install-dir "$DOTNET_INSTALL_DIR_PJ" --architecture "$ARCHITECTURE" --version "1.0.0-preview2-1-003177")
EXIT_CODE=$?
if [ $EXIT_CODE != 0 ]; then
echo "run-build: Error: installing project-json based cli failed with exit code $EXIT_CODE." >&2
exit $EXIT_CODE
fi
# Put stage 0 on the PATH (for this shell only)
PATH="$DOTNET_INSTALL_DIR:$PATH"

View file

@ -0,0 +1,32 @@
#
# 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.
#
# Dockerfile that creates a container suitable to build dotnet-cli
FROM microsoft/dotnet-buildtools-prereqs:fedora-27-82a3800-20180326211504
RUN dnf install -y findutils
RUN dnf upgrade -y nss
RUN dnf clean all
# Set a different rid to publish buildtools for, until we update to a version which
# natively supports fedora.24-x64
ENV __PUBLISH_RID=fedora.23-x64
# Setup User to match Host User, and give superuser permissions
ARG USER_ID=0
RUN useradd -m code_executor -u ${USER_ID} -g wheel
RUN echo 'code_executor ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# With the User Change, we need to change permissions on these directories
RUN chmod -R a+rwx /usr/local
RUN chmod -R a+rwx /home
# Set user to the one we just created
USER ${USER_ID}
# Set working directory
WORKDIR /opt/code

View file

@ -0,0 +1,49 @@
#
# 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.
#
FROM microsoft/dotnet-buildtools-prereqs:opensuse-42.3-d46ee12-20180327014902
# Install the base toolchain we need to build anything (clang, cmake, make and the like)
# this does not include libraries that we need to compile different projects, we'd like
# them in a different layer.
RUN zypper -n install binutils \
cmake \
which \
gcc \
llvm-clang \
tar \
ncurses-utils \
curl \
git \
sudo && \
zypper clean -a
# Dependencies of CoreCLR and CoreFX.
RUN zypper -n install --force-resolution \
libunwind \
libicu \
lttng-ust \
libuuid1 \
libopenssl1_0_0 \
libcurl4 \
krb5 && \
zypper clean -a
# Setup User to match Host User, and give superuser permissions
ARG USER_ID=0
RUN useradd -m code_executor -u ${USER_ID} -g wheel
RUN echo 'code_executor ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# With the User Change, we need to change permissions on these directories
RUN chmod -R a+rwx /usr/local
RUN chmod -R a+rwx /home
RUN chmod -R 755 /usr/lib/sudo
# Set user to the one we just created
USER ${USER_ID}
# Set working directory
WORKDIR /opt/code

View file

@ -0,0 +1,29 @@
#
# 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.
#
# Dockerfile that creates a container suitable to build dotnet-cli
FROM microsoft/dotnet-buildtools-prereqs:ubuntu-18.04-f90bc20-20180320154721
RUN apt-get update && \
apt-get -qqy install \
sudo && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Setup User to match Host User, and give superuser permissions
ARG USER_ID=0
RUN useradd -m code_executor -u ${USER_ID} -g sudo
RUN echo 'code_executor ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# With the User Change, we need to change permissions on these directories
RUN chmod -R a+rwx /usr/local
RUN chmod -R a+rwx /home
RUN chmod -R 755 /usr/lib/sudo
# Set user to the one we just created
USER ${USER_ID}
# Set working directory
WORKDIR /opt/code

View file

@ -17,13 +17,9 @@ namespace Microsoft.DotNet.TestFramework
private FileInfo _dotnetCsprojExe;
private FileInfo _dotnetProjectJsonExe;
private const string ProjectJsonSearchPattern = "project.json";
private const string CsprojSearchPattern = "*.csproj";
public TestAssets(DirectoryInfo assetsRoot, FileInfo dotnetCsprojExe, FileInfo dotnetProjectJsonExe)
public TestAssets(DirectoryInfo assetsRoot, FileInfo dotnetCsprojExe)
{
if (assetsRoot == null)
{
@ -35,11 +31,6 @@ namespace Microsoft.DotNet.TestFramework
throw new ArgumentNullException(nameof(dotnetCsprojExe));
}
if (dotnetProjectJsonExe == null)
{
throw new ArgumentNullException(nameof(dotnetProjectJsonExe));
}
if (!assetsRoot.Exists)
{
throw new DirectoryNotFoundException($"Directory not found at '{assetsRoot}'");
@ -50,16 +41,9 @@ namespace Microsoft.DotNet.TestFramework
throw new FileNotFoundException("Csproj dotnet executable must exist", dotnetCsprojExe.FullName);
}
if (!dotnetProjectJsonExe.Exists)
{
throw new FileNotFoundException("project.json dotnet executable must exist", dotnetProjectJsonExe.FullName);
}
_root = assetsRoot;
_dotnetCsprojExe = dotnetCsprojExe;
_dotnetProjectJsonExe = dotnetProjectJsonExe;
}
public TestAssetInfo Get(string name)
@ -78,22 +62,6 @@ namespace Microsoft.DotNet.TestFramework
CsprojSearchPattern);
}
public TestAssetInfo GetProjectJson(string name)
{
return GetProjectJson(TestAssetKinds.TestProjects, name);
}
public TestAssetInfo GetProjectJson(string kind, string name)
{
var assetDirectory = new DirectoryInfo(Path.Combine(_root.FullName, kind, name));
return new TestAssetInfo(
assetDirectory,
name,
_dotnetProjectJsonExe,
ProjectJsonSearchPattern);
}
public DirectoryInfo CreateTestDirectory(string testProjectName = "temp", [CallerMemberName] string callingMethod = "", string identifier = "")
{
var testDestination = GetTestDestinationDirectoryPath(testProjectName, callingMethod, identifier);

View file

@ -303,7 +303,7 @@ namespace Microsoft.DotNet.Tests
result.Should().NotBeNull();
result.Args.Should().Contain("--fx-version 2.0.6");
result.Args.Should().Contain("--fx-version 2.0.7-servicing-26322-01");
}
[Fact]

View file

@ -1,183 +0,0 @@
// 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.
using System.IO;
using Microsoft.DotNet.Cli.Utils;
using NuGet.Frameworks;
namespace Microsoft.DotNet.Tools.Test.Utilities
{
public sealed class BuildPJCommand : TestCommand
{
private bool _captureOutput;
private string _configuration;
private NuGetFramework _framework;
private string _runtime;
private bool _noDependencies;
private DirectoryInfo _outputPath;
private FileInfo _projectFile;
private DirectoryInfo _workingDirectory;
public BuildPJCommand()
: base(new RepoDirectoriesProvider().PjDotnet)
{
}
public override CommandResult Execute(string args = "")
{
args = $"build {GetNoDependencies()} {GetProjectFile()} {GetOutputPath()} {GetConfiguration()} {GetFramework()} {GetRuntime()} {args}";
if (_workingDirectory != null)
{
this.WithWorkingDirectory(_workingDirectory.FullName);
}
if (_captureOutput)
{
return base.ExecuteWithCapturedOutput(args);
}
else
{
return base.Execute(args);
}
}
public override CommandResult ExecuteWithCapturedOutput(string args = "")
{
WithCapturedOutput();
return Execute(args);
}
public BuildPJCommand WithCapturedOutput()
{
_captureOutput = true;
return this;
}
public BuildPJCommand WithConfiguration(string configuration)
{
_configuration = configuration;
return this;
}
public BuildPJCommand WithFramework(NuGetFramework framework)
{
_framework = framework;
return this;
}
public BuildPJCommand WithRuntime(string runtime)
{
_runtime = runtime;
return this;
}
public BuildPJCommand WithNoDependencies()
{
_noDependencies = true;
return this;
}
public BuildPJCommand WithOutputPath(DirectoryInfo outputPath)
{
_outputPath = outputPath;
return this;
}
public BuildPJCommand WithProjectDirectory(DirectoryInfo projectDirectory)
{
_workingDirectory = projectDirectory;
return this;
}
public BuildPJCommand WithProjectFile(FileInfo projectFile)
{
_projectFile = projectFile;
return this;
}
public BuildPJCommand WithWorkingDirectory(DirectoryInfo workingDirectory)
{
_workingDirectory = workingDirectory;
return this;
}
private string GetConfiguration()
{
if (_configuration == null)
{
return null;
}
return $"--configuration {_configuration}";
}
private string GetFramework()
{
if (_framework == null)
{
return null;
}
return $"--framework {_framework.GetShortFolderName()}";
}
private string GetRuntime()
{
if (_runtime == null)
{
return null;
}
return $"--runtime {_runtime}";
}
private string GetNoDependencies()
{
if (!_noDependencies)
{
return null;
}
return "--no-dependencies";
}
private string GetOutputPath()
{
if (_outputPath == null)
{
return null;
}
return $"\"{_outputPath.FullName}\"";
}
private string GetProjectFile()
{
if (_projectFile == null)
{
return null;
}
return $"\"{_projectFile.FullName}\"";
}
}
}

View file

@ -1,28 +0,0 @@
// 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.
using Microsoft.DotNet.Cli.Utils;
namespace Microsoft.DotNet.Tools.Test.Utilities
{
public sealed class RestoreProjectJsonCommand : TestCommand
{
public RestoreProjectJsonCommand()
: base(new RepoDirectoriesProvider().PjDotnet)
{
}
public override CommandResult Execute(string args="")
{
args = $"restore {args}";
return base.Execute(args);
}
public override CommandResult ExecuteWithCapturedOutput(string args = "")
{
args = $"restore {args}";
return base.ExecuteWithCapturedOutput(args);
}
}
}

View file

@ -1,27 +0,0 @@
// 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.
using System;
using System.IO;
using System.Linq;
namespace Microsoft.DotNet.Tools.Test.Utilities
{
public class ProjectUtils
{
public static string GetProjectJson(string testRoot, string project)
{
// We assume that the project name same as the directory name with contains the project.json
// We can do better here by using ProjectReader to get the correct project name
string projectPath = Directory.GetFiles(testRoot, "project.json", SearchOption.AllDirectories)
.FirstOrDefault(pj => Directory.GetParent(pj).Name.Equals(project));
if (string.IsNullOrEmpty(projectPath))
{
throw new Exception($"Cannot file project '{project}' in '{testRoot}'");
}
return projectPath;
}
}
}

View file

@ -20,7 +20,6 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
private string _stage2Sdk;
private string _stage2WithBackwardsCompatibleRuntimesDirectory;
private string _testPackages;
private string _pjDotnet;
public static string RepoRoot
{
@ -81,7 +80,6 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
public string Artifacts => _artifacts;
public string BuiltDotnet => _builtDotnet;
public string NugetPackages => _nugetPackages;
public string PjDotnet => _pjDotnet;
public string Stage2Sdk => _stage2Sdk;
public string Stage2WithBackwardsCompatibleRuntimesDirectory => _stage2WithBackwardsCompatibleRuntimesDirectory;
public string TestPackages => _testPackages;
@ -91,13 +89,11 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
string builtDotnet = null,
string nugetPackages = null,
string corehostPackages = null,
string corehostDummyPackages = null,
string pjDotnet = null)
string corehostDummyPackages = null)
{
_artifacts = artifacts ?? Path.Combine(RepoRoot, "artifacts", BuildRid);
_builtDotnet = builtDotnet ?? Path.Combine(_artifacts, "intermediate", "sharedFrameworkPublish");
_nugetPackages = nugetPackages ?? Path.Combine(RepoRoot, ".nuget", "packages");
_pjDotnet = pjDotnet ?? GetPjDotnetPath();
_stage2Sdk = Directory
.EnumerateDirectories(Path.Combine(_artifacts, "stage2", "sdk"))
.First(d => !d.Contains("NuGetFallbackFolder"));

View file

@ -52,8 +52,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
s_testAssets = new TestAssets(
new DirectoryInfo(assetsRoot),
new FileInfo(new Muxer().MuxerPath),
new FileInfo(new RepoDirectoriesProvider().PjDotnet));
new FileInfo(new Muxer().MuxerPath));
}
return s_testAssets;