Skip to content

Commit

Permalink
Run tests for .NET Core 2.0 and 2.1; Package upgrades (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
cwe1ss authored Sep 10, 2018
1 parent 127edfb commit 35617ca
Show file tree
Hide file tree
Showing 15 changed files with 72 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# AppVeyor Build number is incremental and not related to actual version number of the product
version: '{build}'

image: Visual Studio 2017 Preview
image: Visual Studio 2017

init:
- cmd: git config --global core.autocrlf true
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ matrix:
dist: trusty
sudo: required
mono: none
dotnet: 2.1.300-preview2-008533
dotnet: 2.1.401
addons:
apt:
sources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.10.13" />
<PackageReference Include="BenchmarkDotNet" Version="0.11.1" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.0" />
<PackageReference Include="NSubstitute" Version="3.1.0" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "2.1.300"
"version": "2.1.401"
}
}
24 changes: 16 additions & 8 deletions launch-sample.ps1
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
[CmdletBinding(PositionalBinding = $false)]
param(
[string] $Framework = "netcoreapp2.1"
)

dotnet build
if ($LASTEXITCODE -ne 0) { throw "build error" }

Write-Host "Launching samples with framework $Framework"

Start-Process `
-FilePath powershell.exe `
-ArgumentList @( "dotnet run --no-restore --no-build; Read-Host 'Press enter to exit'" ) `
-ArgumentList @( "dotnet run -f $Framework --no-build; Read-Host 'Press enter to exit'" ) `
-WorkingDirectory "samples\CustomersApi"

Start-Process `
-FilePath powershell.exe `
-ArgumentList @( "dotnet run --no-restore --no-build; Read-Host 'Press enter to exit'" ) `
-ArgumentList @( "dotnet run -f $Framework --no-build; Read-Host 'Press enter to exit'" ) `
-WorkingDirectory "samples\OrdersApi"

Start-Sleep -Seconds 2

Start-Process `
-FilePath powershell.exe `
-ArgumentList @( "dotnet run --no-restore --no-build; Read-Host 'Press enter to exit'" ) `
-ArgumentList @( "dotnet run -f $Framework --no-build; Read-Host 'Press enter to exit'" ) `
-WorkingDirectory "samples\FrontendWeb"

Start-Process `
-FilePath powershell.exe `
-ArgumentList @( "dotnet run --no-restore --no-build; Read-Host 'Press enter to exit'" ) `
-WorkingDirectory "samples\TrafficGenerator"

if ($Framework -ne "netcoreapp2.0") {
Start-Process `
-FilePath powershell.exe `
-ArgumentList @( "dotnet run -f $Framework --no-build; Read-Host 'Press enter to exit'" ) `
-WorkingDirectory "samples\TrafficGenerator"
}
10 changes: 7 additions & 3 deletions samples/CustomersApi/CustomersApi.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFrameworks>netcoreapp2.0;netcoreapp2.1</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Shared\Shared.csproj" />
<ProjectReference Include="..\..\src\OpenTracing.Contrib.NetCore\OpenTracing.Contrib.NetCore.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.8" />
<ItemGroup Condition="$(TargetFramework)=='netcoreapp2.0'">
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.9" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework)=='netcoreapp2.1'">
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.3" />
</ItemGroup>

</Project>
7 changes: 3 additions & 4 deletions samples/CustomersApi/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ public class Program
{
public static void Main(string[] args)
{
BuildWebHost(args).Run();
CreateWebHostBuilder(args).Build().Run();
}

public static IWebHost BuildWebHost(string[] args)
public static IWebHostBuilder CreateWebHostBuilder(string[] args)
{
return WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
Expand All @@ -24,8 +24,7 @@ public static IWebHost BuildWebHost(string[] args)

// Enables OpenTracing instrumentation for ASP.NET Core, CoreFx, EF Core
services.AddOpenTracing();
})
.Build();
});
}
}
}
10 changes: 7 additions & 3 deletions samples/FrontendWeb/FrontendWeb.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFrameworks>netcoreapp2.0;netcoreapp2.1</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Shared\Shared.csproj" />
<ProjectReference Include="..\..\src\OpenTracing.Contrib.NetCore\OpenTracing.Contrib.NetCore.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.8" />
<ItemGroup Condition="$(TargetFramework)=='netcoreapp2.0'">
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.9" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework)=='netcoreapp2.1'">
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.3" />
</ItemGroup>

</Project>
7 changes: 3 additions & 4 deletions samples/FrontendWeb/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ public class Program
{
public static void Main(string[] args)
{
BuildWebHost(args).Run();
CreateWebHostBuilder(args).Build().Run();
}

public static IWebHost BuildWebHost(string[] args)
public static IWebHostBuilder CreateWebHostBuilder(string[] args)
{
return WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
Expand All @@ -24,8 +24,7 @@ public static IWebHost BuildWebHost(string[] args)

// Enables OpenTracing instrumentation for ASP.NET Core, CoreFx, EF Core
services.AddOpenTracing();
})
.Build();
});
}
}
}
10 changes: 7 additions & 3 deletions samples/OrdersApi/OrdersApi.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFrameworks>netcoreapp2.0;netcoreapp2.1</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Shared\Shared.csproj" />
<ProjectReference Include="..\..\src\OpenTracing.Contrib.NetCore\OpenTracing.Contrib.NetCore.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.8" />
<ItemGroup Condition="$(TargetFramework)=='netcoreapp2.0'">
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.9" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework)=='netcoreapp2.1'">
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.3" />
</ItemGroup>

</Project>
7 changes: 3 additions & 4 deletions samples/OrdersApi/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ public class Program
{
public static void Main(string[] args)
{
BuildWebHost(args).Run();
CreateWebHostBuilder(args).Build().Run();
}

public static IWebHost BuildWebHost(string[] args)
public static IWebHostBuilder CreateWebHostBuilder(string[] args)
{
return WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
Expand All @@ -24,8 +24,7 @@ public static IWebHost BuildWebHost(string[] args)

// Enables OpenTracing instrumentation for ASP.NET Core, CoreFx, EF Core
services.AddOpenTracing();
})
.Build();
});
}
}
}
4 changes: 2 additions & 2 deletions samples/Shared/Shared.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFrameworks>netcoreapp2.0;netcoreapp2.1</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\OpenTracing.Contrib.NetCore\OpenTracing.Contrib.NetCore.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Jaeger" Version="0.0.10" />
<PackageReference Include="Jaeger" Version="0.2.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="2.0.3" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.0.2" />
Expand Down
10 changes: 5 additions & 5 deletions samples/TrafficGenerator/TrafficGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="2.1.0-rc1-final" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.1.0-rc1-final" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="2.1.0-rc1-final" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="2.1.0-rc1-final" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.1.0-rc1-final" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.1.1" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="SourceLink.Create.GitHub" Version="2.8.1" PrivateAssets="All" />
<DotNetCliToolReference Include="dotnet-sourcelink" Version="2.8.1" />
<DotNetCliToolReference Include="dotnet-sourcelink-git" Version="2.8.1" />
<PackageReference Include="SourceLink.Create.GitHub" Version="2.8.3" PrivateAssets="All" />
<DotNetCliToolReference Include="dotnet-sourcelink" Version="2.8.3" />
<DotNetCliToolReference Include="dotnet-sourcelink-git" Version="2.8.3" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFrameworks>netcoreapp2.0;netcoreapp2.1</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageReference Include="NSubstitute" Version="3.1.0" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework)=='netcoreapp2.0'">
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.9" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework)=='netcoreapp2.1'">
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.3" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 35617ca

Please sign in to comment.