private static void Generate(Dictionary <string, TestCollection> testCollectionDictionary, string areaReportsPath, string area) { string filenameSuffix = "VariationReport.xml"; using (XmlTableWriter tableWriter = new XmlTableWriter(Path.Combine(areaReportsPath, area + filenameSuffix))) { tableWriter.AddXsl(@"..\VariationReport.xsl"); tableWriter.WriteStartElement("Variations"); int testIndex = 0; foreach (string subarea in testCollectionDictionary.Keys) { TestCollection testsInSubarea = testCollectionDictionary[subarea] as TestCollection; tableWriter.WriteStartElement("SubArea"); tableWriter.WriteAttributeString("SubArea", subarea); foreach (TestRecord test in testsInSubarea) { testIndex++; WriteTestNode(tableWriter, areaReportsPath, area, test, testIndex); } tableWriter.WriteEndElement(); } } }
internal static void Generate(TestRecords tests, DirectoryInfo ReportRoot) { using (XmlTableWriter tableWriter = new XmlTableWriter(Path.Combine(ReportRoot.FullName, "MachineSummary.xml"))) { tableWriter.AddXsl("MachineSummary.xsl"); WriteSummaryReport(tableWriter, tests); } }
private static void Generate(TestRecords Records, string path) { using (XmlTableWriter tableWriter = new XmlTableWriter(path)) { tableWriter.AddXsl(@"FilteringReport.xsl"); tableWriter.WriteStartElement("Tests"); foreach (TestRecord test in Records.TestCollection) { TestInfo testInfo = test.TestInfo; { tableWriter.WriteStartElement("Test"); tableWriter.WriteAttributeString("Area", testInfo.Area); tableWriter.WriteAttributeString("SubArea", testInfo.SubArea); tableWriter.WriteAttributeString("TestName", testInfo.Name); tableWriter.WriteAttributeString("Explanation", test.FilteringExplanation); tableWriter.WriteEndElement(); } } tableWriter.WriteEndElement(); } }
internal static void Generate(TestRecords tests, RunInfo runInfo, DirectoryInfo reportRoot) { using (XmlTableWriter tableWriter = new XmlTableWriter(Path.Combine(reportRoot.FullName, "LabReport.xml"))) { tableWriter.AddXsl("LabReport.xsl"); tableWriter.WriteStartElement("LabReport"); string reportPath = reportRoot.FullName; if (reportPath.EndsWith(@"\")) { // Remove the final slashy to prevent malformed XML since all XSLs expect non-slash end. reportPath = reportPath.Remove(reportPath.Length - 1); } tableWriter.WriteAttributeString("ReportPath", reportPath); SummaryReportGenerator.WriteSummaryReport(tableWriter, tests); AppendNotes(tableWriter, runInfo); AppendConfigurations(tableWriter, runInfo); AppendPaths(tableWriter, runInfo, reportRoot); tableWriter.WriteEndElement(); } }
private static void Generate(TestRecords records, string path) { using (XmlTableWriter tableWriter = new XmlTableWriter(path)) { tableWriter.AddXsl(@"DrtReport.xsl"); tableWriter.WriteStartElement("Variations"); tableWriter.WriteAttributeString("PassRate", ReportingUtilities.CalculatePassRate(records)); foreach (TestRecord test in FilterNonPassingTests(records)) { TestInfo testInfo = test.TestInfo; { tableWriter.WriteStartElement("Variation"); tableWriter.WriteAttributeString("Area", testInfo.Area); tableWriter.WriteAttributeString("TestName", testInfo.Name); tableWriter.WriteAttributeString("Variation", "Test Level Summary"); tableWriter.WriteAttributeString("Duration", ReportingUtilities.FormatTimeSpanAsSeconds(ReportingUtilities.GetTestDuration(test))); //Total test execution Time tableWriter.WriteAttributeString("Result", ReportingUtilities.InterpretTestOutcome(test).ToString()); tableWriter.WriteAttributeString("Log", test.Log); tableWriter.WriteAttributeString("LogDir", ReportingUtilities.ReportPaths(test.LoggedFiles)); tableWriter.WriteEndElement(); } foreach (VariationRecord variation in test.Variations) { tableWriter.WriteStartElement("Variation"); tableWriter.WriteAttributeString("Area", testInfo.Area); tableWriter.WriteAttributeString("TestName", testInfo.Name); tableWriter.WriteAttributeString("Variation", variation.VariationName); tableWriter.WriteAttributeString("Duration", ReportingUtilities.FormatTimeSpanAsSeconds(ReportingUtilities.GetVariationDuration(variation))); tableWriter.WriteAttributeString("Result", variation.Result.ToString()); tableWriter.WriteAttributeString("Log", variation.Log); tableWriter.WriteAttributeString("LogDir", ReportingUtilities.ReportPaths(variation.LoggedFiles)); tableWriter.WriteEndElement(); } } tableWriter.WriteEndElement(); } }
internal static void Generate(TestRecords results, DirectoryInfo ReportRoot) { string path = Path.Combine(ReportRoot.FullName, "InfraTrackingReport.xml"); using (XmlTableWriter tableWriter = new XmlTableWriter(path)) { tableWriter.AddXsl("InfraTrackingReport.xsl"); tableWriter.WriteStartElement("TestFeatureUsage"); foreach (TestRecord test in results.TestCollection) { TestInfo testInfo = test.TestInfo; tableWriter.WriteStartElement("Test"); tableWriter.WriteAttributeString("Area", testInfo.Area + " " + testInfo.SubArea); tableWriter.WriteAttributeString("Test", testInfo.Name); if (testInfo.Bugs != null) { tableWriter.WriteAttributeString("Bugs", testInfo.Bugs.ToCommaSeparatedList()); } if (testInfo.Configurations != null) { tableWriter.WriteAttributeString("Configurations", testInfo.Configurations.ToCommaSeparatedList()); } if (testInfo.Deployments != null) { tableWriter.WriteAttributeString("Deployments", testInfo.Deployments.ToCommaSeparatedList()); } if (testInfo.ExecutionGroup != null) { tableWriter.WriteAttributeString("ExecutionGroup", testInfo.ExecutionGroup); } tableWriter.WriteEndElement(); } tableWriter.WriteEndElement(); } }