Skip to content

Commit 0c4551e

Browse files
committed
test scenario passing
1 parent fd4eb24 commit 0c4551e

5 files changed

+18
-18
lines changed

components/server/src/bitbucket/bitbucket-context-parser.spec.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ class TestBitbucketContextParser {
214214
"ref": "feature/JIRA-123-summary",
215215
"refType": "branch",
216216
"path": "",
217-
"revision": "5a24a0c8a7b42c2e6418593d788e17cb987bda25",
217+
"revision": "bcf3a4b9329385b7a5f50a4490b79570da029cf3",
218218
"isFile": false,
219219
"repository": {
220220
"host": "bitbucket.org",
@@ -386,8 +386,8 @@ class TestBitbucketContextParser {
386386
"repository": {
387387
"host": "bitbucket.org",
388388
"owner": "corneliusltf",
389-
"name": "integration-tests",
390-
"cloneUrl": "https://bitbucket.org/corneliusltf/integration-tests.git",
389+
"name": "sample-repository",
390+
"cloneUrl": "https://bitbucket.org/corneliusltf/sample-repository.git",
391391
"defaultBranch": "master",
392392
"private": false,
393393
"fork": {
@@ -443,18 +443,18 @@ class TestBitbucketContextParser {
443443
}
444444

445445
@test public async testSrcContextForkedRepo_01() {
446-
const result = await this.parser.handle({}, this.user, 'https://bitbucket.org/gitpod/clu-sample-repo/src/master/');
446+
const result = await this.parser.handle({}, this.user, 'https://bitbucket.org/gitpod/integration-tests-forked-repository/src/master/');
447447
expect(result).to.deep.include({
448448
"ref": "master",
449449
"refType": "branch",
450450
"path": "",
451-
"revision": "d932021835e4024136a4f608719720d414490c73",
451+
"revision": "3f1c8403570427170bd3776cfb3aa24c688c2b29",
452452
"isFile": false,
453453
"repository": {
454454
"host": "bitbucket.org",
455455
"owner": "gitpod",
456-
"name": "clu-sample-repo",
457-
"cloneUrl": "https://bitbucket.org/gitpod/clu-sample-repo.git",
456+
"name": "integration-tests-forked-repository",
457+
"cloneUrl": "https://bitbucket.org/gitpod/integration-tests-forked-repository.git",
458458
"defaultBranch": "master",
459459
"private": false,
460460
"fork": {
@@ -468,7 +468,7 @@ class TestBitbucketContextParser {
468468
}
469469
}
470470
},
471-
"title": "gitpod/clu-sample-repo - master"
471+
"title": "gitpod/integration-tests-forked-repository - master"
472472
})
473473
}
474474

components/server/src/bitbucket/bitbucket-context-parser.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ export class BitbucketContextParser extends AbstractContextParser implements ICo
5858
}
5959
case "branch": {
6060
const more: Partial<NavigatorContext> = {};
61-
const branch = moreSegments.length > 1 ? moreSegments[1] : "";
62-
more.ref = branch;
61+
const pathSegments = moreSegments.length > 1 ? moreSegments.slice(1) : [];
62+
more.ref = pathSegments.join("/");
6363
more.refType = "branch";
6464
return this.handleNavigatorContext(ctx, user, host, owner, repoName, more);
6565
}

components/server/src/bitbucket/bitbucket-file-provider.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ class TestBitbucketFileProvider {
6161
}
6262

6363
@test public async testGetFileContents() {
64-
const result = await this.fileProvider.getFileContent({ repository: { owner: "gitpod", name: "sample-repository" }, revision: "5a24a0c" } as Commit, this.user, "README.md");
64+
const result = await this.fileProvider.getFileContent({ repository: { owner: "gitpod", name: "integration-tests" }, revision: "5a24a0c" } as Commit, this.user, "README.md");
6565
expect(result).to.equal(`# README #
6666
6767
This is the readme of the second branch.`);
6868
}
6969

7070
@test public async testGetLastChangeRevision() {
71-
const result = await this.fileProvider.getLastChangeRevision({ owner: "gitpod", name: "sample-repository" } as Repository, "second-branch", this.user, "README.md");
71+
const result = await this.fileProvider.getLastChangeRevision({ owner: "gitpod", name: "integration-tests" } as Repository, "second-branch", this.user, "README.md");
7272
expect(result).to.equal("5a24a0c8a7b42c2e6418593d788e17cb987bda25");
7373
}
7474
}

components/server/src/bitbucket/bitbucket-language-provider.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class TestBitbucketLanguageProvider {
6161
}
6262

6363
@test public async testGetLanguages() {
64-
const result = await this.languageProvider.getLanguages({ owner: "gitpod", name: "sample-repository" } as Repository, this.user);
64+
const result = await this.languageProvider.getLanguages({ owner: "gitpod", name: "integration-tests" } as Repository, this.user);
6565
expect(result).to.deep.equal({ "markdown": 100.0 });
6666
}
6767

components/server/src/bitbucket/bitbucket-repository-provider.spec.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ class TestBitbucketRepositoryProvider {
6161
}
6262

6363
@test public async testGetRepo() {
64-
const result = await this.repoProvider.getRepo(this.user, "gitpod", "sample-repository");
64+
const result = await this.repoProvider.getRepo(this.user, "gitpod", "integration-tests");
6565
expect(result).to.deep.include({
6666
host: "bitbucket.org",
6767
owner: "gitpod",
68-
name: "sample-repository",
69-
cloneUrl: "https://[email protected]/gitpod/sample-repository.git",
70-
description: "This is a sample repository.",
71-
webUrl: "https://bitbucket.org/gitpod/sample-repository",
68+
name: "integration-tests",
69+
cloneUrl: "https://gitpod-test@bitbucket.org/gitpod/integration-tests.git",
70+
description: "This is the repository used for integration tests.",
71+
webUrl: "https://bitbucket.org/gitpod/integration-tests",
7272
});
7373
}
7474

0 commit comments

Comments
 (0)