Merge remote-tracking branch 'dotnet/release/2.0.0' into merges/release/2.0.0-to-master-20170627-070029
* dotnet/release/2.0.0: (27 commits) Updating the runtime to pick up the satellite assembly host fix. Fixing some merges from release/2.0.0-preview2. Create the Dotnet User Profile folder when running the first experience, if the folder does not exist, if will fail the first run because it will fail to create the first notice sentinel. Add F# and Roslyn satellites Fix tests expecting unlocalized messages from dotnet/sdk Generating a layout folder with the satellite assemblies only which we use to generate a language pack tarball/zip. Initially, I wanted a IncludeOnlyFilter, but couldn't quite get that to work on tar, just passing the filter in the command line didn't work because the shell does not do recursive globbing. So, I opted for the layout folder. Update SPA templates version to 1.0.0-preview-000321 Fix dotnet/sdk#1364 Add rhel and Debian download link Exclude satellite assemblies from archive. Remove failed workaround for Microsoft.Composition warning Update templates to add missing BrowserLink package Update to SetupCrossgen 215 - Coherence 25794 Update templates to suppress the warning for Microsoft.Composition and AssetTargetFallback Add explicit dependency for pakcage smoke test Update templates to remove the package NETStandard.Library.NETFramework Update F# compiler to latest Update to SetupCrossgen 213 - Coherence 25769 Pinning to the dotnet-install to version '2.0.0-preview2-006470' Updating branch/channel information. ...
This commit is contained in:
commit
a5aba4929a
16 changed files with 239 additions and 26 deletions
|
@ -0,0 +1,175 @@
|
|||
// 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.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using FluentAssertions;
|
||||
using Microsoft.DotNet.Cli.Utils;
|
||||
using Microsoft.DotNet.Configurer;
|
||||
using Microsoft.Extensions.DependencyModel.Tests;
|
||||
using Microsoft.Extensions.EnvironmentAbstractions;
|
||||
using Moq;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.DotNet.Configurer.UnitTests
|
||||
{
|
||||
public class GivenAFirstTimeUseNoticeSentinel
|
||||
{
|
||||
private const string DOTNET_USER_PROFILE_FOLDER_PATH = "some path";
|
||||
|
||||
private FileSystemMockBuilder _fileSystemMockBuilder;
|
||||
|
||||
public GivenAFirstTimeUseNoticeSentinel()
|
||||
{
|
||||
_fileSystemMockBuilder = FileSystemMockBuilder.Create();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TheSentinelHasTheCurrentVersionInItsName()
|
||||
{
|
||||
FirstTimeUseNoticeSentinel.SENTINEL.Should().Contain($"{Product.Version}");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItReturnsTrueIfTheSentinelExists()
|
||||
{
|
||||
_fileSystemMockBuilder.AddFiles(DOTNET_USER_PROFILE_FOLDER_PATH, FirstTimeUseNoticeSentinel.SENTINEL);
|
||||
|
||||
var fileSystemMock = _fileSystemMockBuilder.Build();
|
||||
|
||||
var firstTimeUseNoticeSentinel =
|
||||
new FirstTimeUseNoticeSentinel(
|
||||
DOTNET_USER_PROFILE_FOLDER_PATH,
|
||||
fileSystemMock.File,
|
||||
fileSystemMock.Directory);
|
||||
|
||||
firstTimeUseNoticeSentinel.Exists().Should().BeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItReturnsFalseIfTheSentinelDoesNotExist()
|
||||
{
|
||||
var fileSystemMock = _fileSystemMockBuilder.Build();
|
||||
|
||||
var firstTimeUseNoticeSentinel =
|
||||
new FirstTimeUseNoticeSentinel(
|
||||
DOTNET_USER_PROFILE_FOLDER_PATH,
|
||||
fileSystemMock.File,
|
||||
fileSystemMock.Directory);
|
||||
|
||||
firstTimeUseNoticeSentinel.Exists().Should().BeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItCreatesTheSentinelInTheDotnetUserProfileFolderPathIfItDoesNotExistAlready()
|
||||
{
|
||||
var fileSystemMock = _fileSystemMockBuilder.Build();
|
||||
var firstTimeUseNoticeSentinel =
|
||||
new FirstTimeUseNoticeSentinel(
|
||||
DOTNET_USER_PROFILE_FOLDER_PATH,
|
||||
fileSystemMock.File,
|
||||
fileSystemMock.Directory);
|
||||
|
||||
firstTimeUseNoticeSentinel.Exists().Should().BeFalse();
|
||||
|
||||
firstTimeUseNoticeSentinel.CreateIfNotExists();
|
||||
|
||||
firstTimeUseNoticeSentinel.Exists().Should().BeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItDoesNotCreateTheSentinelAgainIfItAlreadyExistsInTheDotnetUserProfileFolderPath()
|
||||
{
|
||||
const string contentToValidateSentinalWasNotReplaced = "some string";
|
||||
var sentinel = Path.Combine(DOTNET_USER_PROFILE_FOLDER_PATH, FirstTimeUseNoticeSentinel.SENTINEL);
|
||||
_fileSystemMockBuilder.AddFile(sentinel, contentToValidateSentinalWasNotReplaced);
|
||||
|
||||
var fileSystemMock = _fileSystemMockBuilder.Build();
|
||||
|
||||
var firstTimeUseNoticeSentinel =
|
||||
new FirstTimeUseNoticeSentinel(
|
||||
DOTNET_USER_PROFILE_FOLDER_PATH,
|
||||
fileSystemMock.File,
|
||||
fileSystemMock.Directory);
|
||||
|
||||
firstTimeUseNoticeSentinel.Exists().Should().BeTrue();
|
||||
|
||||
firstTimeUseNoticeSentinel.CreateIfNotExists();
|
||||
|
||||
fileSystemMock.File.ReadAllText(sentinel).Should().Be(contentToValidateSentinalWasNotReplaced);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItCreatesTheDotnetUserProfileFolderIfItDoesNotExistAlreadyWhenCreatingTheSentinel()
|
||||
{
|
||||
var fileSystemMock = _fileSystemMockBuilder.Build();
|
||||
var directoryMock = new DirectoryMock();
|
||||
var firstTimeUseNoticeSentinel =
|
||||
new FirstTimeUseNoticeSentinel(
|
||||
DOTNET_USER_PROFILE_FOLDER_PATH,
|
||||
fileSystemMock.File,
|
||||
directoryMock);
|
||||
|
||||
firstTimeUseNoticeSentinel.CreateIfNotExists();
|
||||
|
||||
directoryMock.Exists(DOTNET_USER_PROFILE_FOLDER_PATH).Should().BeTrue();
|
||||
directoryMock.CreateDirectoryInvoked.Should().BeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItDoesNotAttemptToCreateTheDotnetUserProfileFolderIfItAlreadyExistsWhenCreatingTheSentinel()
|
||||
{
|
||||
var fileSystemMock = _fileSystemMockBuilder.Build();
|
||||
var directoryMock = new DirectoryMock(new List<string> { DOTNET_USER_PROFILE_FOLDER_PATH });
|
||||
var firstTimeUseNoticeSentinel =
|
||||
new FirstTimeUseNoticeSentinel(
|
||||
DOTNET_USER_PROFILE_FOLDER_PATH,
|
||||
fileSystemMock.File,
|
||||
directoryMock);
|
||||
|
||||
firstTimeUseNoticeSentinel.CreateIfNotExists();
|
||||
|
||||
directoryMock.CreateDirectoryInvoked.Should().BeFalse();
|
||||
}
|
||||
|
||||
private class DirectoryMock : IDirectory
|
||||
{
|
||||
private IList<string> _directories;
|
||||
|
||||
public bool CreateDirectoryInvoked { get; set; }
|
||||
|
||||
public DirectoryMock(IList<string> directories = null)
|
||||
{
|
||||
_directories = directories ?? new List<string>();
|
||||
}
|
||||
|
||||
public bool Exists(string path)
|
||||
{
|
||||
return _directories.Any(d => d == path);
|
||||
}
|
||||
|
||||
public ITemporaryDirectory CreateTemporaryDirectory()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IEnumerable<string> GetFiles(string path, string searchPattern)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public string GetDirectoryFullName(string path)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void CreateDirectory(string path)
|
||||
{
|
||||
_directories.Add(path);
|
||||
CreateDirectoryInvoked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -82,7 +82,7 @@ namespace Microsoft.DotNet.Cli.Build.Tests
|
|||
.WithWorkingDirectory(testInstance.Root)
|
||||
.ExecuteWithCapturedOutput("--no-restore")
|
||||
.Should().Fail()
|
||||
.And.HaveStdOutContaining("project.assets.json' not found.");;
|
||||
.And.HaveStdOutContaining("project.assets.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
@ -197,7 +197,7 @@ namespace Microsoft.DotNet.Tools.Pack.Tests
|
|||
.WithWorkingDirectory(testInstance.Root)
|
||||
.ExecuteWithCapturedOutput("--no-restore")
|
||||
.Should().Fail()
|
||||
.And.HaveStdOutContaining("project.assets.json' not found.");;
|
||||
.And.HaveStdOutContaining("project.assets.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
@ -92,7 +92,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests
|
|||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.ExecuteWithCapturedOutput("--framework netcoreapp2.0 --no-restore")
|
||||
.Should().Fail()
|
||||
.And.HaveStdOutContaining("project.assets.json' not found.");;
|
||||
.And.HaveStdOutContaining("project.assets.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
@ -87,7 +87,7 @@ namespace Microsoft.DotNet.Cli.Run.Tests
|
|||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.ExecuteWithCapturedOutput("--no-restore")
|
||||
.Should().Fail()
|
||||
.And.HaveStdOutContaining("project.assets.json' not found.");;
|
||||
.And.HaveStdOutContaining("project.assets.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
@ -73,7 +73,7 @@ namespace Microsoft.DotNet.Cli.Test.Tests
|
|||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.ExecuteWithCapturedOutput($"{TestBase.ConsoleLoggerOutputNormal} --no-restore")
|
||||
.Should().Fail()
|
||||
.And.HaveStdOutContaining("project.assets.json' not found.");;
|
||||
.And.HaveStdOutContaining("project.assets.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue