Skip to content
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

Trx Logger Fixes #1710

Merged
merged 5 commits into from
Aug 3, 2018
Merged

Conversation

vagisha-nidhi
Copy link
Contributor

Trx Logger Fixes

  1. Trx file is not generated when test run aborts.
  2. TRX Logger shouldn't fail if test result attachments are missing/Invalid TRX Logger shouldn't fail if test result attachments are missing/Invalid #1705

XmlTestStoreParameters parameters = XmlTestStoreParameters.GetParameters();
XmlElement rootElement = helper.CreateRootElement("TestRun");
// Create test run
if (this.testRun == null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please explain what scenario needs this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added comment

// (Trx viewer automatically adds In\<Guid> to the result file.
string fileName = Path.Combine(Environment.MachineName, Path.GetFileName(targetFileName));
resultFiles.Add(fileName);
try
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we hit any while validating?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to issue #1705 TRX Logger shouldn't fail if test result attachments are missing/Invalid.

XmlTestStoreParameters parameters = XmlTestStoreParameters.GetParameters();
XmlElement rootElement = helper.CreateRootElement("TestRun");
// Create test run
if (this.testRun == null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

        [](start = 0, length = 12)

Add UTs for this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UT added.

XmlElement rootElement = helper.CreateRootElement("TestRun");
// Create test run
// If abort occurs there is no call to TestResultHandler which results in testRun not created.
if (this.testRun == null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mention this happens when first batch itself aborts

@@ -515,6 +515,18 @@ public void TestResultHandlerShouldAddSingleTestEntryForOrderedTest()
Assert.AreEqual(this.testableTrxLogger.TestEntryCount, 1, "TestResultHandler is adding multiple test entries for ordered test.");
}

[TestMethod]
public void TestRunCompleteHandlerShouldReportFailedOutcomeIfTestRunIsAborted()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add check for attachments

@vagisha-nidhi vagisha-nidhi merged commit 2e18a57 into microsoft:master Aug 3, 2018
@vagisha-nidhi vagisha-nidhi deleted the TrxLoggerFix branch August 3, 2018 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants