1
0
mirror of https://github.com/sasjs/adapter.git synced 2025-12-11 09:24:35 +00:00

Compare commits

..

10 Commits

Author SHA1 Message Date
Allan Bowe
e9422898b6 Merge pull request #751 from sasjs/quick-fix
fix: should not assign error to parsedSasjsServeLog
2022-08-28 22:42:07 +01:00
2b7281e70c fix: should not assign error to parsedSasjsServeLog 2022-08-29 02:34:13 +05:00
Allan Bowe
c1e3a9f5bb Merge pull request #745 from sasjs/matrix
chore: moving github docs to .github folder and migrating discord hook to matrix
2022-08-25 12:44:12 +01:00
Sabir Hassan
d249295b49 Merge pull request #749 from sasjs/update-sasjs-request-client
fix: update parse response method of sasjsRequestClient
2022-08-25 00:19:33 +05:00
010fd063df fix: update parse response method of sasjsRequestClient 2022-08-25 00:06:10 +05:00
munja
3b53d5b3ae chore: fix body 2022-08-07 14:52:42 +01:00
munja
dfebab5abc chore: fix body 2022-08-07 14:52:08 +01:00
munja
8d5ee0d6e1 chore: json payload 2022-08-07 14:16:36 +01:00
munja
1ed7a11fc3 chore: testing json payload 2022-08-07 14:03:59 +01:00
munja
abe95f5432 chore: moving github docs to .github folder and migrating discord hook to matrix 2022-08-07 13:47:50 +01:00
8 changed files with 21 additions and 24 deletions

View File

@@ -24,16 +24,16 @@ jobs:
- name: Check npm audit
run: npm audit --production --audit-level=low
- name: Install Dependencies
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:
@@ -41,7 +41,7 @@ jobs:
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
with:
key: ${{ secrets.DCGITLAB_KEY }}
known_hosts: 'placeholder'
@@ -88,7 +88,7 @@ jobs:
replace-in-files --regex='"sasjsTestsUrl".*' --replacement='"sasjsTestsUrl":"${{ secrets.SASJS_TEST_URL_VIYA }}",' ./cypress.json
replace-in-files --regex='"username".*' --replacement='"username":"${{ secrets.SASJS_USERNAME }}",' ./cypress.json
replace-in-files --regex='"password".*' --replacement='"password":"${{ secrets.SASJS_PASSWORD }}",' ./cypress.json
sh ./sasjs-cypress-run.sh ${{ secrets.DISCORD_WEBHOOK }} https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
sh ./sasjs-tests/sasjs-cypress-run.sh ${{ secrets.MATRIX_TOKEN }} https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
# For some reason if coverage report action is run before other commands, those commands can't access the directories and files on which they depend on
- name: Generate coverage report

View File

@@ -1,10 +0,0 @@
#!/bin/bash
if npm run cy:run -- --spec "cypress/integration/sasjs.tests.ts" ; then
echo "Cypress sasjs testing passed!"
else
curl -X POST --header "Content-Type:application/json" --data '{"username":"GitHub CI - Adapter SASJS-TESTS (FAIL)", "content":"Automated sasjs-tests failed on the @sasjs/adapter PR on following link.\n'$2'", "avatar_url":"https://i.ibb.co/Lpk7Xvq/error-outline.png"}' $1
echo "Cypress sasjs testing failed!"
exit 1
fi

View File

@@ -0,0 +1,10 @@
#!/bin/bash
if npm run cy:run -- --spec "cypress/integration/sasjs.tests.ts" ; then
echo "Cypress sasjs testing passed!"
else
echo '{"msgtype":"m.text", "body":"Automated sasjs-tests failed on the @sasjs/adapter PR: '$2'"}'
curl -XPOST -d '{"msgtype":"m.text", "body":"Automated sasjs-tests failed on the @sasjs/adapter PR: '$2'"}' https://matrix.4gl.io/_matrix/client/r0/rooms/%21BDUPBPEGVvRLKLQUxY:4gl.io/send/m.room.message?access_token=$1
echo "Cypress sasjs testing failed!"
exit 1
fi

View File

@@ -88,9 +88,6 @@ export class SASjsApiClient {
.then((res: any) => {
if (res.log) parsedSasjsServerLog = res.log
})
.catch((err) => {
parsedSasjsServerLog = err
})
return parsedSasjsServerLog
}

View File

@@ -26,7 +26,7 @@ export class SasjsRequestClient extends RequestClient {
protected parseResponse<T>(response: AxiosResponse<any>) {
const etag = response?.headers ? response.headers['etag'] : ''
let parsedResponse
let parsedResponse = {}
let log
try {
@@ -37,10 +37,10 @@ export class SasjsRequestClient extends RequestClient {
}
} catch {
if (response.data.includes(SASJS_LOGS_SEPARATOR)) {
parsedResponse = getValidJson(
response.data.split(SASJS_LOGS_SEPARATOR)[0]
)
log = response.data.split(SASJS_LOGS_SEPARATOR)[1]
const splittedResponse = response.data.split(SASJS_LOGS_SEPARATOR)
log = splittedResponse[1]
if (splittedResponse[0].trim())
parsedResponse = getValidJson(splittedResponse[0])
} else parsedResponse = response.data
}