Skip to content
This repository has been archived by the owner on Feb 23, 2021. It is now read-only.

Commit

Permalink
stress.codegen updates / minor bug fixes
Browse files Browse the repository at this point in the history
  -fix for stress execution script generation to fix duplicate environment setup issue
  -update genstress.proj to use OfficialBuildId as a SuiteName if it is set
  • Loading branch information
schaabs committed Nov 18, 2016
1 parent aea1080 commit 26254ba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/stress.codegen/ExecutionFileGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ public void GenerateSourceFile(LoadTestInfo loadTestInfo)
stressScript.WriteLine("# environment section");
// first take care of the environment variables

//if the environment variable "DUMPLING_PROPERTIES" already exists remove it
//this is needed because multiple LoadTestInfo objects use the same environment dictionary instance
if(loadTestInfo.EnvironmentVariables.ContainsKey("DUMPLING_PROPERTIES"))
{
loadTestInfo.EnvironmentVariables.Remove("DUMPLING_PROPERTIES");
}

// add environment variables STRESS_TESTID, STRESS_BUILDID
loadTestInfo.EnvironmentVariables["STRESS_TESTID"] = loadTestInfo.TestName;
loadTestInfo.EnvironmentVariables["STRESS_BUILDID"] = loadTestInfo.TestName.Split('_')[0];
Expand All @@ -51,11 +58,11 @@ public void GenerateSourceFile(LoadTestInfo loadTestInfo)

foreach (var kvp in loadTestInfo.EnvironmentVariables)
{
envVarPropertiesBuilder.Append(kvp.Key + "=" + kvp.Value);
envVarPropertiesBuilder.Append(kvp.Key + "=" + kvp.Value + " ");
}

// add this string to the env vars as DUMPLING_PROPERTIES
loadTestInfo.EnvironmentVariables["DUMPLING_PROPERTIES"] = "\"" + envVarPropertiesBuilder.ToString() + "\"";
// add this string to the env vars as DUMPLING_PROPERTIES trimming the last space
loadTestInfo.EnvironmentVariables["DUMPLING_PROPERTIES"] = "\"" + envVarPropertiesBuilder.ToString().TrimEnd(' ') + "\"";

//write commands to setup environment environment
foreach (KeyValuePair<string, string> kvp in loadTestInfo.EnvironmentVariables)
Expand Down
1 change: 1 addition & 0 deletions test/genstress.proj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<Import Project="$(MSBuildThisFileDirectory)dir.props" />

<PropertyGroup>
<BuildMoniker Condition="'$(BuildMoniker)' == ''">$(OfficialBuildId)</BuildMoniker>
<BuildMoniker Condition="'$(BuildMoniker)' == ''">$(USERNAME)-$([System.DateTime]::Now.ToString(MMdd-hhmmss))</BuildMoniker>
</PropertyGroup>

Expand Down

0 comments on commit 26254ba

Please sign in to comment.