Skip to content

Commit 671e175

Browse files
committed
Test
1 parent 0ba585a commit 671e175

5 files changed

Lines changed: 65 additions & 183 deletions

File tree

build.cake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ Task("Test")
8787
{
8888
DotNetCoreTest(project.FullPath, new DotNetCoreTestSettings
8989
{
90-
Configuration = configuration,
91-
Verbosity = DotNetCoreVerbosity.Normal
90+
Configuration = configuration//,
91+
//Verbosity = DotNetCoreVerbosity.Normal
9292
});
9393

9494
// if (IsRunningOnWindows())

build.ps1

Lines changed: 39 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,10 @@
1-
<#
2-
.SYNOPSIS
3-
This is a Powershell script to bootstrap a Cake build.
4-
.DESCRIPTION
5-
This Powershell script will download NuGet if missing, restore NuGet tools (including Cake)
6-
and execute your Cake build script with the parameters you provide.
7-
.PARAMETER Configuration
8-
The build configuration to use.
9-
.PARAMETER Verbosity
10-
Specifies the amount of information to be displayed.
11-
.PARAMETER WhatIf
12-
Performs a dry run of the build script.
13-
No tasks will be executed.
14-
.PARAMETER ScriptArgs
15-
Remaining arguments are added here.
16-
.LINK
17-
https://cakebuild.net
18-
#>
19-
20-
[CmdletBinding()]
21-
Param(
22-
[ValidateSet("Release", "Debug")]
23-
[string]$Configuration = "Release",
24-
[ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")]
25-
[string]$Verbosity = "Verbose",
26-
[switch]$WhatIf,
27-
[Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)]
28-
[string[]]$ScriptArgs
29-
)
30-
31-
$CakeVersion = "0.26.1"
32-
$DotNetChannel = "Current";
1+
$CakeVersion = "0.17.0"
332
$DotNetVersion = "1.0.1";
34-
$DotNetInstallerUri = "https://dot.net/v1/dotnet-install.ps1";
35-
$NugetUrl = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
36-
37-
# Temporarily skip verification of addins.
38-
$ENV:CAKE_SETTINGS_SKIPVERIFICATION='true'
3+
$DotNetInstallerUri = "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.1/scripts/obtain/dotnet-install.ps1";
394

405
# Make sure tools folder exists
41-
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
6+
$PSScriptRoot = $pwd
7+
428
$ToolPath = Join-Path $PSScriptRoot "tools"
439
if (!(Test-Path $ToolPath)) {
4410
Write-Verbose "Creating tools directory..."
@@ -49,81 +15,62 @@ if (!(Test-Path $ToolPath)) {
4915
# INSTALL .NET CORE CLI
5016
###########################################################################
5117

52-
Function Remove-PathVariable([string]$VariableToRemove)
53-
{
54-
$path = [Environment]::GetEnvironmentVariable("PATH", "User")
55-
if ($path -ne $null)
56-
{
57-
$newItems = $path.Split(';', [StringSplitOptions]::RemoveEmptyEntries) | Where-Object { "$($_)" -inotlike $VariableToRemove }
58-
[Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "User")
59-
}
60-
61-
$path = [Environment]::GetEnvironmentVariable("PATH", "Process")
62-
if ($path -ne $null)
63-
{
64-
$newItems = $path.Split(';', [StringSplitOptions]::RemoveEmptyEntries) | Where-Object { "$($_)" -inotlike $VariableToRemove }
65-
[Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "Process")
66-
}
67-
}
68-
6918
# Get .NET Core CLI path if installed.
7019
$FoundDotNetCliVersion = $null;
7120
if (Get-Command dotnet -ErrorAction SilentlyContinue) {
7221
$FoundDotNetCliVersion = dotnet --version;
7322
}
7423

75-
if($FoundDotNetCliVersion -ne $DotNetVersion) {
76-
$InstallPath = Join-Path $PSScriptRoot ".dotnet"
77-
if (!(Test-Path $InstallPath)) {
78-
mkdir -Force $InstallPath | Out-Null;
79-
}
80-
(New-Object System.Net.WebClient).DownloadFile($DotNetInstallerUri, "$InstallPath\dotnet-install.ps1");
81-
& $InstallPath\dotnet-install.ps1 -Channel $DotNetChannel -Version $DotNetVersion -InstallDir $InstallPath;
24+
#if($FoundDotNetCliVersion -ne $DotNetVersion) {
25+
# $InstallPath = Join-Path $PSScriptRoot ".dotnet"
26+
# if (!(Test-Path $InstallPath)) {
27+
# mkdir -Force $InstallPath | Out-Null;
28+
# }
29+
# (New-Object System.Net.WebClient).DownloadFile($DotNetInstallerUri, "$InstallPath\dotnet-install.ps1");
30+
# & $InstallPath\dotnet-install.ps1 -Channel preview -Version $DotNetVersion -InstallDir $InstallPath;
8231

83-
Remove-PathVariable "$InstallPath"
84-
$env:PATH = "$InstallPath;$env:PATH"
85-
}
32+
# $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
33+
# $env:DOTNET_CLI_TELEMETRY_OPTOUT=1
8634

87-
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
88-
$env:DOTNET_CLI_TELEMETRY_OPTOUT=1
35+
# & dotnet --info
36+
#}
8937

9038
###########################################################################
91-
# INSTALL NUGET
39+
# INSTALL CAKE
9240
###########################################################################
9341

94-
# Make sure nuget.exe exists.
95-
$NugetPath = Join-Path $ToolPath "nuget.exe"
96-
if (!(Test-Path $NugetPath)) {
97-
Write-Host "Downloading NuGet.exe..."
98-
(New-Object System.Net.WebClient).DownloadFile($NugetUrl, $NugetPath);
42+
Add-Type -AssemblyName System.IO.Compression.FileSystem
43+
Function Unzip {
44+
param([string]$zipfile, [string]$outpath)
45+
46+
[System.IO.Compression.ZipFile]::ExtractToDirectory($zipfile, $outpath)
9947
}
10048

101-
###########################################################################
102-
# INSTALL CAKE
103-
###########################################################################
10449

10550
# Make sure Cake has been installed.
106-
$CakePath = Join-Path $ToolPath "Cake.$CakeVersion/Cake.exe"
51+
$CakePath = Join-Path $ToolPath "Cake.CoreCLR.$CakeVersion/Cake.dll"
10752
if (!(Test-Path $CakePath)) {
10853
Write-Host "Installing Cake..."
109-
Invoke-Expression "&`"$NugetPath`" install Cake -Version $CakeVersion -OutputDirectory `"$ToolPath`"" | Out-Null;
110-
if ($LASTEXITCODE -ne 0) {
111-
Throw "An error occurred while restoring Cake from NuGet."
112-
}
54+
(New-Object System.Net.WebClient).DownloadFile("https://www.nuget.org/api/v2/package/Cake.CoreCLR/$CakeVersion", "$ToolPath\Cake.CoreCLR.zip")
55+
Unzip "$ToolPath\Cake.CoreCLR.zip" "$ToolPath/Cake.CoreCLR.$CakeVersion"
56+
Remove-Item "$ToolPath\Cake.CoreCLR.zip"
57+
}
58+
59+
###########################################################################
60+
# INSTALL NUGET
61+
###########################################################################
62+
63+
# Make sure NuGet has been installed.
64+
$NugetPath = Join-Path $PSScriptRoot ".nuget/nuget.exe"
65+
if (!(Test-Path $NugetPath)) {
66+
Write-Host "Installing Nuget..."
67+
(New-Object System.Net.WebClient).DownloadFile("https://www.nuget.org/nuget.exe", $NugetPath)
68+
& "$NugetPath" update -self
11369
}
11470

11571
###########################################################################
11672
# RUN BUILD SCRIPT
11773
###########################################################################
11874

119-
# Build the argument list.
120-
$Arguments = @{
121-
configuration=$Configuration;
122-
verbosity=$Verbosity;
123-
dryrun=$WhatIf;
124-
}.GetEnumerator() | %{"--{0}=`"{1}`"" -f $_.key, $_.value };
125-
126-
# Start Cake
127-
Write-Host "Running build script..."
128-
Invoke-Expression "& `"$CakePath`" `"build.cake`" $Arguments $ScriptArgs"
129-
exit $LASTEXITCODE
75+
& dotnet "$CakePath" $args
76+
exit $LASTEXITCODE

build.sh

Lines changed: 20 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,31 @@
1-
#!/usr/bin/env bash
2-
##########################################################################
3-
# This is the Cake bootstrapper script for Linux and OS X.
4-
# This file was downloaded from https://github.com/cake-build/resources
5-
# Feel free to change this file to fit your needs.
6-
##########################################################################
1+
#!/bin/bash
72

8-
# Define directories.
9-
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
10-
TOOLS_DIR=$SCRIPT_DIR/tools
11-
NUGET_EXE=$TOOLS_DIR/nuget.exe
12-
NUGET_URL=https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
13-
CAKE_VERSION=0.26.1
14-
CAKE_EXE=$TOOLS_DIR/Cake.$CAKE_VERSION/Cake.exe
15-
16-
# Temporarily skip verification of addins.
17-
export CAKE_SETTINGS_SKIPVERIFICATION='true'
18-
19-
# Define default arguments.
20-
TARGET="Travis"
21-
CONFIGURATION="Release"
22-
VERBOSITY="verbose"
23-
DRYRUN=
24-
SCRIPT_ARGUMENTS=()
25-
26-
# Parse arguments.
27-
for i in "$@"; do
28-
case $1 in
29-
-t|--target) TARGET="$2"; shift ;;
30-
-c|--configuration) CONFIGURATION="$2"; shift ;;
31-
-v|--verbosity) VERBOSITY="$2"; shift ;;
32-
-d|--dryrun) DRYRUN="-dryrun" ;;
33-
--) shift; SCRIPT_ARGUMENTS+=("$@"); break ;;
34-
*) SCRIPT_ARGUMENTS+=("$1") ;;
35-
esac
36-
shift
37-
done
38-
39-
# Make sure the tools folder exist.
40-
if [ ! -d "$TOOLS_DIR" ]; then
41-
mkdir "$TOOLS_DIR"
3+
SCRIPT_PATH="${BASH_SOURCE[0]}";
4+
if ([ -h "${SCRIPT_PATH}" ]) then
5+
while([ -h "${SCRIPT_PATH}" ]) do SCRIPT_PATH=`readlink "${SCRIPT_PATH}"`; done
426
fi
43-
44-
###########################################################################
45-
# INSTALL .NET CORE CLI
46-
###########################################################################
47-
48-
echo "Installing .NET CLI..."
49-
if [ ! -d "$SCRIPT_DIR/.dotnet" ]; then
50-
mkdir "$SCRIPT_DIR/.dotnet"
7+
pushd . > /dev/null
8+
cd `dirname ${SCRIPT_PATH}` > /dev/null
9+
SCRIPT_PATH=`pwd`;
10+
popd > /dev/null
11+
12+
if ! [ -f $SCRIPT_PATH/.nuget/nuget.exe ]
13+
then
14+
wget "https://www.nuget.org/nuget.exe" -P $SCRIPT_PATH/.nuget/
5115
fi
52-
curl -Lsfo "$SCRIPT_DIR/.dotnet/dotnet-install.sh" https://dot.net/v1/dotnet-install.sh
53-
sudo bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --version 1.0.1 --install-dir .dotnet --no-path
54-
export PATH="$SCRIPT_DIR/.dotnet":$PATH
55-
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
56-
export DOTNET_CLI_TELEMETRY_OPTOUT=1
57-
"$SCRIPT_DIR/.dotnet/dotnet" --info
5816

59-
###########################################################################
60-
# INSTALL NUGET
61-
###########################################################################
17+
mono $SCRIPT_PATH/.nuget/nuget.exe update -self
6218

63-
# Download NuGet if it does not exist.
64-
if [ ! -f "$NUGET_EXE" ]; then
65-
echo "Downloading NuGet..."
66-
curl -Lsfo "$NUGET_EXE" $NUGET_URL
67-
if [ $? -ne 0 ]; then
68-
echo "An error occurred while downloading nuget.exe."
69-
exit 1
70-
fi
71-
fi
19+
mono $SCRIPT_PATH/.nuget/nuget.exe install FAKE -OutputDirectory $SCRIPT_PATH/packages -ExcludeVersion -Version 4.25.4
7220

73-
###########################################################################
74-
# INSTALL CAKE
75-
###########################################################################
21+
mono $SCRIPT_PATH/.nuget/nuget.exe install xunit.runners -OutputDirectory $SCRIPT_PATH/packages/FAKE -ExcludeVersion -Version 2.1.0
22+
mono $SCRIPT_PATH/.nuget/nuget.exe install NBench.Runner -OutputDirectory packages -ExcludeVersion -Version 0.2.2
7623

77-
if [ ! -f "$CAKE_EXE" ]; then
78-
mono "$NUGET_EXE" install Cake -Version $CAKE_VERSION -OutputDirectory "$TOOLS_DIR"
79-
if [ $? -ne 0 ]; then
80-
echo "An error occured while installing Cake."
81-
exit 1
82-
fi
83-
fi
24+
if ! [ -e $SCRIPT_PATH/packages/SourceLink.Fake/tools/SourceLink.fsx ] ; then
25+
mono $SCRIPT_PATH/.nuget/nuget.exe install SourceLink.Fake -OutputDirectory $SCRIPT_PATH/packages -ExcludeVersion
8426

85-
# Make sure that Cake has been installed.
86-
if [ ! -f "$CAKE_EXE" ]; then
87-
echo "Could not find Cake.exe at '$CAKE_EXE'."
88-
exit 1
8927
fi
9028

91-
###########################################################################
92-
# RUN BUILD SCRIPT
93-
###########################################################################
29+
export encoding=utf-8
9430

95-
# Start Cake
96-
exec mono "$CAKE_EXE" build.cake --verbosity=$VERBOSITY --configuration=$CONFIGURATION --target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}"
31+
mono $SCRIPT_PATH/packages/FAKE/tools/FAKE.exe build.fsx "$@"

test/DotNetty.Common.Tests/Internal/Logging/InternalLoggerFactoryTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ namespace DotNetty.Common.Tests.Internal.Logging
1515
[CollectionDefinition(nameof(InternalLoggerFactoryTest), DisableParallelization = true)]
1616
public class InternalLoggerFactoryTest
1717
{
18-
protected readonly ITestOutputHelper Output;
18+
/*protected readonly ITestOutputHelper Output;
1919
2020
public InternalLoggerFactoryTest(ITestOutputHelper output)
2121
{
2222
this.Output = output;
23-
}
23+
}*/
2424
// todo: CodeContracts on CI
2525
//[Fact]
2626
//public void ShouldNotAllowNullDefaultFactory()
@@ -58,7 +58,7 @@ public void TestMockReturned()
5858
//Assert.True(false, "To See The Log");
5959
}
6060

61-
IDisposable SetupMockLogger(out Mock<ILogger> loggerMock)
61+
static IDisposable SetupMockLogger(out Mock<ILogger> loggerMock)
6262
{
6363
ILoggerFactory oldLoggerFactory = InternalLoggerFactory.DefaultFactory;
6464
//Output.WriteLine($"SetupMockLogger,oldLoggerFactory={RuntimeHelpers.GetHashCode(oldLoggerFactory)}");

test/DotNetty.Common.Tests/Utilities/HashedWheelTimerTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void TestScheduleTimeoutShouldRunAfterDelay()
5454
[Fact] // (timeout = 3000)
5555
public void TestStopTimer()
5656
{
57-
Output.WriteLine($"{System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(DotNetty.Common.Internal.Logging.InternalLoggerFactory.DefaultFactory)}");
57+
//Output.WriteLine($"{System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(DotNetty.Common.Internal.Logging.InternalLoggerFactory.DefaultFactory)}");
5858
var latch = new CountdownEvent(3);
5959
ITimer timerProcessed = new HashedWheelTimer();
6060
for (int i = 0; i < 3; i++)

0 commit comments

Comments
 (0)