Skip to content

Commit

Permalink
Merge pull request #1583 from UK-Export-Finance/feat/EMS-2485-introdu…
Browse files Browse the repository at this point in the history
…ce-code-cov

feat(EMS-2485): Introduce code coverage
  • Loading branch information
abhi-markan authored Dec 27, 2023
2 parents ba84ca0 + 9da0453 commit 5a6e9d6
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 24 deletions.
37 changes: 18 additions & 19 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
"noConfigSearch": true,
"allowCompoundWords": true,
"words": [
"Abhi",
"2payzd",
"acbs",
"actionsheet",
"alphanum",
"APIM",
"azurecr",
"BBALIBOR",
Expand All @@ -45,20 +45,24 @@
"CILC",
"Clickjacking",
"codacy",
"codecov",
"codeql",
"commitlintrc",
"creds",
"Curncy",
"datafixes",
"Dockerised",
"dtos",
"EASS",
"ecgd",
"EESWE3",
"EHRC",
"enddate",
"ESRA",
"Estore",
"ESTR",
"EWCS",
"exceljs",
"exip",
"EXIP",
"exisitant",
Expand All @@ -67,27 +71,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",
Expand All @@ -100,6 +113,8 @@
"Sanitise",
"snet",
"spectaql",
"sqldb",
"srcs",
"ssword",
"startdate",
"szenius",
Expand All @@ -110,27 +125,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",
Expand Down
40 changes: 36 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 👷
Expand All @@ -129,10 +136,6 @@ jobs:
with:
node-version: ${{ vars.NODE_VERSION }}

- name: Dependencies
working-directory: ./
run: npm run ci:all

- name: API
working-directory: ./
env:
Expand Down Expand Up @@ -162,8 +165,16 @@ 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
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: api-test
verbose: true

# 4. E2E - Insurance
e2e-tests-insurance:
name: E2E Insurance 👷
Expand Down Expand Up @@ -252,6 +263,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 👷
Expand Down Expand Up @@ -308,6 +326,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 👷
Expand Down Expand Up @@ -352,3 +377,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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 5a6e9d6

Please sign in to comment.