diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 5e08ab1..6fc4887 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -33,7 +33,7 @@ jobs: run: python -m pip install --upgrade pip setuptools wheel - name: Install poetry - run: pip install "poetry<2.0.0" + run: 'pip install --only-binary :all: "poetry==2.4.1"' - name: Cache poetry packages uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 diff --git a/azure/azure-pr-pipeline.yml b/azure/azure-pr-pipeline.yml index a269201..daeb2a0 100644 --- a/azure/azure-pr-pipeline.yml +++ b/azure/azure-pr-pipeline.yml @@ -43,9 +43,3 @@ extends: - environment: internal-dev post_deploy: - template: ./templates/run-integration-tests.yml - parameters: - working_directory: $(Pipeline.Workspace)/s - test_folder_path: $(Pipeline.Workspace)/s/${{ variables.service_name }}/$(SERVICE_ARTIFACT_NAME)/tests - target_url: https://$(APIGEE_ENVIRONMENT).api.service.nhs.uk/$(SERVICE_BASE_PATH)/ - token_url: https://$(APIGEE_ENVIRONMENT).api.service.nhs.uk/oauth2/token - private_key_file_path: $(Pipeline.Workspace)/secrets/$(JWT_TESTING_PRIVATE_KEY) diff --git a/azure/project.yml b/azure/project.yml index 5c50f81..fb24850 100644 --- a/azure/project.yml +++ b/azure/project.yml @@ -1,4 +1,9 @@ variables: service_name: nhs-app short_service_name: nhsa - service_base_path: nhs-app \ No newline at end of file + service_base_path: nhs-app + WorkingDir: $(Pipeline.Workspace)/s + TargetUrl: https://$(APIGEE_ENVIRONMENT).api.service.nhs.uk/$(SERVICE_BASE_PATH)/ + TokenUrl: https://$(APIGEE_ENVIRONMENT).api.service.nhs.uk/oauth2/token + TestFolderPath: $(Pipeline.Workspace)/s/${{ variables.service_name }}/$(SERVICE_ARTIFACT_NAME)/tests + PrivateKeyFilePath: $(Pipeline.Workspace)/secrets/$(JWT_TESTING_PRIVATE_KEY) diff --git a/azure/templates/run-integration-tests.yml b/azure/templates/run-integration-tests.yml index 9dec807..0fc28cd 100644 --- a/azure/templates/run-integration-tests.yml +++ b/azure/templates/run-integration-tests.yml @@ -1,15 +1,3 @@ -parameters: - - name: working_directory - type: string - - name: target_url - type: string - - name: token_url - type: string - - name: test_folder_path - type: string - - name: private_key_file_path - type: string - steps: - task: UseDotNet@2 displayName: 'Use .NET Core sdk' @@ -22,9 +10,9 @@ steps: displayName: dotnet restore inputs: command: restore - projects: '${{ parameters.test_folder_path }}/Nhs.App.Api.Integration.Tests/Nhs.App.Api.Integration.Tests/Nhs.App.Api.Integration.Tests.csproj' + projects: '$(TestFolderPath)/Nhs.App.Api.Integration.Tests/Nhs.App.Api.Integration.Tests/Nhs.App.Api.Integration.Tests.csproj' feedsToUse: 'config' - nugetConfigPath: '${{ parameters.test_folder_path }}/Nhs.App.Api.Integration.Tests/Nuget.config' + nugetConfigPath: '$(TestFolderPath)/Nhs.App.Api.Integration.Tests/Nuget.config' includeNuGetOrg: true - task: DotNetCoreCLI@2 @@ -32,7 +20,7 @@ steps: inputs: command: 'publish' version: '5.0.x' - projects: '${{ parameters.test_folder_path }}/Nhs.App.Api.Integration.Tests/Nhs.App.Api.Integration.Tests/Nhs.App.Api.Integration.Tests.csproj' + projects: '$(TestFolderPath)/Nhs.App.Api.Integration.Tests/Nhs.App.Api.Integration.Tests/Nhs.App.Api.Integration.Tests.csproj' publishWebProjects: false zipAfterPublish: false arguments: "--configuration Release -o Publish" @@ -43,21 +31,21 @@ steps: command: 'custom' custom: vstest arguments: > - ${{ parameters.working_directory }}/Publish/Nhs.App.Api.Integration.Tests/Nhs.App.Api.Integration.Tests.dll - --logger:"trx;LogFileName=${{ parameters.working_directory }}/IntegrationTests/Tests.trx" - --settings:${{ parameters.working_directory }}/Publish/Nhs.App.Api.Integration.Tests/test.runsettings + $(WorkingDir)/Publish/Nhs.App.Api.Integration.Tests/Nhs.App.Api.Integration.Tests.dll + --logger:"trx;LogFileName=$(WorkingDir)/IntegrationTests/Tests.trx" + --settings:$(WorkingDir)/Publish/Nhs.App.Api.Integration.Tests/test.runsettings -- TestRunParameters.Parameter(name="\""ApigeeApiKey"\"",value="\""$(CLIENT_ID)"\"") - -- TestRunParameters.Parameter(name="\""ApplicationUrl"\"",value="\""${{ parameters.target_url }}"\"") - -- TestRunParameters.Parameter(name="\""TokenEndpoint"\"",value="\""${{ parameters.token_url }}"\"") + -- TestRunParameters.Parameter(name="\""ApplicationUrl"\"",value="\""$(TargetUrl)"\"") + -- TestRunParameters.Parameter(name="\""TokenEndpoint"\"",value="\""$(TokenUrl)"\"") -- TestRunParameters.Parameter(name="\""IssuerKey"\"",value="\""$(JWT_TESTING_API_KEY)"\"") - -- TestRunParameters.Parameter(name="\""PrivateKeyFilePath"\"",value="\""${{ parameters.private_key_file_path }}"\"") + -- TestRunParameters.Parameter(name="\""PrivateKeyFilePath"\"",value="\""$(PrivateKeyFilePath)"\"") -- TestRunParameters.Parameter(name="\""KidValue"\"",value="\"test-1\"") - task: PublishTestResults@2 - displayName: 'Publish Test Results ${{ parameters.working_directory }}/IntegrationTests/Tests.trx' + displayName: 'Publish Test Results $(WorkingDir)/IntegrationTests/Tests.trx' inputs: testResultsFormat: VSTest - testResultsFiles: '${{ parameters.working_directory }}/IntegrationTests/Tests.trx' + testResultsFiles: '$(WorkingDir)/IntegrationTests/Tests.trx' mergeTestResults: true testRunTitle: 'Integration Tests' continueOnError: true diff --git a/sandbox/Dockerfile b/sandbox/Dockerfile index 391cfec..c1dba6b 100644 --- a/sandbox/Dockerfile +++ b/sandbox/Dockerfile @@ -1,10 +1,10 @@ -FROM node:12 +FROM node:24 COPY . /sandbox WORKDIR /sandbox -RUN npm install +RUN npm install --ignore-scripts EXPOSE 9000 diff --git a/sandbox/package-lock.json b/sandbox/package-lock.json index 72bd63f..22c3c52 100644 --- a/sandbox/package-lock.json +++ b/sandbox/package-lock.json @@ -27,9 +27,9 @@ } }, "node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz", - "integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz", + "integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==", "funding": [ { "type": "github", @@ -91,9 +91,9 @@ } }, "node_modules/@oas-tools/commons/node_modules/js-yaml": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz", - "integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz", + "integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==", "funding": [ { "type": "github", @@ -156,9 +156,9 @@ } }, "node_modules/ajv": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.18.0.tgz", - "integrity": "sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==", + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3", @@ -687,9 +687,9 @@ "license": "MIT" }, "node_modules/fast-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.2.tgz", - "integrity": "sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.3.tgz", + "integrity": "sha512-i70LwGWUduXqzicKXWshooq+sWL1K3WUU5rKZNG/0i3a1OSoX3HqhH5WbWwTmqWfor4urUakGPiRQcleRZTwOg==", "funding": [ { "type": "github", @@ -872,9 +872,9 @@ } }, "node_modules/iconv-lite": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz", - "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==", + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.3.tgz", + "integrity": "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==", "license": "MIT", "peer": true, "dependencies": { @@ -1111,9 +1111,9 @@ } }, "node_modules/oas-tools/node_modules/js-yaml": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz", - "integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz", + "integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==", "funding": [ { "type": "github", @@ -1211,13 +1211,14 @@ } }, "node_modules/qs": { - "version": "6.15.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.2.tgz", - "integrity": "sha512-Rzq0KEyX/w/tEybncDgdkZrJgVUsUMk3xjh3t5bv3S1HTAtg+uOYt72+ZfwiQwKdysThkTBdL/rTi6HDmX9Ddw==", + "version": "6.15.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.3.tgz", + "integrity": "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A==", "license": "BSD-3-Clause", "peer": true, "dependencies": { - "side-channel": "^1.1.0" + "es-define-property": "^1.0.1", + "side-channel": "^1.1.1" }, "engines": { "node": ">=0.6" @@ -1227,13 +1228,17 @@ } }, "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.3.0.tgz", + "integrity": "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw==", "license": "MIT", "peer": true, "engines": { "node": ">= 0.6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/raw-body": { @@ -1603,9 +1608,9 @@ } }, "node_modules/swagger-ui-dist": { - "version": "5.30.3", - "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.30.3.tgz", - "integrity": "sha512-giQl7/ToPxCqnUAx2wpnSnDNGZtGzw1LyUw6ZitIpTmdrvpxKFY/94v1hihm0zYNpgp1/VY0jTDk//R0BBgnRQ==", + "version": "5.32.8", + "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.32.8.tgz", + "integrity": "sha512-dgMdWXIgnI4zX4OPhKEdWnlDODbgm8W3AX0Ivn/BBqcUh6xZsBxhZMnvk6DJyRz1BTrj8dPxtarmEGgkz30oyA==", "license": "Apache-2.0", "dependencies": { "@scarf/scarf": "=1.4.0" @@ -1709,9 +1714,9 @@ } }, "node_modules/validator": { - "version": "13.15.23", - "resolved": "https://registry.npmjs.org/validator/-/validator-13.15.23.tgz", - "integrity": "sha512-4yoz1kEWqUjzi5zsPbAS/903QXSYp0UOtHsPpp7p9rHAw/W+dkInskAE386Fat3oKRROwO98d9ZB0G4cObgUyw==", + "version": "13.15.35", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.15.35.tgz", + "integrity": "sha512-TQ5pAGhd5whStmqWvYF4OjQROlmv9SMFVt37qoCBdqRffuuklWYQlCNnEs2ZaIBD1kZRNnikiZOS1eqgkar0iw==", "license": "MIT", "engines": { "node": ">= 0.10" @@ -1734,9 +1739,9 @@ "license": "MIT" }, "node_modules/winston": { - "version": "3.18.3", - "resolved": "https://registry.npmjs.org/winston/-/winston-3.18.3.tgz", - "integrity": "sha512-NoBZauFNNWENgsnC9YpgyYwOVrl2m58PpQ8lNHjV3kosGs7KJ7Npk9pCUE+WJlawVSe8mykWDKWFSVfs3QO9ww==", + "version": "3.19.0", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.19.0.tgz", + "integrity": "sha512-LZNJgPzfKR+/J3cHkxcpHKpKKvGfDZVPS4hfJCc4cCG0CgYzvlD6yE/S3CIL/Yt91ak327YCpiF/0MyeZHEHKA==", "license": "MIT", "dependencies": { "@colors/colors": "^1.6.0",