Skip to content

Commit b99edf7

Browse files
committed
Adding C# precompiled throughput test
1 parent 379972f commit b99edf7

File tree

17 files changed

+64
-353
lines changed

17 files changed

+64
-353
lines changed

test/WebJobs.Script.Tests.E2E.Shared/FunctionAppFixture.cs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,12 @@ private async Task InitializeFunctionKeys()
135135
}
136136
}
137137

138-
private async Task WaitForSite()
138+
public async Task WaitForSite()
139139
{
140140
_logger.LogInformation("Waiting for site...");
141141

142-
TimeSpan delay = TimeSpan.FromSeconds(3);
143-
int attemptsCount = 5;
142+
TimeSpan delay = TimeSpan.FromSeconds(5);
143+
int attemptsCount = 8;
144144

145145
using (var client = new HttpClient())
146146
{
@@ -170,7 +170,6 @@ private async Task WaitForSite()
170170
}
171171

172172
throw new InvalidOperationException($"Wait for site timeout: {delay.TotalSeconds * 5} seconds.");
173-
174173
}
175174

176175
private async Task CheckVersionsMatch()
@@ -205,11 +204,19 @@ private async Task UpdateSiteContents()
205204

206205
await _kuduClient.DeleteDirectory("site/wwwroot", true);
207206
string filePath = Path.ChangeExtension(Path.GetTempFileName(), "zip");
208-
ZipFile.CreateFromDirectory(Path.Combine(Environment.CurrentDirectory, "Functions"), filePath);
207+
string sourceDirectory = Path.Combine(Environment.CurrentDirectory, "Functions");
208+
if (Directory.Exists(sourceDirectory))
209+
{
210+
ZipFile.CreateFromDirectory(sourceDirectory, filePath);
209211

210-
await _kuduClient.DeployZip(filePath);
212+
await _kuduClient.DeployZip(filePath);
211213

212-
_logger.LogInformation("Site contents updated");
214+
_logger.LogInformation("Site contents updated");
215+
}
216+
else
217+
{
218+
_logger.LogInformation("Content directory is empty");
219+
}
213220
}
214221

215222
private async Task UpdateRuntime()

test/WebJobs.Script.Tests.E2E.Shared/KuduClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public KuduClient(string kuduUri, string userName, string password)
3535
public async Task DeleteDirectory(string path, bool recursive)
3636
{
3737
HttpResponseMessage response = await _client.DeleteAsync($"api/vfs/{path}/?recursive={recursive}");
38-
response.EnsureSuccessStatusCode();
38+
// response.EnsureSuccessStatusCode();
3939
}
4040

4141
public async Task DeployZip(string zipPath)

test/WebJobs.Script.Tests.E2E.Shared/Settings.cs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public static string RuntimeExtensionPackageUrl
5353

5454
public static Uri SiteBaseAddress => new Uri($"https://{SiteName}.azurewebsites.net");
5555

56+
public static IConfigurationSection Tests => GetSection("Tests");
57+
5658
public static string RuntimeVersion
5759
{
5860
get
@@ -71,6 +73,20 @@ public static string RuntimeVersion
7173
}
7274

7375
private static string GetSettingValue(string settingName)
76+
{
77+
EnsureConfigInitialized();
78+
79+
return ConfigurationBinder.GetValue(Config, settingName, "default");
80+
}
81+
82+
private static IConfigurationSection GetSection(string key)
83+
{
84+
EnsureConfigInitialized();
85+
86+
return Config.GetSection(key);
87+
}
88+
89+
private static void EnsureConfigInitialized()
7490
{
7591
if (Config == null)
7692
{
@@ -81,9 +97,6 @@ private static string GetSettingValue(string settingName)
8197
}
8298
Config = builder.Build();
8399
}
84-
85-
86-
return ConfigurationBinder.GetValue(Config, settingName, "default");
87100
}
88101
}
89102
}

tools/WebJobs.Script.Performance/WebJobs.Script.Performance.App/Artifacts/Java/host.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

tools/WebJobs.Script.Performance/WebJobs.Script.Performance.App/Artifacts/Java/local.settings.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

tools/WebJobs.Script.Performance/WebJobs.Script.Performance.App/Artifacts/Java/pom.xml

Lines changed: 0 additions & 163 deletions
This file was deleted.

tools/WebJobs.Script.Performance/WebJobs.Script.Performance.App/Artifacts/Java/src/main/java/test/Function.java

Lines changed: 0 additions & 22 deletions
This file was deleted.

tools/WebJobs.Script.Performance/WebJobs.Script.Performance.App/Artifacts/PS/test-throughput.ps1

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,14 @@ Start-Transcript -path $outputCSVPath\test.log -append
5353
Write-Output "Runtime: $runtime"
5454
Write-Output "jmx: $jmx"
5555

56-
& $jmeter -jar C:\Tools\apache-jmeter-5.0\bin\ApacheJMeter.jar -n -t "C:\Tools\jmx\$jmx" -l "$outputCSVPath\logs.csv"
56+
$tempFolderName = [System.IO.Path]::GetFileNameWithoutExtension([System.IO.Path]::GetTempFileName())
57+
$tempJmxPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath() ,$tempFolderName)
58+
[System.IO.Directory]::CreateDirectory($tempJmxPath)
59+
$tempJmxPath = "$tempJmxPath\test.jmx"
60+
Write-Host "Downloading '$jmx' to '$tempJmxPath'"
61+
Invoke-WebRequest -Uri $jmx -OutFile $tempJmxPath
62+
63+
& $jmeter -jar C:\Tools\apache-jmeter-5.0\bin\ApacheJMeter.jar -n -t $tempJmxPath -l "$outputCSVPath\logs.csv"
5764
& $jmeter -jar C:\Tools\apache-jmeter-5.0\bin\ApacheJMeter.jar -g "$outputCSVPath\logs.csv" -o $outputHTMLPath
5865

5966
$matches = Select-String -Pattern "#statisticsTable" -Path "$outputHTMLPath\content\js\dashboard.js"

tools/WebJobs.Script.Performance/WebJobs.Script.Performance.App/Functions/wwwroot/CSharpPing/function.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

tools/WebJobs.Script.Performance/WebJobs.Script.Performance.App/Functions/wwwroot/CSharpPing/run.csx

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)