From 452668af6ad7ccbf8d32379e15f9356d04de2d49 Mon Sep 17 00:00:00 2001 From: Anthony Brown <121869075+anthony-nhs@users.noreply.github.com> Date: Mon, 5 Feb 2024 12:50:34 +0000 Subject: [PATCH 1/7] debug coverage --- .github/workflows/quality_checks.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/quality_checks.yml b/.github/workflows/quality_checks.yml index b170054..04ac2d1 100644 --- a/.github/workflows/quality_checks.yml +++ b/.github/workflows/quality_checks.yml @@ -58,6 +58,9 @@ jobs: - name: run unit tests run: make test + - name: debug + run: ls coverage + - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master env: From 4e9d9223b5067c67f0911d669be1a990027d0805 Mon Sep 17 00:00:00 2001 From: Anthony Brown <121869075+anthony-nhs@users.noreply.github.com> Date: Mon, 5 Feb 2024 14:34:36 +0000 Subject: [PATCH 2/7] trigger build From 19a1d5ae92aa9cd876bd725f05ae8619b914deb3 Mon Sep 17 00:00:00 2001 From: Anthony Brown <121869075+anthony-nhs@users.noreply.github.com> Date: Mon, 5 Feb 2024 14:37:50 +0000 Subject: [PATCH 3/7] set sources for coverage --- sonar-project.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/sonar-project.properties b/sonar-project.properties index 0ca8e86..2dfb2f8 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -4,3 +4,4 @@ sonar.host.url=https://sonarcloud.io sonar.coverage.exclusions=**/*.test.*,**/jest.config.ts,scripts/* sonar.javascript.lcov.reportPaths=coverage/lcov.info +sonar.sources=. From 89c9544c21cef599267cdc06042b8a072656f10b Mon Sep 17 00:00:00 2001 From: Anthony Brown <121869075+anthony-nhs@users.noreply.github.com> Date: Mon, 5 Feb 2024 14:40:15 +0000 Subject: [PATCH 4/7] verbose sonar --- .github/workflows/quality_checks.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/quality_checks.yml b/.github/workflows/quality_checks.yml index 04ac2d1..7b1c24c 100644 --- a/.github/workflows/quality_checks.yml +++ b/.github/workflows/quality_checks.yml @@ -63,6 +63,9 @@ jobs: - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master + with: + args: > + -Dsonar.verbose=true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} From 3d7f52242b4021c02a5b3d27e7a51e9ef142871c Mon Sep 17 00:00:00 2001 From: Anthony Brown <121869075+anthony-nhs@users.noreply.github.com> Date: Tue, 6 Feb 2024 09:59:42 +0000 Subject: [PATCH 5/7] remove exclusions --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 2dfb2f8..2a87db5 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -2,6 +2,6 @@ sonar.projectKey=NHSDigital_nhs-eps-spine-client sonar.organization=nhsdigital sonar.host.url=https://sonarcloud.io -sonar.coverage.exclusions=**/*.test.*,**/jest.config.ts,scripts/* + sonar.javascript.lcov.reportPaths=coverage/lcov.info sonar.sources=. From 2c961a7960860422c062755df4fdf945e24ce302 Mon Sep 17 00:00:00 2001 From: Anthony Brown <121869075+anthony-nhs@users.noreply.github.com> Date: Tue, 6 Feb 2024 10:25:07 +0000 Subject: [PATCH 6/7] exclude all coverage options --- sonar-project.properties | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 2a87db5..1a182c0 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,7 +1,3 @@ sonar.projectKey=NHSDigital_nhs-eps-spine-client sonar.organization=nhsdigital sonar.host.url=https://sonarcloud.io - - -sonar.javascript.lcov.reportPaths=coverage/lcov.info -sonar.sources=. From c8ad8957d2dcd69be7cf362c51fbc3245ea738cb Mon Sep 17 00:00:00 2001 From: Anthony Brown <121869075+anthony-nhs@users.noreply.github.com> Date: Tue, 6 Feb 2024 10:28:54 +0000 Subject: [PATCH 7/7] force coverage --- sonar-project.properties | 4 ++++ src/live-spine-client.ts | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 1a182c0..2dfb2f8 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,3 +1,7 @@ sonar.projectKey=NHSDigital_nhs-eps-spine-client sonar.organization=nhsdigital sonar.host.url=https://sonarcloud.io + +sonar.coverage.exclusions=**/*.test.*,**/jest.config.ts,scripts/* +sonar.javascript.lcov.reportPaths=coverage/lcov.info +sonar.sources=. diff --git a/src/live-spine-client.ts b/src/live-spine-client.ts index 1cdf4a3..959d568 100644 --- a/src/live-spine-client.ts +++ b/src/live-spine-client.ts @@ -6,7 +6,7 @@ import axios, {Axios, AxiosRequestConfig, AxiosResponse} from "axios" import {APIGatewayProxyEventHeaders} from "aws-lambda" // timeout in ms to wait for response from spine to avoid lambda timeout -const SPINE_TIMEOUT = 45000 +const SPINE_TIMEOUT = 43000 export class LiveSpineClient implements SpineClient { private readonly SPINE_URL_SCHEME = "https" @@ -76,7 +76,7 @@ export class LiveSpineClient implements SpineClient { timeout: SPINE_TIMEOUT }) - // This can be removed when https://nhsd-jira.digital.nhs.uk/browse/AEA-3448 is complete + // This can be removed when https://nhsd-jira.digital.nhs.uk/browse/AEA-3448 is complete change comment if ( response.data["statusCode"] !== undefined && response.data["statusCode"] !== "1" &&