Skip to content

Commit e4afc9a

Browse files
committed
BuildServerDetector.Detected also set for tests running in Dockerfile
fixes #226
1 parent d7ab0a2 commit e4afc9a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/DiffEngine/BuildServerDetector.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ static BuildServerDetector()
7676
Detected = true;
7777
return;
7878
}
79+
80+
// Docker
81+
// https://www.hanselman.com/blog/detecting-that-a-net-core-app-is-running-in-a-docker-container-and-skippablefacts-in-xunit
82+
if (Environment.GetEnvironmentVariable("DOTNET_RUNNING_IN_CONTAINER") == "true")
83+
{
84+
Detected = true;
85+
return;
86+
}
7987
}
8088

8189
public static bool Detected { get; set; }

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project>
33
<PropertyGroup>
44
<NoWarn>CS1591;CS0649</NoWarn>
5-
<Version>6.8.0</Version>
5+
<Version>6.8.1</Version>
66
<AssemblyVersion>1.0.0</AssemblyVersion>
77
<PackageTags>Testing, Snapshot, Diff, Compare</PackageTags>
88
<Description>Launches diff tools based on file extensions. Designed to be consumed by snapshot testing libraries.</Description>

0 commit comments

Comments
 (0)