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

VSTest publishRunAttachments has no effect that something gets published #13142

Closed
soutchilin opened this issue Jun 17, 2020 · 12 comments
Closed

Comments

@soutchilin
Copy link

Hi, I've just added a new issue to the closed one. Please take a look and advise if I have to create a new issue instead. #12183

Thanks!

@ShreyasRmsft
Copy link
Member

Yes, add the details here along with full zip logs with system.debug set to true.

@soutchilin
Copy link
Author

Cool, where/how I can privately transfer the data?

@ShreyasRmsft
Copy link
Member

You can drop a mail to devops_tools@microsoft.com make sure you provide the github issue link in the mail along with updating other details in the issue here.

@soutchilin
Copy link
Author

Thanks, I've just sent it.

@soutchilin
Copy link
Author

I've got an auto-response, that your e-mail address cannot be used for unknown sender. How can I reach you?

@ShreyasRmsft
Copy link
Member

@soutchilin can confirm we received the attachment. There's some sub groups in that list that throw this error, where mails from external contacts are not allowed. Anyway we'll get back to you after analyzing the logs.

@soutchilin
Copy link
Author

Cool, thanks.

@saquibkhan
Copy link

saquibkhan commented Jun 30, 2020

@ suyash691 We will need your help here. Our analysis so far,

looking at the log we see upload was successful but we didn't receive one final success log from UploadInternalAsync

Logs:

Publishing Attachments: 2
2020-06-26T14:03:59.6416062Z ##[debug]Entering CreateTestRunAttachmentsAsync
2020-06-26T14:03:59.6759562Z ##[debug]Leaving CreateTestRunAttachmentsAsync
2020-06-26T14:03:59.6789410Z ##[debug]Uploading test run attachements individually
2020-06-26T14:03:59.6900588Z ##[debug]Entering UploadTestRunLogAsync
2020-06-26T14:03:59.7924848Z ##[debug]Entering UploadTestRunLogAsync
2020-06-26T14:03:59.9857136Z ##[debug]Blob name: GeneralAttachment/VssAdministrator_WIN-3JJ00UM1G1G_2020-06-26_14_03_52.trx .
2020-06-26T14:03:59.9859044Z ##[debug]Blob name: CodeCoverage/VssAdministrator_WIN-3JJ00UM1G1G 2020-06-26 14_03_39.coverage .
2020-06-26T14:04:00.9534632Z ##[debug]File uploaded successsfully on LogStore VssAdministrator_WIN-3JJ00UM1G1G 2020-06-26 14_03_39.coverage
2020-06-26T14:04:00.9535778Z ##[debug]File uploaded successsfully on LogStore VssAdministrator_WIN-3JJ00UM1G1G_2020-06-26_14_03_52.trx
2020-06-26T14:04:00.9567053Z ##[debug]Completed PublishTestResult
2020-06-26T14:04:00.9567491Z ##[debug]PERF: PublishTestResultPhase.Publish: took 2055.8629 ms
2020-06-26T14:04:00.9567895Z ##[debug]Completed Publish Test Results.
2020-06-26T14:04:00.9568491Z ##[debug]Current Phase: MS.VS.TestService.VstestConsoleAdapter.PublishTestResultPhase Phase Result: MS.VS.TestService.VstestConsoleAdapter.PublishTestResultPhaseResults
2020-06-26T14:04:00.9569266Z ##[debug]PERF WARNING: Running the phase MS.VS.TestService.VstestConsoleAdapter.PublishTestResultPhase: took 2061.8152 ms
2020-06-26T14:03:59.9857136Z ##[debug]Blob name: GeneralAttachment/VssAdministrator_WIN-3JJ00UM1G1G_2020-06-26_14_03_52.trx .
2020-06-26T14:03:59.9859044Z ##[debug]Blob name: CodeCoverage/VssAdministrator_WIN-3JJ00UM1G1G 2020-06-26 14_03_39.coverage .
2020-06-26T14:04:00.9534632Z ##[debug]File uploaded successsfully on LogStore VssAdministrator_WIN-3JJ00UM1G1G 2020-06-26 14_03_39.coverage
2020-06-26T14:04:00.9535778Z ##[debug]File uploaded successsfully on LogStore VssAdministrator_WIN-3JJ00UM1G1G_2020-06-26_14_03_52.trx

I tracked till this function:

protected virtual async Task<TestLogStatus> UploadInternalAsync(Guid projectId, TestLogScope scope, int buildId, int runId, string logFileSourcePath, Stream stream, string fileName,
            TestLogType logType, int testResultId, int testSubResultId, Dictionary<string, string> metaData, TelemetryTracker telTracker, bool allowDuplicate = false, TestLogCompressionType logCompressionType = TestLogCompressionType.None, string originalFileContentType = null)
        {
            TestLogStatus ret = new TestLogStatus();
            ret.Status = TestLogStatusCode.Success;
            try
            {
                ret = await _executeWithRetry(
                async () => {
                    //action is executed on first attempt
                    if (allowDuplicate)
                    {
                        return await _getContainerAndUpload(projectId, scope, buildId, runId, logFileSourcePath, stream, fileName, logType, testResultId, testSubResultId, metaData, telTracker, isDuplicate: true, logCompressionType: logCompressionType, originalFileContentType: originalFileContentType).ConfigureAwait(false);
                    }
                    else
                    {
                        return await _getContainerAndUpload(projectId, scope, buildId, runId, logFileSourcePath, stream, fileName, logType, testResultId, testSubResultId, metaData, telTracker, isDuplicate: false, logCompressionType: logCompressionType, originalFileContentType: originalFileContentType).ConfigureAwait(false);
                    }
                },
                async () => {
                    //action is executed when upload fails if file with same name is present on azure
                    return await _getContainerAndUpload(projectId, scope, buildId, runId, logFileSourcePath, stream, fileName, logType, testResultId, testSubResultId, metaData, telTracker, isDuplicate: true, logCompressionType: logCompressionType, originalFileContentType: originalFileContentType).ConfigureAwait(false);
                },
                async () => {
                    //action is executed if SAS is expired
                    if (allowDuplicate)
                    {
                        return await _getContainerAndUpload(projectId, scope, buildId, runId, logFileSourcePath, stream, fileName, logType, testResultId, testSubResultId, metaData, telTracker, isDuplicate: true, isSasExpired: true, logCompressionType: logCompressionType, originalFileContentType: originalFileContentType).ConfigureAwait(false);
                    }
                    else
                    {
                        return await _getContainerAndUpload(projectId, scope, buildId, runId, logFileSourcePath, stream, fileName, logType, testResultId, testSubResultId, metaData, telTracker, isDuplicate: false, isSasExpired: true, logCompressionType: logCompressionType, originalFileContentType: originalFileContentType).ConfigureAwait(false);
                    }
                }, allowDuplicate
                , allowRetryOnNetworkingError: true
                , telemetryTracker: telTracker
                ).ConfigureAwait(false);
                if (ret.Status != TestLogStatusCode.Success)
                {
                    return ret;
                }
            }
            catch (TransferSkippedException tex)
            {
                _traceSourceLogger.Warning(_stringFormatter.Format(Resource.Manager.GetString("FileAlreadyExists"), fileName));
                return _getTestLogReturnStatus(TestLogStatusCode.FileAlreadyExists, tex.ToString(), telTracker);
            }
            catch (TransferException ex)
            {
                _traceSourceLogger.Warning(_stringFormatter.Format(Resource.Manager.GetString("UploadFailedTransferException"), fileName, ex.ErrorCode.ToString(), ex.ToString()));
                return _getTestLogReturnStatus(TestLogStatusCode.TransferFailed, ex.ToString(), telTracker, ex.ErrorCode.ToString());
            }
            catch (Exception ex)
            {
                _traceSourceLogger.Warning(_stringFormatter.Format(Resource.Manager.GetString("UploadBlobFailed"), fileName, ex.ToString()));
                return _getTestLogReturnStatus(TestLogStatusCode.Failed, ex.ToString(), telTracker);
            }
            _traceSourceLogger.Debug(_stringFormatter.Format(Resource.Manager.GetString("FileUploadCompleted"), fileName));
            return ret;
        }

But if you see the logs we don't have this trace in logs _traceSourceLogger.Debug(_stringFormatter.Format(Resource.Manager.GetString("FileUploadCompleted"), from above UploadInternalAsync function

@soutchilin
Copy link
Author

So, ok, what does it mean?

@soutchilin
Copy link
Author

I've found, that if the CC has not found any DLL to include in the result, then this is the behavior. In Visual Studio it is visible, because you see the CC result. So, it's solved for my end. But maybe you should check the code with this scenario to have more clear behavior in the pipeline.

@saquibkhan
Copy link

saquibkhan commented Jul 7, 2020

@soutchilin Good to hear that you are unblocked and the issue is resolved at your end. We will take a look further into this issue.

@github-actions
Copy link

github-actions bot commented Apr 5, 2021

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

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

5 participants