-
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
Conversation
/// <summary> | ||
/// Test aggregation element. | ||
/// </summary> | ||
internal abstract class TestAggregation : TestElement, ITestAggregation |
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.
TestAggregation [](start = 28, length = 15)
can we rename to TestElementAggregation..?
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.
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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
done.
var parentExecutionId = Converter.GetParentExecutionId(e.Result); | ||
var parentTestResult = GetTestResult(parentExecutionId); | ||
var parentTestElement = (parentTestResult != null) ? GetTestElement(parentTestResult.Id.TestId) : null; | ||
if (parentTestResult == null || parentTestElement == null || parentExecutionId == Guid.Empty) |
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.
Write a coment when we are switching to flatten way
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.
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.
- Please measure perf impact.
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System; | ||
using System.Collections.Generic; |
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.
private TestListCategoryId categoryId; | ||
private List<TestEntry> testEntries = new List<TestEntry>(); |
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.
Create object if required? Do same in other places too.
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
{ | ||
if (parentTestElement != null && | ||
parentTestElement.TestType.Equals(TrxLoggerConstants.OrderedTestType) && | ||
!(parentTestElement as OrderedTestElement).TestLinks.ContainsKey(testElement.Id.Id)) |
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.
When you get same testElement more than once?
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.
In case orderedtest has data driven test, then we get same test element for all data driven tests. In that case we want to update test link only once.
// Create trx test element from rocksteady test case | ||
var testElement = GetOrCreateTestElement(executionId, parentExecutionId, testType, parentTestElement, e.Result.TestCase); | ||
|
||
// Update test links |
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.
Please provide test link example.
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
private List<TrxLoggerObjectModel.UnitTestElement> testElements; | ||
private List<TestEntry> entries; | ||
private Dictionary<Guid, TrxLoggerObjectModel.ITestResult> results; | ||
private Dictionary<Guid, TrxLoggerObjectModel.ITestResult> innerResults; |
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.
Please add comments here.
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
Request a RFC and spec for this please. It will allow community to review the spec before the change is merged. |
/// <summary> | ||
/// Uri used to uniquely identify the TRX logger. | ||
/// </summary> | ||
public const string ExtensionUri = "logger://Microsoft/TestPlatform/TrxLogger/v1"; |
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.
public [](start = 8, length = 6)
nit: all these const should be near to the consumers. will be easy to read and understand
|
||
string IXmlTestStoreCustom.NamespaceUri | ||
{ | ||
get { return null; } |
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.
null [](start = 25, length = 4)
why null
{ | ||
if (id == Guid.Empty) | ||
{ | ||
Debug.Assert(id != Guid.Empty, "id == Guid.Empty!"); |
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.
Debug.Assert(id != Guid.Empty, "id == Guid.Empty!"); [](start = 15, length = 53)
remove assert
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.
Changed trx logger to understand data driven and ordered test in hierarchical form
If test result contains parent execution id, then results are stored in hierarchical fashion. If not, stored in flat fashion.
Parent test result is expected to comes first than child results to allow results to be hierarchical.