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

Publish VSTest: Skipping attachment as it exceeded the maximum allowed size or not available on disk #4666

Closed
GuofuZhong opened this issue Jun 28, 2017 · 14 comments
Assignees

Comments

@GuofuZhong
Copy link

I'm writing a script to merge multiple trx and publish to vsts.

But we meet this error

https://msasg.visualstudio.com/Bing_Ads/_build/index?buildId=523744&_a=summary

In Publish UI Test Result step.

we want to upload a lot of attachment of selenium screen snapshots to VSTS. How to avoid this warning?

I checked on agent. our test merged directory just 25MB

@kheops321
Copy link

Hi GuofuZhong,
we are also having the same issue on VSTS using our onPremise agent pool.
It works fine for trx but we are not able to attach coverage results.
Here is the error message :

##[warning]Skipping attachment as it exceeded the maximum allowed size or not available on disk: C:\BuildAgents\A_work\21\s\TestResults\buildAgent_BUILD-VM_2017-06-30_10_00_30\In\BUILD-VM\buildAgent_BUILD-VM 2017-06-30 10_00_24.coverage

When we dug into it, we found that there is a bug in the path construction of this file .

VSTS tryed to get the file from the directory [...\buildAgent_BUILD-VM**2017-06-30**10_00_30...] but the real directory name is [...\buildAgent_BUILD-VM 2017-06-30 10_00_30...]

I don't know how or why but VSTS added 2 extra underscores "_" to this directory name :SS

We still following this issue to figure ou. To be continued...

@dpksinghal
Copy link
Member

@SadagopanRajaram's team is looking into it.

@dpksinghal
Copy link
Member

Posting on behalf of Sudipta.

_The attachment path for results assume certain elements in the path. Once Guofu fixed those paths, the files got uploaded properly. We are internally checking if we need to support a wider array of path variations. The key xpaths to check in trx file for paths are:

  1. /TestRun/TestSettings/Execution/AgentRule/DataCollectors/DataCollector/Configuration/CodeCoverage/Regular/CodeCoverageItem
  2. /TestRun/ResultSummary/ResultFiles/ResultFile
  3. /ResultFiles/ResultFile

If the trx file is shared, we can provide more insight._

@GuofuZhong
Copy link
Author

GuofuZhong commented Jul 12, 2017

@dpksinghal Hi dpksinghal, Sudipta already got my trx file and atttachment zip packages.
he have more context for this issue.
it have two bugs in vsts-task.

  1. in TrxReader.cs Line 29: _attachmentLocation = Path.Combine(Path.GetDirectoryName(filePath), Path.GetFileNameWithoutExtension(filePath), "In");
    so attachmentRoot Location will become the trx file name. but the correctly way to find the location is “”
  2. from trxreader.cs,
    resulLeveltAttachments.Add(Path.Combine(_attachmentLocation, executionId, resultFileNode.Attributes["path"].Value));
    attachment directory is executionId.
    but the correct way to get attachment path is use "relativeResultsDirectory" instead of "executionId"

<UnitTestResult **executionId**="9430a3e0-9cd6-410d-b46d-276e0ce28a07" testId="ecfa54f0-d9d7-bf2c-77ef-bc2f7c0183ea" testName="XXXXXX" computerName="xxxx" duration="00:11:44.5534211" startTime="2017-07-11T00:30:42.6688976+08:00" endTime="2017-07-11T00:42:27.3233242+08:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Failed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" **relativeResultsDirectory**="9430a3e0-9cd6-410d-b46d-276e0ce28a07">

@artisticcheese
Copy link

This is still present in U2 for webtests

@cltshivash
Copy link
Contributor

Update from Sudipta:

"The behavior is unchanged in U2. We are looking at fixing the issue for future releases"

@artisticcheese
Copy link

Why this big is closed though if it's still not fixed?

@peggybear
Copy link

Is there a workaround for this?

@artisticcheese
Copy link

I run following powershell script at the end of execution run to fix the issue

move-item -Path (join-path -path $path -Childpath (get-childitem -Path $path -Name "in" -Directory -Recurse)) -Destination $path\webtest

@peggybear
Copy link

@artisticcheese I am running my tests and reporting testresults&code coverage all in one visual studio test task step. This is the only way to publish code coverage without converting it to cobertura or jacoco format. Are you using visual studio test task?

@artisticcheese
Copy link

I run tests manually in script like below

$tool = "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\MSTest.exe",
    $path = $psscriptroot,
    $item = "$path\webtest1.webtest",
    $results = "$path\webtest.trx",
    $testsettings = "$path\Local.testsettings",
    $expectedReleaseHeader = "webredirect:20170726_1050",
    $urlTest = "http://10.45.122.51:8080"
& $tool /TestContainer:$item /resultsfile:$Results /testsettings:$testsettings /noisolation

@peggybear
Copy link

FYI, looks like they fixed it here https://github.com/Microsoft/vsts-agent/pull/1149/files

@artisticcheese
Copy link

Not sure how to install it on TFS 2017 U2 on premises

@peggybear
Copy link

they'll update hosted agents as well (hopefully) so I don't think you need to install it on premise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants