Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 5b1ab1e

Browse files
committed
test fix
1 parent 8db35ec commit 5b1ab1e

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/test/publishcodecoveragetests.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -238,17 +238,18 @@ describe('CodeCoveragePublisherTests', function() {
238238
it('codecoverage.publish : publish jacoco summary when there is no code coverage data', function(done) {
239239
this.timeout(2000);
240240

241-
var properties: { [name: string]: string } = { "summaryfile": emptyJacocoSummaryFile, "codecoveragetool": "JaCoCo" };
241+
var properties: { [name: string]: string } = { "summaryfile": emptyJacocoSummaryFile, "codecoveragetool": "JaCoCo", "reportdirectory": "", "additionalcodecoveragefiles": "" };
242242
var command: cm.ITaskCommand = new tc.TestCommand(null, null, null);
243243
command.properties = properties;
244-
var jacocoSummaryReader = new csr.JacocoSummaryReader(command);
245-
testExecutionContext = new tec.TestExecutionContext(new jobInf.TestJobInfo({}));
244+
var jobInfo = new jobInf.TestJobInfo({});
245+
jobInfo.variables = { "agent.workingDirectory": __dirname, "build.buildId": "1" };
246+
testExecutionContext = new tec.TestExecutionContext(jobInfo);
246247

247248
var codeCoveragePublishCommand = new cpc.CodeCoveragePublishCommand(testExecutionContext, command);
248249
codeCoveragePublishCommand.runCommandAsync().then(function(result) {
249250
assert(testExecutionContext.service.jobsCompletedSuccessfully(), 'CodeCoveragePublish Task Failed! Details : ' + testExecutionContext.service.getRecordsString());
250-
assert(!result);
251-
assert(testExecutionContext.service.containerItems.length == 0);
251+
assert(result);
252+
assert(testExecutionContext.service.containerItems.length == 1);
252253
done();
253254
},
254255
function(err) {
@@ -259,17 +260,18 @@ describe('CodeCoveragePublisherTests', function() {
259260
it('codecoverage.publish : publish cobertura summary when there is no code coverage data', function(done) {
260261
this.timeout(2000);
261262

262-
var properties: { [name: string]: string } = { "summaryfile": emptyCoberturaSummaryFile, "codecoveragetool": "cobertura" };
263+
var properties: { [name: string]: string } = { "summaryfile": emptyCoberturaSummaryFile, "codecoveragetool": "cobertura", "reportdirectory": "", "additionalcodecoveragefiles": "" };
263264
var command: cm.ITaskCommand = new tc.TestCommand(null, null, null);
264265
command.properties = properties;
265-
var coberturaSummaryReader = new csr.CoberturaSummaryReader(command);
266-
testExecutionContext = new tec.TestExecutionContext(new jobInf.TestJobInfo({}));
266+
var jobInfo = new jobInf.TestJobInfo({});
267+
jobInfo.variables = { "agent.workingDirectory": __dirname, "build.buildId": "1" };
268+
testExecutionContext = new tec.TestExecutionContext(jobInfo);
267269

268270
var codeCoveragePublishCommand = new cpc.CodeCoveragePublishCommand(testExecutionContext, command);
269271
codeCoveragePublishCommand.runCommandAsync().then(function(result) {
270272
assert(testExecutionContext.service.jobsCompletedSuccessfully(), 'CodeCoveragePublish Task Failed! Details : ' + testExecutionContext.service.getRecordsString());
271-
assert(!result);
272-
assert(testExecutionContext.service.containerItems.length == 0);
273+
assert(result);
274+
assert(testExecutionContext.service.containerItems.length == 1);
273275
done();
274276
},
275277
function(err) {

0 commit comments

Comments
 (0)