Closed DigiBanks99 closed 4 months ago
@eric-labelle Could I request a review please?
Sorry for the delays @DigiBanks99 . I'll try to work on it on this Friday afternoon. Thank you for your PR and patience. Much appreciated.
Hey @DigiBanks99 really sorry for the huge delay, I was assigned to other projects and had a hard time getting back on this. I managed to have a valid setup to test your PR, would you mind explaining a couple of things to me first? I tried it, but it does not work for me on a Release Pipeline it ends up with the following log
Task completed. Published 0/1 screenshots 2021-07-15T19:22:00.2823260Z (node:1772) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: name not supplied
Regarding the new parameter releaseContext
I dont believe this is necessary, and the values are not actually valid from what I've seen on the class It should be one of the following
That's why I sent undefined
when calling getTestResultsByBuild
so you could try that.
Also, was there a reason why you added a checkbox to specify if you are in a Release pipeline, but you still try to execute the code from a build pipeline. I'm sure there must be a way, either with predefined variables or the uri to know if we are in a release or a build pipeline and act accordingly i.e. - pseudo-code
if ( isBuildPipeline ) {
await testApi.getTestResultsByBuild(project, +(tl.getVariable("Build.BuildId") ?? 0), undefined, [TestOutcome.Failed])
.then(async failedTests => uploadScreenshots(failedTests))
.catch(err => tl.setResult(tl.TaskResult.Failed, err.message))
} else {
await testApi.getTestResultsByRelease(project, getVariableAsNumber("Release.ReleaseId"), getVariableAsNumberOrUndefined("Release.EnvironmentId"), undefined, [TestOutcome.Failed])
.then(async failedTests => uploadScreenshots(failedTests))
.catch(err => tl.setResult(tl.TaskResult.Failed, err.message));
}
One last thing, what was the need behind the parametrized separator? This seems unrelated to this PR.
Thanks
merge it guys, we need it :)
Closing pull requests because the extension is being deprecated and will no longer be maintained. An alternative solution is to use the Publish Test Result task which now supports file attachments.
Support deploying screenshots captured for tests run during the release phase.