Skip to content

Commit 5f2c2ef

Browse files
committed
Adding features to support standardized metadata contract in VC.
2 parents 10cfce2 + 18e4290 commit 5f2c2ef

File tree

56 files changed

+1204
-705
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1204
-705
lines changed

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,5 @@
6969
/src/VirtualClient/VirtualClient.Packaging/win-x64/SQLTPCC/HammerDB/**/* eol=lf
7070
/src/VirtualClient/VirtualClient.Actions/**/*.sh eol=lf
7171
/src/VirtualClient/VirtualClient.Dependencies/**/*.sh eol=lf
72-
yarn.lock eol=lf
72+
yarn.lock eol=lf
73+
/src/VirtualClient/VirtualClient.Actions/SuperBenchmark/local.ini eol=lf

.pipelines/azure-pipelines-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pool:
1313
vmImage: ubuntu-latest
1414

1515
variables:
16-
VcVersion : 1.8.1
16+
VcVersion : 1.9.0
1717
ROOT: $(Build.SourcesDirectory)
1818
CDP_DEFINITION_BUILD_COUNT: $[counter('', 0)] # needed for onebranch.pipeline.version task https://aka.ms/obpipelines/versioning
1919
ENABLE_PRS_DELAYSIGN: 1

.pipelines/azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pool:
1818
vmImage: windows-latest
1919

2020
variables:
21-
VcVersion : 1.8.1
21+
VcVersion : 1.9.0
2222
ROOT: $(Build.SourcesDirectory)
2323
CDP_DEFINITION_BUILD_COUNT: $[counter('', 0)] # needed for onebranch.pipeline.version task https://aka.ms/obpipelines/versioning
2424
ENABLE_PRS_DELAYSIGN: 1

src/VirtualClient/VirtualClient.Actions.FunctionalTests/SysbenchOLTP/SysbenchOLTPClientProfileTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ public async Task SysbenchOLTPWorkloadProfileExecutesTheExpectedWorkloadsOnUnixP
5959

6060
string scriptPath = this.mockFixture.PlatformSpecifics.GetScriptPath("sysbencholtp");
6161

62-
string balancedClientScript = this.mockFixture.PlatformSpecifics.Combine(scriptPath, "balancedClient.sh");
63-
string balancedServerScript = this.mockFixture.PlatformSpecifics.Combine(scriptPath, "balancedServer.sh");
64-
string inMemoryScript = this.mockFixture.PlatformSpecifics.Combine(scriptPath, "inMemory.sh");
62+
string balancedClientScript = this.mockFixture.PlatformSpecifics.Combine(scriptPath, "balanced-client.sh");
63+
string balancedServerScript = this.mockFixture.PlatformSpecifics.Combine(scriptPath, "balanced-server.sh");
64+
string inMemoryScript = this.mockFixture.PlatformSpecifics.Combine(scriptPath, "in-memory.sh");
6565

6666
this.mockFixture.SetupFile(balancedServerScript);
6767
this.mockFixture.SetupFile(balancedClientScript);
@@ -93,9 +93,9 @@ private IEnumerable<string> GetProfileExpectedCommands(PlatformID platform, Arch
9393
{
9494
"git clone https://github.com/akopytov/sysbench.git /home/user/tools/VirtualClient/packages/sysbench",
9595

96-
$"sudo chmod +x \"/home/user/tools/VirtualClient/scripts/sysbencholtp/balancedServer.sh\"",
97-
$"sudo chmod +x \"/home/user/tools/VirtualClient/scripts/sysbencholtp/balancedClient.sh\"",
98-
$"sudo chmod +x \"/home/user/tools/VirtualClient/scripts/sysbencholtp/inMemory.sh\"",
96+
$"sudo chmod +x \"/home/user/tools/VirtualClient/scripts/sysbencholtp/balanced-server.sh\"",
97+
$"sudo chmod +x \"/home/user/tools/VirtualClient/scripts/sysbencholtp/balanced-client.sh\"",
98+
$"sudo chmod +x \"/home/user/tools/VirtualClient/scripts/sysbencholtp/in-memory.sh\"",
9999

100100
"sudo ./autogen.sh",
101101
"sudo ./configure",

src/VirtualClient/VirtualClient.Actions.FunctionalTests/WorkloadAssert.cs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,44 @@ public static void CommandsExecuted(DependencyFixture fixture, params string[] c
6666
}
6767
}
6868

69+
/// <summary>
70+
/// Confirms the shell commands were executed. This method uses regular expressions
71+
/// to evaluate equality so the commands passed in can be explicit or using regular expressions
72+
/// syntax.
73+
/// </summary>
74+
public static void SSHCommandsExecuted(DependencyFixture fixture, params string[] commands)
75+
{
76+
List<ISshCommandProxy> sshCommands = new List<ISshCommandProxy>();
77+
List<ISshCommandProxy> sshCommandsConfirmed = new List<ISshCommandProxy>();
78+
foreach (InMemorySshClient sshClient in fixture.SshClientManager.SshClients)
79+
{
80+
sshCommands.AddRange(sshClient.SshCommands);
81+
}
82+
83+
foreach (string command in commands)
84+
{
85+
ISshCommandProxy matchingProcess = null;
86+
try
87+
{
88+
// Try to match regex
89+
matchingProcess = sshCommands.FirstOrDefault(
90+
sshCommand => Regex.IsMatch($"{sshCommand.CommandText}".Trim(), command, RegexOptions.IgnoreCase)
91+
&& !sshCommandsConfirmed.Any(otherProc => object.ReferenceEquals(sshCommand, otherProc)));
92+
}
93+
catch
94+
{
95+
}
96+
97+
// Or command exact match
98+
matchingProcess = matchingProcess ?? sshCommands.FirstOrDefault(
99+
sshCommand => $"{sshCommand.CommandText}".Trim() == command
100+
&& !sshCommandsConfirmed.Any(otherProc => object.ReferenceEquals(sshCommand, otherProc)));
101+
102+
Assert.IsNotNull(matchingProcess, $"The command '{command}' was not executed.");
103+
sshCommandsConfirmed.Add(matchingProcess);
104+
}
105+
}
106+
69107
/// <summary>
70108
/// Confirms all disks are initialized as expected (e.g. disks are formatted).
71109
/// </summary>

src/VirtualClient/VirtualClient.Actions.UnitTests/Furmark/FurmarkExecutorTest.cs renamed to src/VirtualClient/VirtualClient.Actions.UnitTests/Furmark/FurmarkExecutorTests.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,9 @@ public async Task FurmarkExecutorExecutesWorkloadAsExpected(PlatformID platform,
7979
string ExpectedPsexecCommand = this.fixture.PlatformSpecifics.Combine(this.mockPath.Path, "win-x64", "psexec.exe");
8080
string furmarkCommand = this.fixture.PlatformSpecifics.Combine(this.mockPath.Path ,"win-x64","Geeks3D" ,"Benchmarks" ,"FurMark" ,"Furmark");
8181
string packageDir = this.fixture.PlatformSpecifics.Combine(expectedFilePath, "win-x64");
82-
// packageDir = Regex.Replace(packageDir, @":", string.Empty);
8382

84-
85-
// string expectedmakeCommandArguments = @$"C:\Program Files (x86)\Geeks3D\Benchmarks\FurMark\Furmark";
8683
string executeScriptCommandArguments = $"-accepteula -s -i 1 -w {packageDir} {furmarkCommand} /width={this.fixture.Parameters["Width"]} /height={this.fixture.Parameters["Height"]} /Antialiasing={this.fixture.Parameters["Antialiasing"]} /max_time={this.fixture.Parameters["Time"]} /nogui /nomenubar /noscore /run_mode=1 /log_score /disable_catalyst_warning /log_temperature /max_frames";
8784

88-
// string executeScriptCommandArguments = $"/width={this.fixture.Parameters["Width"]} /height={this.fixture.Parameters["Height"]} /Antialiasing={this.fixture.Parameters["Mssa"]} /max_time={this.fixture.Parameters["Time"]} /nogui /nomenubar /noscore /run_mode=1 /log_score /disable_catalyst_warning /log_temperature /max_frames";
89-
9085
this.fixture.ProcessManager.OnCreateProcess = (command, arguments, workingDirectory) =>
9186
{
9287
if (arguments == executeScriptCommandArguments && command == ExpectedPsexecCommand)

src/VirtualClient/VirtualClient.Actions.UnitTests/Furmark/FurmarkMeticsParserTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void FurmarkParserThrowIfInvalidOutputFormat()
5050
this.rawText = File.ReadAllText(IncorrectFurmarkoutputPath);
5151
this.testParser = new FurmarkMetricsParser(this.rawText);
5252
SchemaException exception = Assert.Throws<SchemaException>(() => this.testParser.Parse());
53-
StringAssert.Contains("furmark workload didn't generate results files.", exception.Message);
53+
StringAssert.Contains("Furmark workload didn't generate results files.", exception.Message);
5454

5555
}
5656
}

src/VirtualClient/VirtualClient.Actions.UnitTests/Furmark/FurmarkXmlMetricsParserTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public void FurmarkParserThrowIfInvalidOutputFormat()
6464
this.rawText = File.ReadAllText(IncorrectFurmarkoutputPath);
6565
this.testParser = new FurmarkXmlMetricsParser (this.rawText);
6666
SchemaException exception = Assert.Throws<SchemaException>(() => this.testParser.Parse());
67-
StringAssert.Contains("furmark workload didn't generate results files.", exception.Message);
67+
StringAssert.Contains("Furmark workload didn't generate results files.", exception.Message);
6868

6969
}
7070
}

src/VirtualClient/VirtualClient.Actions.UnitTests/Redis/RedisServerExecutorTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void SetupTests()
3838
["Port"] = 6379,
3939
["ServerInstances"] = 1,
4040
["ServerThreadCount"] = 4,
41-
["IsTLSEnabled"] = false
41+
["IsTLSEnabled"] = "no"
4242
};
4343

4444
string agentId = $"{Environment.MachineName}-Server";

src/VirtualClient/VirtualClient.Actions.UnitTests/SysbenchOLTP/SysbenchOLTPClientExecutorTests.cs

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ public async Task SysbenchOLTPClientExecutorRunsTheExpectedWorkloadCommand()
9595

9696
string[] expectedCommands =
9797
{
98-
$"sudo chmod +x \"{this.scriptPath}/balancedServer.sh\"",
99-
$"sudo chmod +x \"{this.scriptPath}/balancedClient.sh\"",
100-
$"sudo chmod +x \"{this.scriptPath}/inMemory.sh\"",
98+
$"sudo chmod +x \"{this.scriptPath}/balanced-server.sh\"",
99+
$"sudo chmod +x \"{this.scriptPath}/balanced-client.sh\"",
100+
$"sudo chmod +x \"{this.scriptPath}/in-memory.sh\"",
101101
"sudo ./autogen.sh",
102102
"sudo ./configure",
103103
"sudo make -j",
@@ -152,6 +152,7 @@ public async Task SysbenchOLTPClientExecutorUsesDefinedParameters()
152152

153153
this.mockFixture.Parameters[nameof(SysbenchOLTPClientExecutor.Threads)] = "8";
154154
this.mockFixture.Parameters[nameof(SysbenchOLTPClientExecutor.RecordCount)] = "1000";
155+
this.mockFixture.Parameters[nameof(SysbenchOLTPClientExecutor.NumTables)] = "40";
155156

156157
this.mockFixture.StateManager.OnGetState().ReturnsAsync(JObject.FromObject(new SysbenchOLTPExecutor.SysbenchOLTPState()
157158
{
@@ -161,16 +162,16 @@ public async Task SysbenchOLTPClientExecutorUsesDefinedParameters()
161162

162163
string[] expectedCommands =
163164
{
164-
$"sudo chmod +x \"{this.scriptPath}/balancedServer.sh\"",
165-
$"sudo chmod +x \"{this.scriptPath}/balancedClient.sh\"",
166-
$"sudo chmod +x \"{this.scriptPath}/inMemory.sh\"",
165+
$"sudo chmod +x \"{this.scriptPath}/balanced-server.sh\"",
166+
$"sudo chmod +x \"{this.scriptPath}/balanced-client.sh\"",
167+
$"sudo chmod +x \"{this.scriptPath}/in-memory.sh\"",
167168
"sudo ./autogen.sh",
168169
"sudo ./configure",
169170
"sudo make -j",
170171
"sudo make install",
171-
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_read_write --threads=8 --tables=10 --table-size=1000 --mysql-db=sbtest --mysql-host=1.2.3.5 --time=10 cleanup",
172-
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_common --tables=10 --table-size=1000 --mysql-db=sbtest --mysql-host=1.2.3.5 prepare",
173-
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_read_write --threads=8 --tables=10 --table-size=1000 --mysql-db=sbtest --mysql-host=1.2.3.5 --time=10 run"
172+
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_read_write --threads=8 --tables=40 --table-size=1000 --mysql-db=sbtest --mysql-host=1.2.3.5 --time=10 cleanup",
173+
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_common --tables=40 --table-size=1000 --mysql-db=sbtest --mysql-host=1.2.3.5 prepare",
174+
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_read_write --threads=8 --tables=40 --table-size=1000 --mysql-db=sbtest --mysql-host=1.2.3.5 --time=10 run"
174175
};
175176

176177
int commandNumber = 0;
@@ -237,16 +238,16 @@ public async Task SysbenchOLTPClientExecutorRunsTheExpectedWorkloadCommandBalanc
237238

238239
string[] expectedCommands =
239240
{
240-
$"sudo chmod +x \"{this.scriptPath}/balancedServer.sh\"",
241-
$"sudo chmod +x \"{this.scriptPath}/balancedClient.sh\"",
242-
$"sudo chmod +x \"{this.scriptPath}/inMemory.sh\"",
241+
$"sudo chmod +x \"{this.scriptPath}/balanced-server.sh\"",
242+
$"sudo chmod +x \"{this.scriptPath}/balanced-client.sh\"",
243+
$"sudo chmod +x \"{this.scriptPath}/in-memory.sh\"",
243244
"sudo ./autogen.sh",
244245
"sudo ./configure",
245246
"sudo make -j",
246247
"sudo make install",
247248
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_read_write --threads=1 --tables=10 --table-size={records} --mysql-db=sbtest --mysql-host=1.2.3.5 --time=10 cleanup",
248249
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_common --tables=10 --table-size={records} --mysql-db=sbtest --mysql-host=1.2.3.5 prepare",
249-
$"sudo {this.scriptPath}/balancedClient.sh 1.2.3.5 10 sbtest /testdrive1 /testdrive2",
250+
$"sudo {this.scriptPath}/balanced-client.sh 1.2.3.5 10 sbtest /testdrive1 /testdrive2",
250251
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_read_write --threads=1 --tables=10 --table-size={records} --mysql-db=sbtest --mysql-host=1.2.3.5 --time=10 run"
251252
};
252253

@@ -295,9 +296,9 @@ public async Task SysbenchOLTPClientExecutorSkipsInitializationOfTheWorkloadForE
295296

296297
string[] expectedCommands =
297298
{
298-
$"sudo chmod +x \"{this.scriptPath}/balancedServer.sh\"",
299-
$"sudo chmod +x \"{this.scriptPath}/balancedClient.sh\"",
300-
$"sudo chmod +x \"{this.scriptPath}/inMemory.sh\"",
299+
$"sudo chmod +x \"{this.scriptPath}/balanced-server.sh\"",
300+
$"sudo chmod +x \"{this.scriptPath}/balanced-client.sh\"",
301+
$"sudo chmod +x \"{this.scriptPath}/in-memory.sh\"",
301302
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_read_write --threads={this.threadCount} --tables=10 --table-size={this.recordCount} --mysql-db=sbtest --mysql-host=1.2.3.5 --time=10 cleanup",
302303
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_common --tables=10 --table-size={this.recordCount} --mysql-db=sbtest --mysql-host=1.2.3.5 prepare",
303304
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_read_write --threads={this.threadCount} --tables=10 --table-size={this.recordCount} --mysql-db=sbtest --mysql-host=1.2.3.5 --time=10 run"
@@ -361,9 +362,9 @@ public async Task SysbenchOLTPClientExecutorSkipsPrepareAndCleanupSteps()
361362

362363
string[] expectedCommands =
363364
{
364-
$"sudo chmod +x \"{this.scriptPath}/balancedServer.sh\"",
365-
$"sudo chmod +x \"{this.scriptPath}/balancedClient.sh\"",
366-
$"sudo chmod +x \"{this.scriptPath}/inMemory.sh\"",
365+
$"sudo chmod +x \"{this.scriptPath}/balanced-server.sh\"",
366+
$"sudo chmod +x \"{this.scriptPath}/balanced-client.sh\"",
367+
$"sudo chmod +x \"{this.scriptPath}/in-memory.sh\"",
367368
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_read_write --threads={this.threadCount} --tables=10 --table-size={this.recordCount} --mysql-db=sbtest --mysql-host=1.2.3.5 --time=10 run",
368369
};
369370

0 commit comments

Comments
 (0)