Commit 93e0ce42 93e0ce428d09fc54a38c66d0fa34ad328e90a317 by Christian Gerdes

New debug options in SetTestParameters

1 parent 4ce8d5dd
......@@ -175,6 +175,7 @@ namespace LIL_VSTT_Plugins
private string myScenarioNames = "";
private string myAgentNames = "";
private string myColNames = "";
private string myDebugLogFile = "";
private bool myUseRandom = true;
private bool myUseUnique = false;
private bool myUseUniqueFiles = false;
......@@ -187,6 +188,7 @@ namespace LIL_VSTT_Plugins
private bool myHasColName = false;
private bool myUseAutoSplit = false;
private bool myIgnoreBlanks = true;
private bool myDebug = false;
private bool stop = false;
private int timeWait = 0;
......@@ -200,6 +202,24 @@ namespace LIL_VSTT_Plugins
#region guiparams
[DisplayName("Debug Mode")]
[Description("Set True in order to enable Debug Mode. Each agent will log debug messages to the given Debug Log File.")]
[DefaultValue(false)]
public bool DebugMode
{
get { return myDebug; }
set { myDebug = value; }
}
[DisplayName("Debug Log File")]
[Description("Log file path to be used for debug logging, if enabled (True)")]
[DefaultValue("C:\\Temp\\SetTestParameterDebug.log")]
public string DebugLogFile
{
get { return myDebugLogFile; }
set { myDebugLogFile = value; }
}
[DisplayName("CSV filens sökväg")]
[Description("Ange den fullständiga sökvägen till CSV filen. Observera att filen behöver finnas på alla agenterna också om du inte kör lokalt.")]
[DefaultValue("C:\\Userdata.csv")]
......@@ -388,7 +408,10 @@ namespace LIL_VSTT_Plugins
else if (myUseUniqueIteration)
m_loadTest.TestStarting += new EventHandler<TestStartingEventArgs>(loadTestStartingUniqueIteration);
else if (myUseUniqueFiles)
{
m_loadTest.TestStarting += new EventHandler<TestStartingEventArgs>(loadTestStartingUniqueFiles);
m_loadTest.TestFinished += new EventHandler<TestFinishedEventArgs>(loadTestFinishedUniqueFiles);
}
else if (myUseUnique)
m_loadTest.TestStarting += new EventHandler<TestStartingEventArgs>(loadTestStartingUnique);
else if (myUseRandom)
......@@ -408,7 +431,7 @@ namespace LIL_VSTT_Plugins
if (stop)
{
if (timeWait > 60)
m_loadTest.Abort(new Exception("Out of test data"));
m_loadTest.Abort(new Exception("Out of test data: " + myConnectionString + " does not have more than " + myParams.Count + " accepted rows with IgnoreBlanks " + myIgnoreBlanks + "), Autosplit " + myUseAutoSplit + " and with " + m_loadTest.Context.AgentCount + " Agent(s)."));
else
timeWait++;
}
......@@ -466,7 +489,17 @@ namespace LIL_VSTT_Plugins
userRow[e.UserContext.UserId] = row;
}
}
setParameters(this.getSeqUser(row), e);
string strParams = this.getSeqUser(row);
setParameters(strParams, e);
if (myDebug) lock (myDebugLogFile) { File.AppendAllText(myDebugLogFile, DateTime.Now.ToLocalTime() + " File: " + myConnectionString + " Test: " + e.TestName + " VU: " + e.UserContext.UserId + " Row: " + row + " Value: \"" + strParams + "\"\r\n"); }
}
}
void loadTestFinishedUniqueFiles(object sender, TestFinishedEventArgs e)
{
if (shouldRun(e))
{
}
}
......@@ -495,7 +528,6 @@ namespace LIL_VSTT_Plugins
{
if (shouldRun(e))
{
// Add context parameters to the starting test
int numParams = 1;
if (myHasColName == true && myColNames.Contains(',')) numParams = countColumns(myColNames);
......