Skip to content
Permalink
Browse files

Removed net compatibility due issues with: dotnet/standard/issues/567.

  • Loading branch information...
HofmeisterAn committed Feb 27, 2019
1 parent df4a59c commit 7aea1bd86070d3eac30714a3c9cd3ef5adcb725d
@@ -3,7 +3,7 @@
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=dotnet-testcontainers&metric=coverage)](https://sonarcloud.io/dashboard?id=dotnet-testcontainers)

# .NET Testcontainers
.NET Testcontainers is a library to support tests with throwaway instances of Docker containers for `netstandard2.0`, `net452` and `net462`. The library is built on top of the .NET Docker remote API and provides a lightweight implementation to support your test environment in all circumstances.
.NET Testcontainers is a library to support tests with throwaway instances of Docker containers for all compatible .NET Standard versions. The library is built on top of the .NET Docker remote API and provides a lightweight implementation to support your test environment in all circumstances.

Choose from existing pre-configured configurations [^1] and start containers within a second, to support and run your tests.

@@ -6,7 +6,7 @@ variables:
jobs:
- job: 'Build'
pool:
vmImage: 'vs2017-win2016'
vmImage: 'ubuntu-16.04'
steps:
- task: DotNetCoreInstaller@0
displayName: 'Use .NET Core SDK $(dotNetCoreVersion)'
@@ -23,31 +23,25 @@ jobs:
echo "##vso[task.setvariable variable=sonarcloudOrganization;]$(sonarcloud.organization)"
echo "##vso[task.setvariable variable=nuGetSource;]$(feed.source)"
echo "##vso[task.setvariable variable=nuGetApiKey;]$(feed.apikey)"
# Set Docker configuration, until Unix containers are supported native
Net stop docker
@{experimental=$true} | ConvertTo-Json | Out-File -FilePath C:\ProgramData\Docker\config\daemon.json
Net start docker
docker pull --platform linux alpine:latest
docker pull --platform linux nginx:latest
# Prepare build
./build.ps1 --target=Restore-NuGet-Packages
./build.sh --target=Restore-NuGet-Packages
displayName: 'Prepare'
- powershell: ./build.ps1 --target=Build
- powershell: ./build.sh --target=Build
displayName: 'Build'

- powershell: ./build.ps1 --target=Test
- powershell: ./build.sh --target=Test
displayName: 'Test'

- powershell: ./build.ps1 --target=Sonar
- powershell: ./build.sh --target=Sonar
displayName: 'Sonar'
env:
SONARQUBE_URL: $(sonarcloudUrl)
SONARQUBE_KEY: $(sonarcloudKey)
SONARQUBE_TOKEN: $(sonarcloudToken)
SONARQUBE_ORGANIZATION: $(sonarcloudOrganization)

- powershell: ./build.ps1 --target=Publish
- powershell: ./build.sh --target=Publish
displayName: 'Publish'
env:
NUGET_SOURCE: $(nuGetSource)
@@ -6,7 +6,7 @@

#load "./build/parameters.cake"

BuildParameters param = BuildParameters.Instance(Context, "DotNet.Testcontainers");
readonly var param = BuildParameters.Instance(Context, "DotNet.Testcontainers");

Setup(context =>
{
@@ -93,21 +93,6 @@ Task("Test")
}
});

Task("Copy-Artifacts")
.Does(() =>
{
DotNetCorePublish(param.Projects.TestContainers.Path.FullPath, new DotNetCorePublishSettings
{
Configuration = param.Configuration,
Verbosity = param.Verbosity,
NoRestore = true,
Framework = "netstandard2.0",
OutputDirectory = param.Paths.Directories.ArtifactsBinStandard
});

CopyFileToDirectory("./LICENSE", param.Paths.Directories.ArtifactsBinStandard);
});

Task("SonarBegin")
.WithCriteria(() => param.ShouldPublish)
.Does(() =>
@@ -181,7 +166,6 @@ Task("Sonar")
.IsDependentOn("SonarEnd");

Task("Publish")
.IsDependentOn("Copy-Artifacts")
.IsDependentOn("Create-NuGet-Packages")
.IsDependentOn("Publish-NuGet-Packages");

This file was deleted.

This file was deleted.

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net452;net462</TargetFrameworks>
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
@@ -8,11 +8,7 @@ internal class DockerApiClient
{
#pragma warning disable S1075

#if NET452 || NET462
protected static readonly Uri Endpoint = new Uri("npipe://./pipe/docker_engine");
#else
protected static readonly Uri Endpoint = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? new Uri("npipe://./pipe/docker_engine") : new Uri("unix:/var/run/docker.sock");
#endif

#pragma warning restore S1075

@@ -77,9 +77,6 @@ public string Run(TestcontainersConfiguration configuration)

var name = configuration.Container.Name;

Console.WriteLine(image);
Console.WriteLine(image);

lock (IsImageAvailableLock)
{
if (!MetaDataClientImages.Instance.ExistsWithName(image))
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net452;net462</TargetFrameworks>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Docker.DotNet" Version="3.125.2" />
@@ -1,5 +1,5 @@
{
"$schema": "https://xunit.github.io/schema/current/xunit.runner.schema.json",
"parallelizeAssembly": false,
"parallelizeTestCollections": false
"parallelizeAssembly": true,
"parallelizeTestCollections": true
}

0 comments on commit 7aea1bd

Please sign in to comment.
You can’t perform that action at this time.