From d3738ad5cdd6a126ac0246633fa7b30c0813af14 Mon Sep 17 00:00:00 2001 From: Mihajlo Medjedovic Date: Thu, 10 Sep 2020 20:42:14 +0200 Subject: [PATCH 1/5] fix: waitForSession accessToken not passed --- src/SASViyaApiClient.ts | 2 +- src/SessionManager.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SASViyaApiClient.ts b/src/SASViyaApiClient.ts index 990c2bc..722f8ad 100644 --- a/src/SASViyaApiClient.ts +++ b/src/SASViyaApiClient.ts @@ -381,7 +381,7 @@ export class SASViyaApiClient { arguments: jobArguments }) } - + const { result: postedJob, etag } = await this.request( `${this.serverUrl}/compute/sessions/${executionSessionId}/jobs`, postJobRequest diff --git a/src/SessionManager.ts b/src/SessionManager.ts index a0c6fb9..405d32b 100644 --- a/src/SessionManager.ts +++ b/src/SessionManager.ts @@ -68,7 +68,7 @@ export class SessionManager { createSessionRequest ) - await this.waitForSession(createdSession, etag) + await this.waitForSession(createdSession, etag, accessToken) this.sessions.push(createdSession) return createdSession } From e6422644427b560a653df2c25d2b70e46c9ee98f Mon Sep 17 00:00:00 2001 From: Mihajlo Medjedovic Date: Thu, 10 Sep 2020 22:58:50 +0200 Subject: [PATCH 2/5] fix: execute script passing debug from global config --- src/SASjs.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/SASjs.ts b/src/SASjs.ts index 4b3bbcd..d34b39e 100644 --- a/src/SASjs.ts +++ b/src/SASjs.ts @@ -172,7 +172,9 @@ export default class SASjs { linesOfCode, contextName, accessToken, - silent + silent, + null, + this.sasjsConfig.debug ) } From c6857e857c0b53783a713998f46014158d13976b Mon Sep 17 00:00:00 2001 From: Krishna Acondy Date: Fri, 11 Sep 2020 08:07:37 +0100 Subject: [PATCH 3/5] chore(ci): run unit tests as part of build --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1c14f1e..188d999 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,6 +25,8 @@ jobs: run: npm ci - name: Check code style run: npm run lint + - name: Run unit tests + run: npm test - name: Build Package run: npm run package:lib env: From e897037c8ba11c3503ee4cf19b12816fb0a1a665 Mon Sep 17 00:00:00 2001 From: Krishna Acondy Date: Fri, 11 Sep 2020 08:20:39 +0100 Subject: [PATCH 4/5] chore(*): fix code formatting --- src/SASViyaApiClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SASViyaApiClient.ts b/src/SASViyaApiClient.ts index 9824cd9..bb8d00c 100644 --- a/src/SASViyaApiClient.ts +++ b/src/SASViyaApiClient.ts @@ -450,7 +450,7 @@ export class SASViyaApiClient { arguments: jobArguments }) } - + const { result: postedJob, etag } = await this.request( `${this.serverUrl}/compute/sessions/${executionSessionId}/jobs`, postJobRequest From e209902c1da0a43e44546f3ff6aa68321daced58 Mon Sep 17 00:00:00 2001 From: Krishna Acondy Date: Fri, 11 Sep 2020 08:28:22 +0100 Subject: [PATCH 5/5] chore(*): add code style section to doc --- CONTRIBUTING.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index df897d4..6992ad1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,6 +2,23 @@ Contributions to SASjs are very welcome! When making a PR, test cases should be included. +## Code Style + +This repository uses `Prettier` to ensure a uniform code style. +If you are using VS Code for development, you can automatically fix your code to match the style as follows: + +- Install the `Prettier` extension for VS Code. +- Open your `settings.json` file by choosing 'Preferences: Open Settings (JSON)' from the command palette. +- Add the following items to the JSON. + ``` + "editor.formatOnSave": true, + "editor.formatOnPaste": true, + ``` + +If you are using another editor, or are unable to install the extension, you can run `npm run lint:fix` to fix the formatting after you've made your changes. + +## Testing + This repository contains a suite of tests built using [@sasjs/test-framework](https://github.com/sasjs/test-framework). Detailed instructions for creating and running the tests can be found [here](https://github.com/sasjs/adapter/blob/master/sasjs-tests/README.md).