Skip to content

Commit 14ecb6c

Browse files
authored
Use restricted environment for gh actions (#347)
1 parent 16c72f9 commit 14ecb6c

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
test-sdk:
2121
name: Test Databricks SDK
2222
runs-on: ${{ inputs.os }}
23+
environment:
24+
name: azure-prod-usr
2325

2426
defaults:
2527
run:

packages/databricks-sdk-js/src/services/WorkflowRun.integ.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe(__filename, function () {
1919
);
2020

2121
const dbfsApi = new DbfsService(integSetup.client);
22-
const jobPath = `/tmp/sdk-js-integ-${integSetup.testRunId}.py`;
22+
const jobPath = `/tmp/js-sdk-jobs-tests/sdk-js-integ-${integSetup.testRunId}.py`;
2323

2424
await dbfsApi.put({
2525
path: jobPath,
@@ -58,10 +58,10 @@ describe(__filename, function () {
5858
integSetup.cluster.id
5959
);
6060

61-
const jobPath = `/tmp/sdk-js-integ-${integSetup.testRunId}.py`;
61+
const jobPath = `/tmp/js-sdk-jobs-tests/sdk-js-integ-${integSetup.testRunId}.py`;
6262
const workspaceService = new WorkspaceService(integSetup.client);
6363

64-
await workspaceService.mkdirs({path: "/tmp"});
64+
await workspaceService.mkdirs({path: "/tmp/js-sdk-jobs-tests"});
6565

6666
await workspaceService.import({
6767
path: jobPath,
@@ -108,10 +108,10 @@ describe(__filename, function () {
108108
integSetup.cluster.id
109109
);
110110

111-
const jobPath = `/tmp/sdk-js-integ-${integSetup.testRunId}.py`;
111+
const jobPath = `/tmp/js-sdk-jobs-tests/sdk-js-integ-${integSetup.testRunId}.py`;
112112
const workspaceService = new WorkspaceService(integSetup.client);
113113

114-
await workspaceService.mkdirs({path: "/tmp"});
114+
await workspaceService.mkdirs({path: "/tmp/js-sdk-jobs-tests"});
115115

116116
await workspaceService.import({
117117
path: jobPath,

packages/databricks-sdk-js/src/services/WorkspaceConf.integ.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,20 @@ describe(__filename, function () {
88

99
this.timeout(10 * 60 * 1000);
1010

11-
before(async () => {
11+
before(async function () {
1212
integSetup = await IntegrationTestSetup.getInstance();
13+
try {
14+
const wsConf = new WorkspaceConf(integSetup.client);
15+
await wsConf.getStatus(["enableProjectTypeInWorkspace"]);
16+
} catch (e: any) {
17+
if (e.code === 403) {
18+
// eslint-disable-next-line no-console
19+
console.log(
20+
"Workspace conf tests require administrator permissions"
21+
);
22+
this.skip();
23+
}
24+
}
1325
});
1426

1527
it("should read configuration properties", async () => {

0 commit comments

Comments
 (0)