Skip to content

Commit 9a899ac

Browse files
committed
Revert "[server] Temporarily disable broken bitbucket tests"
This reverts commit 1f9e9e8.
1 parent 1f9e9e8 commit 9a899ac

File tree

5 files changed

+17
-13
lines changed

5 files changed

+17
-13
lines changed

components/server/src/bitbucket-server/bitbucket-server-api.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
import { User } from "@gitpod/gitpod-protocol";
8+
import { ifEnvVarNotSet } from "@gitpod/gitpod-protocol/lib/util/skip-if";
89
import { Container, ContainerModule } from "inversify";
910
import { retries, skip, suite, test, timeout } from "@testdeck/mocha";
1011
import { expect } from "chai";
@@ -18,7 +19,7 @@ import { TokenProvider } from "../user/token-provider";
1819
import { BitbucketServerApi } from "./bitbucket-server-api";
1920
import { HostContextProvider } from "../auth/host-context-provider";
2021

21-
@suite(timeout(10000), retries(0), skip(true) /*skip(ifEnvVarNotSet("GITPOD_TEST_TOKEN_BITBUCKET_SERVER"))*/)
22+
@suite(timeout(10000), retries(0), skip(ifEnvVarNotSet("GITPOD_TEST_TOKEN_BITBUCKET_SERVER")))
2223
class TestBitbucketServerApi {
2324
protected api: BitbucketServerApi;
2425
protected user: User;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
import { User } from "@gitpod/gitpod-protocol";
8+
import { ifEnvVarNotSet } from "@gitpod/gitpod-protocol/lib/util/skip-if";
89
import { Container, ContainerModule } from "inversify";
910
import { skip, suite, test, timeout } from "@testdeck/mocha";
1011
import { expect } from "chai";
@@ -20,7 +21,7 @@ import { BitbucketServerApi } from "./bitbucket-server-api";
2021
import { HostContextProvider } from "../auth/host-context-provider";
2122
import { URL } from "url";
2223

23-
@suite(timeout(10000), skip(true) /*skip(ifEnvVarNotSet("GITPOD_TEST_TOKEN_BITBUCKET_SERVER"))*/)
24+
@suite(timeout(10000), skip(ifEnvVarNotSet("GITPOD_TEST_TOKEN_BITBUCKET_SERVER")))
2425
class TestBitbucketServerContextParser {
2526
protected parser: BitbucketServerContextParser;
2627
protected user: User;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
import { Repository, User } from "@gitpod/gitpod-protocol";
8+
import { ifEnvVarNotSet } from "@gitpod/gitpod-protocol/lib/util/skip-if";
89
import { Container, ContainerModule } from "inversify";
910
import { retries, skip, suite, test, timeout } from "@testdeck/mocha";
1011
import { expect } from "chai";
@@ -19,7 +20,7 @@ import { TokenProvider } from "../user/token-provider";
1920
import { BitbucketServerApi } from "./bitbucket-server-api";
2021
import { HostContextProvider } from "../auth/host-context-provider";
2122

22-
@suite(timeout(10000), retries(1), skip(true) /*skip(ifEnvVarNotSet("GITPOD_TEST_TOKEN_BITBUCKET_SERVER"))*/)
23+
@suite(timeout(10000), retries(1), skip(ifEnvVarNotSet("GITPOD_TEST_TOKEN_BITBUCKET_SERVER")))
2324
class TestBitbucketServerFileProvider {
2425
protected service: BitbucketServerFileProvider;
2526
protected user: User;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
import { User } from "@gitpod/gitpod-protocol";
8+
import { ifEnvVarNotSet } from "@gitpod/gitpod-protocol/lib/util/skip-if";
89
import { Container, ContainerModule } from "inversify";
910
import { retries, skip, suite, test, timeout } from "@testdeck/mocha";
1011
import { expect } from "chai";
@@ -19,7 +20,7 @@ import { BitbucketServerApi } from "./bitbucket-server-api";
1920
import { HostContextProvider } from "../auth/host-context-provider";
2021
import { BitbucketServerRepositoryProvider } from "./bitbucket-server-repository-provider";
2122

22-
@suite(timeout(10000), retries(0), skip(true) /*skip(ifEnvVarNotSet("GITPOD_TEST_TOKEN_BITBUCKET_SERVER"))*/)
23+
@suite(timeout(10000), retries(0), skip(ifEnvVarNotSet("GITPOD_TEST_TOKEN_BITBUCKET_SERVER")))
2324
class TestBitbucketServerRepositoryProvider {
2425
protected service: BitbucketServerRepositoryProvider;
2526
protected user: User;

components/server/src/bitbucket-server/bitbucket-server-token-validator.spec.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* See License.AGPL.txt in the project root for license information.
55
*/
66

7+
import { ifEnvVarNotSet } from "@gitpod/gitpod-protocol/lib/util/skip-if";
78
import { Container, ContainerModule } from "inversify";
89
import { retries, skip, suite, test, timeout } from "@testdeck/mocha";
910
import { expect } from "chai";
@@ -14,12 +15,12 @@ import { BitbucketServerTokenHelper } from "./bitbucket-server-token-handler";
1415
import { TokenProvider } from "../user/token-provider";
1516
import { IGitTokenValidatorParams } from "../workspace/git-token-validator";
1617

17-
// const shouldSkip =
18-
// ifEnvVarNotSet("GITPOD_TEST_TOKEN_BITBUCKET_SERVER_READ") &&
19-
// ifEnvVarNotSet("GITPOD_TEST_TOKEN_BITBUCKET_SERVER_WRITE") &&
20-
// ifEnvVarNotSet("GITPOD_TEST_TOKEN_BITBUCKET_SERVER_ADMIN");
18+
const shouldSkip =
19+
ifEnvVarNotSet("GITPOD_TEST_TOKEN_BITBUCKET_SERVER_READ") &&
20+
ifEnvVarNotSet("GITPOD_TEST_TOKEN_BITBUCKET_SERVER_WRITE") &&
21+
ifEnvVarNotSet("GITPOD_TEST_TOKEN_BITBUCKET_SERVER_ADMIN");
2122

22-
@suite(timeout(10000), retries(0), skip(true) /*skip(shouldSkip)*/)
23+
@suite(timeout(10000), retries(0), skip(shouldSkip))
2324
class TestBitbucketServerTokenValidator {
2425
static readonly AUTH_HOST_CONFIG: Partial<AuthProviderParams> = {
2526
id: "MyBitbucketServer",
@@ -68,8 +69,7 @@ class TestBitbucketServerTokenValidator {
6869
return container.get(BitbucketServerTokenValidator);
6970
}
7071

71-
@test(skip(true) /*skip(ifEnvVarNotSet("GITPOD_TEST_TOKEN_BITBUCKET_SERVER_READ"))*/)
72-
async test_checkWriteAccess_read_only() {
72+
@test(skip(ifEnvVarNotSet("GITPOD_TEST_TOKEN_BITBUCKET_SERVER_READ"))) async test_checkWriteAccess_read_only() {
7373
const token = process.env["GITPOD_TEST_TOKEN_BITBUCKET_SERVER_READ"]!;
7474
const result = await this.getValidator(token).checkWriteAccess(Object.assign({}, this.checkParams, { token }));
7575
expect(result).to.deep.equal({
@@ -79,7 +79,7 @@ class TestBitbucketServerTokenValidator {
7979
});
8080
}
8181

82-
@test(skip(true) /*skip(ifEnvVarNotSet("GITPOD_TEST_TOKEN_BITBUCKET_SERVER_WRITE"))*/)
82+
@test(skip(ifEnvVarNotSet("GITPOD_TEST_TOKEN_BITBUCKET_SERVER_WRITE")))
8383
async test_checkWriteAccess_write_permissions() {
8484
const token = process.env["GITPOD_TEST_TOKEN_BITBUCKET_SERVER_WRITE"]!;
8585
const result = await this.getValidator(token).checkWriteAccess(Object.assign({}, this.checkParams, { token }));
@@ -90,7 +90,7 @@ class TestBitbucketServerTokenValidator {
9090
});
9191
}
9292

93-
@test(skip(true) /*skip(ifEnvVarNotSet("GITPOD_TEST_TOKEN_BITBUCKET_SERVER_ADMIN"))*/)
93+
@test(skip(ifEnvVarNotSet("GITPOD_TEST_TOKEN_BITBUCKET_SERVER_ADMIN")))
9494
async test_checkWriteAccess_admin_permissions() {
9595
const token = process.env["GITPOD_TEST_TOKEN_BITBUCKET_SERVER_ADMIN"]!;
9696
const result = await this.getValidator(token).checkWriteAccess(Object.assign({}, this.checkParams, { token }));

0 commit comments

Comments
 (0)