Skip to content

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

@nigurr

Description

@nigurr

In case of invalid test result path/attachment, currently TRX logger fails to write testresult outcome causing test results to be reported in Invalid state.

<StdErr>Failed to attach files from: MSTestAdapterV2&#xD;
Error Details: System.IO.DirectoryNotFoundException:System.IO.DirectoryNotFoundException: Could not find a part of the path 'E:\agent_work\1\s\TestResults\Deploy_wpsetwtt 2018-07-25 21_58_17\In\GetTokenInfoByInvalidCode_LogFile.txt'.&#xD;
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)&#xD;
   at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)&#xD;
   at System.IO.File.Copy(String sourceFileName, String destFileName, Boolean overwrite)&#xD;
   at Microsoft.TestPlatform.Extensions.TrxLogger.Utility.Converter.CopyFile(String sourceFile, String targetFile)&#xD;
   at Microsoft.TestPlatform.Extensions.TrxLogger.Utility.Converter.ToResultFiles(AttachmentSet attachmentSet, Guid testResultExecutionId, TestRun testRun, String trxFileDirectory)&#xD;
   at Microsoft.TestPlatform.Extensions.TrxLogger.Utility.Converter.UpdateTestResultAttachments(TestResult rockSteadyTestResult, TestResult testResult, TestRun testRun, String trxFileDirectory, Boolean addAttachments)</StdErr>

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions