Commit 2f16d9f0 authored by Nathan Bean's avatar Nathan Bean
Browse files

added some logging and user auth to functinal testing

parent 69017a94
......@@ -22,7 +22,7 @@
var functionalIssues = new IssueListViewModel()
{
Available = Model.StructuralIssues.Count == 0,
Available = Model.StructuralIssues.Count() == 0,
Category = "Functional",
Issues = Model.FunctionalIssues,
Description = "Design issues concern your use of C# and its libraries. Are they used appropriately?"
......
......@@ -43,6 +43,13 @@ namespace KSU.CS.ProgramVerifier
psi.RedirectStandardInput = true;
psi.RedirectStandardOutput = true;
psi.RedirectStandardError = true;
var password = new System.Security.SecureString();
foreach (char c in "insecurepassword123") password.AppendChar(c);
psi.UserName = "nhbean_local";
#pragma warning disable CA1416 // Validate platform compatibility
psi.Password = password;
#pragma warning restore CA1416 // Validate platform compatibility
using (var process = Process.Start(psi))
{
......
......@@ -61,10 +61,17 @@ namespace KSU.CS.ProgramVerifier
// Run any student tests
//await TestRunner.Run(solution, result);
// Run any specification tests
if (result.DoesCompile && result.StructuralIssues.Count == 0) await SpecificationTestRunner.Run(specification, workspace, result);
else if (result.DoesCompile) result.FunctionalIssues.Add("Functional issues were not checked for as design and compilation issues must be fixed first.");
else result.FunctionalIssues.Add("Functional issues were not checked for as structural issues must be fixed first");
try
{
await System.IO.File.AppendAllTextAsync(@"c:\\workDirectory\log.txt", $"Getting ready to run tests on ${studentPath}; {result.StructuralIssues.Count} structural issues found; Compilation was {result.DoesCompile}");
// Run any specification tests
if (result.StructuralIssues.Count == 0) await SpecificationTestRunner.Run(specification, workspace, result);
else result.FunctionalIssues.Add("Functional issues were not checked for as structural issues must be fixed first");
}
catch(Exception e)
{
await System.IO.File.AppendAllTextAsync(@"c:\\workDirectory\log.txt", $"Encountered Error: ${e.Message} ${e.StackTrace}");
}
}
return result;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment