Skip to content
Snippets Groups Projects
Commit 7f90051b authored by Anton Bagliy's avatar Anton Bagliy
Browse files

FIX: nunit report parser working in travis #61

parent fcfbb158
Branches
No related merge requests found
......@@ -72,7 +72,8 @@ namespace NunitReport
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
var result = streamReader.ReadToEnd();
// System.Console.Out.WriteLine(result);
System.Console.Out.WriteLine("grade response: ");
System.Console.Out.WriteLine(result);
}
}
......@@ -107,11 +108,12 @@ namespace NunitReport
foreach (JObject task in tasks)
{
if ((string) task["namespace"] == caseClass)
string namespaceName = (string) task["namespace"];
if (namespaceName == caseClass)
{
double maxGrade = (double) task["tests"][caseName]["grade"];
int subModuleNumber = (int) task["tests"][caseName]["subModuleNumber"];
if (testcase.Attributes["result"].Value == "Passed")
if (testcase.Attributes["result"].Value == "Success")
{
if (!countedGrades.ContainsKey(subModuleNumber))
{
......@@ -142,6 +144,10 @@ namespace NunitReport
SendGrades(grades, nick, g.Key, semester, service, subject, grade);
}
else
{
System.Console.Out.WriteLine("submodule #" + g.Key.ToString() + " = empty");
}
}
}
......@@ -154,17 +160,23 @@ namespace NunitReport
{
basePath = args[0];
filePath = basePath + @"/TestResult.xml";
userName = args[1].Split('/')[0];
//userName = args[1].Split('/')[0];
string repoName = args[1].Split('/')[1];
userName = repoName.Substring(23, repoName.Length - 23);
}
else
{
userName = "czen";
filePath = @"./TestResult.xml";
}
System.Console.WriteLine("user name: " + userName);
System.Console.WriteLine("base path: " + basePath);
doc.Load(filePath);
string[] XmlText = File.ReadAllLines(filePath);
// System.Console.WriteLine("+++++++++++++++++++++++++");
// System.Console.WriteLine("nunit report:");
// System.Console.WriteLine("+++++++++++++++++++++++++");
// foreach (string line in XmlText)
// {
// System.Console.WriteLine(line);
......
{
"GradeService": {
"url": "http://grade/~dev_rating/",
"url": "http://testgrade.sfedu.ru/",
"token": "39se9832fh3e78fl23ois33mhfdff34gbuj34896"
},
"Discipline": {
"Subject": "Разработка компиляторов",
"Semester": 9
"Semester": 11
},
"Service": "github",
"Projects": [
......
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