Add support for testcase.attachments #51
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces extends testcase with an attachments array. Currently supported for the following implementations:
XUnit(not supported)A few implementation notes:
JUnit:
Based on the Jenkins Plugin Attachment plugin which inspects the
<system.out>
property in the XML for the following syntax:[[ATTACHMENT|/absolute/path/tofile.png]]
I have confirmed that the azure-devops build-agent test publisher uses this convention as well. The path can be an absolute path or relative to the location of the test results xml.
MSTest:
Attachments appear in the xml under the test result for a given execution:
Calls to
TestContext.AddResultFile(filename)
copies the file into a special folder per test, which is a combination of TestRun name + Test Execution id + Machine Name, relative to the location of the test results xml file.The test-parser mstest implementation expands out the relative path from the XML into a value that can be resolved at runtime relative to the test results xml file.
NUnit:
Very straight-forward as NUnit only accepts absolute paths.
Addresses: