-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Making Trx Logger Hierarchical for ordered test and data driven tests #1330
Changes from 16 commits
2b6ce73
c6dfed1
c0628c9
f7a513e
9fe2b79
04dcb99
def71ab
f7efc36
0e93fbd
982160a
7f98cfd
2daf495
b7168ee
a128e79
8851e47
a565b9e
59d4035
d7d1159
7c38847
23a65f5
14e3f04
e738cca
373c938
71b2df9
6ae9bd5
329f9b6
f2c456b
4f1dc86
d627e29
7f41647
f3da229
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace Microsoft.TestPlatform.Extensions.TrxLogger.ObjectModel | ||
{ | ||
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,27 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System; | ||
|
||
namespace Microsoft.TestPlatform.Extensions.TrxLogger.ObjectModel | ||
{ | ||
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. | ||
|
||
using System.Collections.Generic; | ||
|
||
namespace Microsoft.TestPlatform.Extensions.TrxLogger.ObjectModel | ||
{ | ||
internal interface ITestResultAggregation : ITestResult | ||
{ | ||
List<ITestResult> InnerResults { get; } | ||
} | ||
} |
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 : TestAggregation, 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; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
why 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// 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; | ||
using Microsoft.TestPlatform.Extensions.TrxLogger.XML; | ||
|
||
/// <summary> | ||
/// Test aggregation element. | ||
/// </summary> | ||
internal abstract class TestAggregation : TestElement, ITestAggregation | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
can we rename to TestElementAggregation..? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done. |
||
{ | ||
protected Dictionary<Guid, TestLink> testLinks = new Dictionary<Guid, TestLink>(); | ||
|
||
public TestAggregation(Guid id, string name, string adapter) : base(id, name, adapter) { } | ||
|
||
/// <summary> | ||
/// Test links. | ||
/// </summary> | ||
public Dictionary<Guid, TestLink> TestLinks | ||
{ | ||
get { return testLinks; } | ||
} | ||
|
||
public override void Save(System.Xml.XmlElement element, XmlTestStoreParameters parameters) | ||
{ | ||
base.Save(element, parameters); | ||
|
||
XmlPersistence h = new XmlPersistence(); | ||
if (testLinks.Count > 0) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: Please add parenthesis. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done. |
||
h.SaveIEnumerable(testLinks.Values, element, "TestLinks", ".", "TestLink", parameters); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Move
using
statements to under namespace block.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.