Commit 236f3b1 1 parent 1ebe3b6 commit 236f3b1 Copy full SHA for 236f3b1
File tree 4 files changed +16
-13
lines changed
Codeuctivity.HtmlRenderer
Codeuctivity.HtmlRendererCliTests
Codeuctivity.HtmlRendererTests
4 files changed +16
-13
lines changed Original file line number Diff line number Diff line change 2
2
"name" : "C# (.NET)" ,
3
3
"image" : "mcr.microsoft.com/devcontainers/dotnet:0-7.0" ,
4
4
"features" : {
5
- "ghcr.io/devcontainers/features/node:1" : {
6
- "version" : "lts"
7
- }
5
+ "ghcr.io/devcontainers/features/node:1" : { } ,
6
+ "ghcr.io/devcontainers/features/common-utils:1" : { }
8
7
} ,
9
8
"customizations" : {
10
9
"vscode" : {
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ private async Task<Renderer> InitializeAsync(BrowserFetcher browserFetcher)
65
65
66
66
private LaunchOptions SystemSpecificConfig ( )
67
67
{
68
- if ( string . IsNullOrEmpty ( LaunchOptions ) && ( IsRunningOnWsl ( ) || IsRunningOnAzureLinux ( ) ) )
68
+ if ( string . IsNullOrEmpty ( LaunchOptions ) && ( IsRunningOnWslOrAzure ( ) || IsRunningOnAzureLinux ( ) ) )
69
69
{
70
70
return new LaunchOptions { Headless = true , Args = new string [ ] { "--no-sandbox" } } ;
71
71
}
@@ -85,16 +85,18 @@ private static bool IsRunningOnAzureLinux()
85
85
return RuntimeInformation . IsOSPlatform ( OSPlatform . Linux ) && websiteSku . IndexOf ( "Linux" , StringComparison . OrdinalIgnoreCase ) >= 0 ;
86
86
}
87
87
88
- private static bool IsRunningOnWsl ( )
88
+ private static bool IsRunningOnWslOrAzure ( )
89
89
{
90
90
if ( ! RuntimeInformation . IsOSPlatform ( OSPlatform . Linux ) )
91
91
{
92
92
return false ;
93
93
}
94
94
95
95
var version = File . ReadAllText ( "/proc/version" ) ;
96
- var IsWsl = version . IndexOf ( "Microsoft" , StringComparison . OrdinalIgnoreCase ) >= 0 ;
97
- return IsWsl ;
96
+ var IsAzure = version . IndexOf ( "Microsoft" , StringComparison . OrdinalIgnoreCase ) >= 0 ;
97
+ var IsWsl = version . IndexOf ( "azure" , StringComparison . OrdinalIgnoreCase ) >= 0 ;
98
+
99
+ return IsWsl || IsAzure ;
98
100
}
99
101
100
102
/// <summary>
Original file line number Diff line number Diff line change 7
7
</PropertyGroup >
8
8
9
9
<ItemGroup >
10
- <PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 17.3.2 " />
11
- <PackageReference Include =" SonarAnalyzer.CSharp" Version =" 8.46 .0.54807 " >
10
+ <PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 17.4.0 " />
11
+ <PackageReference Include =" SonarAnalyzer.CSharp" Version =" 8.48 .0.56517 " >
12
12
<IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
13
13
<PrivateAssets >all</PrivateAssets >
14
14
</PackageReference >
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ public async Task ShouldConvertHtmlToPdf(string testFileName)
33
33
34
34
using var rasterize = new Rasterizer ( ) ;
35
35
36
- if ( ! IsRunningOnWsl ( ) )
36
+ if ( ! IsRunningOnWslOrAzure ( ) )
37
37
{
38
38
var actualImages = await rasterize . ConvertToPngAsync ( actualFilePath , actualImagePathDirectory ) ;
39
39
Assert . Single ( actualImages ) ;
@@ -43,16 +43,18 @@ public async Task ShouldConvertHtmlToPdf(string testFileName)
43
43
await ChromiumProcessDisposedAsserter . AssertNoChromeProcessIsRunning ( ) ;
44
44
}
45
45
46
- private static bool IsRunningOnWsl ( )
46
+ private static bool IsRunningOnWslOrAzure ( )
47
47
{
48
48
if ( ! RuntimeInformation . IsOSPlatform ( OSPlatform . Linux ) )
49
49
{
50
50
return false ;
51
51
}
52
52
53
53
var version = File . ReadAllText ( "/proc/version" ) ;
54
- var IsWsl = version . Contains ( "Microsoft" , StringComparison . InvariantCultureIgnoreCase ) ;
55
- return IsWsl ;
54
+ var IsAzure = version . IndexOf ( "Microsoft" , StringComparison . OrdinalIgnoreCase ) >= 0 ;
55
+ var IsWsl = version . IndexOf ( "azure" , StringComparison . OrdinalIgnoreCase ) >= 0 ;
56
+
57
+ return IsWsl || IsAzure ;
56
58
}
57
59
58
60
[ Theory ]
You can’t perform that action at this time.
0 commit comments