Skip to content

Commit c887a18

Browse files
committed
Added static files test
1 parent d32a3be commit c887a18

File tree

11 files changed

+18
-5
lines changed

11 files changed

+18
-5
lines changed

src/Benchmarks/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ public static void Main(string[] args)
1717
{
1818
var hostingConfig = new ConfigurationBuilder()
1919
.AddJsonFile("hosting.json", optional: true)
20+
.AddEnvironmentVariables()
21+
.AddEnvironmentVariables(prefix: "ASPNET_")
2022
.AddCommandLine(args)
2123
.Build();
2224

src/Benchmarks/Properties/launchSettings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
},
1919
"Benchmarks": {
2020
"commandName": "Benchmarks",
21-
"commandLineArgs": "--app.EnableDbTests=true",
21+
"commandLineArgs": "--app.EnableDbTests=true --app.EnableStaticFileTests=true",
22+
"launchBrowser": true,
23+
"launchUrl": "http://localhost:5001/",
2224
"environmentVariables": {
2325
"AspNet_Environment": "Development"
2426
}

src/Benchmarks/Startup.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ public void Configure(IApplicationBuilder app)
9393

9494
app.UseMvc();
9595

96+
if (StartupOptions.EnableStaticFileTests)
97+
{
98+
app.UseStaticFiles();
99+
Console.WriteLine("Static file tests enabled");
100+
}
101+
96102
app.Run(context => context.Response.WriteAsync("Try /plaintext instead"));
97103
}
98104

@@ -109,6 +115,8 @@ public class Options
109115
{
110116
public bool EnableDbTests { get; set; }
111117

118+
public bool EnableStaticFileTests { get; set; }
119+
112120
public string ConnectionString { get; set; }
113121
}
114122
}

src/Benchmarks/project.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
},
88

99
"dependencies": {
10+
"Dapper": "1.50.0-*",
11+
"EntityFramework.Commands": "7.0.0-*",
12+
"EntityFramework.MicrosoftSqlServer": "7.0.0-*",
1013
"Microsoft.AspNet.Mvc": "6.0.0-*",
1114
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*",
1215
"Microsoft.AspNet.Server.WebListener": "1.0.0-*",
16+
"Microsoft.AspNet.StaticFiles": "1.0.0-*",
1317
"Microsoft.Extensions.WebEncoders": "1.0.0-*",
14-
"EntityFramework.Commands": "7.0.0-*",
15-
"EntityFramework.MicrosoftSqlServer": "7.0.0-*",
16-
"Newtonsoft.Json": "7.0.1",
17-
"Dapper": "1.50.0-*"
18+
"Newtonsoft.Json": "7.0.1"
1819
},
1920

2021
"commands": {

src/Benchmarks/wwwroot/128B.txt

128 Bytes
Binary file not shown.

src/Benchmarks/wwwroot/1KB.txt

1 KB
Binary file not shown.

src/Benchmarks/wwwroot/1MB.txt

1 MB
Binary file not shown.

src/Benchmarks/wwwroot/4KB.txt

4 KB
Binary file not shown.

src/Benchmarks/wwwroot/512B.txt

512 Bytes
Binary file not shown.

src/Benchmarks/wwwroot/512KB.txt

512 KB
Binary file not shown.

src/Benchmarks/wwwroot/5MB.txt

5 MB
Binary file not shown.

0 commit comments

Comments
 (0)