From f65a3215caa39b5c9d2a3ae00c29e6e23ee96316 Mon Sep 17 00:00:00 2001 From: Abhi Markan Date: Fri, 22 Dec 2023 15:51:44 +0000 Subject: [PATCH 1/8] feat(EMS-2485): added code coverage to pipeline tests --- .github/workflows/test.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 31e69974d2..3b0af8ec8c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -103,6 +103,13 @@ jobs: MOCK_ACCOUNT_PASSWORD: ${{ secrets.MOCK_ACCOUNT_PASSWORD }} run: npm run test + - name: Coverage + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + flags: unit-test + verbose: true + # 3. API - API test cases api-tests: name: API 👷 @@ -164,6 +171,13 @@ jobs: docker-compose up --build -d npm run test --prefix ./src/api + - name: Coverage + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + flags: api-test + verbose: true + # 4. E2E - Insurance e2e-tests-insurance: name: E2E Insurance 👷 @@ -252,6 +266,13 @@ jobs: working-directory: ./e2e-tests/insurance run: npx cypress run --config video=false,screenshotOnRunFailure=false --browser chrome --project ./ --record false --spec "cypress/e2e/journeys/${{ matrix.spec }}" + - name: Coverage + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + flags: e2e-test + verbose: true + # 5. E2E - Quote e2e-tests-quote: name: E2E Quote 👷 @@ -308,6 +329,13 @@ jobs: working-directory: ./e2e-tests/quote run: npx cypress run --config video=false,screenshotOnRunFailure=false --browser chrome --project ./ --record false --spec "cypress/e2e/journeys/${{ matrix.spec }}" + - name: Coverage + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + flags: e2e-test + verbose: true + # 6. E2E - Switch e2e-tests-switch: name: E2E Switch 👷 @@ -352,3 +380,10 @@ jobs: - name: Execute working-directory: ./e2e-tests/switch-between-services run: npx cypress run --config video=false,screenshotOnRunFailure=false --browser chrome --project ./ --record false --spec "cypress/e2e/journeys/${{ matrix.spec }}" + + - name: Coverage + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + flags: e2e-test + verbose: true From df67287de92a067d2b63d976c357900c7f03d5f9 Mon Sep 17 00:00:00 2001 From: Abhi Markan Date: Fri, 22 Dec 2023 15:57:20 +0000 Subject: [PATCH 2/8] fix(cspell): added codecov to cspell --- .cspell.json | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.cspell.json b/.cspell.json index a97d0f9df1..b065f7b87e 100644 --- a/.cspell.json +++ b/.cspell.json @@ -31,10 +31,11 @@ "noConfigSearch": true, "allowCompoundWords": true, "words": [ - "Abhi", "2payzd", + "Abhi", "acbs", "actionsheet", + "alphanum", "APIM", "azurecr", "BBALIBOR", @@ -45,6 +46,7 @@ "CILC", "Clickjacking", "codacy", + "codecov", "codeql", "commitlintrc", "creds", @@ -52,13 +54,16 @@ "datafixes", "Dockerised", "dtos", + "EASS", "ecgd", "EESWE3", + "EHRC", "enddate", "ESRA", "Estore", "ESTR", "EWCS", + "exceljs", "exip", "EXIP", "exisitant", @@ -67,27 +72,36 @@ "firstname", "globaldb", "govuk", + "GUIDLINES", "healthcheck", + "hrefs", "HSTS", "huskyrc", "Informatica", "INITDB", "Initialisation", "Initialised", + "inmemory", "isready", "jspf", "limitter", "lintstagedrc", "localise", "mdm", + "ministryofjustice", "MRUI", "Mulesoft", + "nbsp", "nestjs", + "noarchive", + "nofollow", + "noimageindex", "noopen", "nosniff", "npmrc", "numbergenerator", "NVARCHAR", + "octocat", "organisation", "outro", "OUTRO", @@ -100,6 +114,8 @@ "Sanitise", "snet", "spectaql", + "sqldb", + "srcs", "ssword", "startdate", "szenius", @@ -110,27 +126,11 @@ "UKEF", "uksouth", "Unauthorised", + "UNSUPPORTRED", "Useds", "venv", "VNET", - "XLSX", - "octocat", - "ministryofjustice", - "outro", - "GUIDLINES", - "nofollow", - "noarchive", - "noimageindex", - "exceljs", - "nbsp", - "srcs", - "inmemory", - "EHRC", - "EASS", - "UNSUPPORTRED", - "alphanum", - "hrefs", - "sqldb" + "XLSX" ], "dictionaries": [ "en-gb", From 44d18f8832d90b46a833a67c4a152c0095f99433 Mon Sep 17 00:00:00 2001 From: Abhi Markan Date: Fri, 22 Dec 2023 17:44:22 +0000 Subject: [PATCH 3/8] fix(EMS-2485): spelling fix --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af6d074a92..d7a432f987 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ ### Bug Fixes * **EMS-2463:** ci:all execution prior to test run ([10c0a9a](https://github.com/UK-Export-Finance/exip/commit/10c0a9aaad644f3b1153a3ed433f02ea7233d2d9)) -* **gha:** ensure all packages are intalled with --legacy-peer-deps prior to test execution ([c227b10](https://github.com/UK-Export-Finance/exip/commit/c227b104ee8fef754ed9ffae2e2c1d0a10b76ddf)) +* **gha:** ensure all packages are installed with --legacy-peer-deps prior to test execution ([c227b10](https://github.com/UK-Export-Finance/exip/commit/c227b104ee8fef754ed9ffae2e2c1d0a10b76ddf)) ## [2.3.7](https://github.com/UK-Export-Finance/exip/compare/v2.3.6...v2.3.7) (2023-12-20) From 9baab7424645074cb87d45a17e548170887acc49 Mon Sep 17 00:00:00 2001 From: Abhi Markan Date: Fri, 22 Dec 2023 21:11:52 +0000 Subject: [PATCH 4/8] fix(EMS-2485): fixed npm ci command --- .cspell.json | 1 - .github/workflows/test.yml | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.cspell.json b/.cspell.json index b065f7b87e..27ae352f0b 100644 --- a/.cspell.json +++ b/.cspell.json @@ -32,7 +32,6 @@ "allowCompoundWords": true, "words": [ "2payzd", - "Abhi", "acbs", "actionsheet", "alphanum", diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3b0af8ec8c..79187842cd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -136,10 +136,6 @@ jobs: with: node-version: ${{ vars.NODE_VERSION }} - - name: Dependencies - working-directory: ./ - run: npm run ci:all - - name: API working-directory: ./ env: @@ -169,6 +165,7 @@ jobs: JWT_SIGNING_KEY: ${{ secrets.JWT_SIGNING_KEY }} run: | docker-compose up --build -d + npm run ci --legacy-peer-deps npm run test --prefix ./src/api - name: Coverage From 0976291e148cd8ab5ed7929b1f0fe8666336db43 Mon Sep 17 00:00:00 2001 From: Abhi Markan Date: Fri, 22 Dec 2023 21:13:12 +0000 Subject: [PATCH 5/8] fix(EMS-2485): fixed npm ci command --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 79187842cd..bd14406d72 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -165,7 +165,7 @@ jobs: JWT_SIGNING_KEY: ${{ secrets.JWT_SIGNING_KEY }} run: | docker-compose up --build -d - npm run ci --legacy-peer-deps + npm ci --legacy-peer-deps npm run test --prefix ./src/api - name: Coverage From f2e120f7bc4f72ac781597fbb4d85e32ceadd71a Mon Sep 17 00:00:00 2001 From: Abhi Markan Date: Fri, 22 Dec 2023 21:15:28 +0000 Subject: [PATCH 6/8] fix(EMS-2485): fixed npm ci command --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bd14406d72..f87f96b476 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -165,7 +165,7 @@ jobs: JWT_SIGNING_KEY: ${{ secrets.JWT_SIGNING_KEY }} run: | docker-compose up --build -d - npm ci --legacy-peer-deps + npm ci --legacy-peer-deps --prefix ./src/api npm run test --prefix ./src/api - name: Coverage From ab1247c4bfb58830aa43c1dd803c43cad37dc6c5 Mon Sep 17 00:00:00 2001 From: Abhi Markan Date: Fri, 22 Dec 2023 21:29:11 +0000 Subject: [PATCH 7/8] fix(EMS-2485): fixed npm ci command --- .github/workflows/test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f87f96b476..72953b4ca3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -136,6 +136,10 @@ jobs: with: node-version: ${{ vars.NODE_VERSION }} + - name: Dependencies + working-directory: ./src/api + run: npm ci --legacy-peer-deps + - name: API working-directory: ./ env: @@ -165,7 +169,6 @@ jobs: JWT_SIGNING_KEY: ${{ secrets.JWT_SIGNING_KEY }} run: | docker-compose up --build -d - npm ci --legacy-peer-deps --prefix ./src/api npm run test --prefix ./src/api - name: Coverage From 9da04532fc2ed9ad6bdcbc71feda2baab73400f1 Mon Sep 17 00:00:00 2001 From: Abhi Markan Date: Fri, 22 Dec 2023 21:37:05 +0000 Subject: [PATCH 8/8] fix(EMS-2485): fixed npm ci command --- .github/workflows/test.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 72953b4ca3..8e420c271a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -136,10 +136,6 @@ jobs: with: node-version: ${{ vars.NODE_VERSION }} - - name: Dependencies - working-directory: ./src/api - run: npm ci --legacy-peer-deps - - name: API working-directory: ./ env: @@ -169,6 +165,7 @@ jobs: JWT_SIGNING_KEY: ${{ secrets.JWT_SIGNING_KEY }} run: | docker-compose up --build -d + npm run ci:all npm run test --prefix ./src/api - name: Coverage