Skip to content

Commit

Permalink
Making Trx Logger Hierarchical for ordered test and data driven tests (
Browse files Browse the repository at this point in the history
…#1330)

* making classes internal

* Model classes to be consumed by trx logger

* initial changes for trx hierarchical

* refactoring

* fix for hierarchical level more than 1

* removing unnecessary inner resutls count

* refactoring

* Interfaces refactoring

* refactoring

* refactoring

* Refactoring

* refactoring

* refactoring

* remove debugger

* Review comments

* Unit tests

* concurrent hash map

* Fixes

* PR comments
  • Loading branch information
abhishekkumawat23 authored and abhishkk committed Feb 14, 2018
1 parent a4b511a commit d806e80
Show file tree
Hide file tree
Showing 31 changed files with 1,974 additions and 1,075 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Microsoft.TestPlatform.Extensions.TrxLogger.ObjectModel
/// <summary>
/// Interface used to define a data attachment.
/// </summary>
public interface IDataAttachment
internal interface IDataAttachment
{
/// <summary>
/// Gets the description for the attachment.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace Microsoft.TestPlatform.Extensions.TrxLogger.ObjectModel
{
using System;
using System.Collections.Generic;

internal interface ITestAggregation : ITestElement
{
Dictionary<Guid, TestLink> TestLinks { get; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace Microsoft.TestPlatform.Extensions.TrxLogger.ObjectModel
{
internal interface ITestElement
{
TestId Id { get; }
string Name { get; set; }
string Owner { get; set; }
string Storage { get; set; }
string Adapter { get; }
int Priority { get; set; }
bool IsRunnable { get; }
TestExecId ExecutionId { get; set; }
TestExecId ParentExecutionId { get; set; }
TestListCategoryId CategoryId { get; set; }
TestCategoryItemCollection TestCategories { get; }
TestType TestType { get; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace Microsoft.TestPlatform.Extensions.TrxLogger.ObjectModel
{

using System;

internal interface ITestResult
{
TestResultId Id { get; }
string ResultType { get; set; }
string StdOut { get; set; }
string StdErr { get; set; }
string DebugTrace { get; set; }
string TestResultsDirectory { get; }
string RelativeTestResultsDirectory { get; }
string ErrorMessage { get; set; }
string ErrorStackTrace { get; set; }
string ComputerName { get; }
string[] TextMessages { get; set; }
int DataRowInfo { get; set; }
DateTime StartTime { get; set; }
DateTime EndTime { get; set; }
TimeSpan Duration { get; set; }
TestOutcome Outcome { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace Microsoft.TestPlatform.Extensions.TrxLogger.ObjectModel
{
using System.Collections.Generic;

internal interface ITestResultAggregation : ITestResult
{
List<ITestResult> InnerResults { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Microsoft.TestPlatform.Extensions.TrxLogger.ObjectModel
/// Implementing this interface indicates a custom persistence logic is provided.
/// The attribute based persistence is ignored in such a case.
/// </summary>
public interface IXmlTestStore
internal interface IXmlTestStore
{
/// <summary>
/// Saves the class under the XmlElement.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Microsoft.TestPlatform.Extensions.TrxLogger.XML
/// <summary>
/// Implementing this interface allows you to customize XmlStore persistence.
/// </summary>
public interface IXmlTestStoreCustom
internal interface IXmlTestStoreCustom
{
/// <summary>
/// Gets the name of the tag to use to persist this object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Microsoft.TestPlatform.Extensions.TrxLogger.ObjectModel
/// saved when 'MyClass.SaveDetails' parameter is set to 'true'.
/// </example>
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "Reviewed. Suppression is OK here.")]
public sealed class XmlTestStoreParameters : Dictionary<string, object>
internal sealed class XmlTestStoreParameters : Dictionary<string, object>
{
private XmlTestStoreParameters()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace Microsoft.TestPlatform.Extensions.TrxLogger.ObjectModel
{
using System;
using Microsoft.TestPlatform.Extensions.TrxLogger.Utility;
using Microsoft.TestPlatform.Extensions.TrxLogger.XML;

/// <summary>
/// Ordered test element.
/// </summary>
internal class OrderedTestElement : TestElementAggregation, IXmlTestStoreCustom
{
public OrderedTestElement(Guid id, string name, string adapter) : base(id, name, adapter) { }

string IXmlTestStoreCustom.ElementName
{
get { return Constants.OrderedTestElementName; }
}

string IXmlTestStoreCustom.NamespaceUri
{
get { return null; }
}

/// <summary>
/// Gets the test type.
/// </summary>
public override TestType TestType
{
get { return Constants.OrderedTestType; }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Microsoft.TestPlatform.Extensions.TrxLogger.ObjectModel
/// <summary>
/// Stores a string which categorizes the Test
/// </summary>
public sealed class TestCategoryItem : IXmlTestStore
internal sealed class TestCategoryItem : IXmlTestStore
{
#region Fields
[StoreXmlSimpleField(Location = "@TestCategory", DefaultValue = "")]
Expand Down Expand Up @@ -123,7 +123,7 @@ public void Save(System.Xml.XmlElement element, XmlTestStoreParameters parameter
/// <summary>
/// A collection of strings which categorize the test.
/// </summary>
public sealed class TestCategoryItemCollection : EqtBaseCollection<TestCategoryItem>
internal sealed class TestCategoryItemCollection : EqtBaseCollection<TestCategoryItem>
{
#region Constructors
/// <summary>
Expand Down
Loading

0 comments on commit d806e80

Please sign in to comment.