Skip to content

Commit

Permalink
Merge pull request #14 from atlp-rwanda/feat-user-login-187419055
Browse files Browse the repository at this point in the history
#187419055 Added tests for user-login
  • Loading branch information
leandreAlly authored Apr 22, 2024
2 parents aeac303 + e8bc99e commit cef80c8
Show file tree
Hide file tree
Showing 13 changed files with 1,067 additions and 1,129 deletions.
48 changes: 33 additions & 15 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
# This workflow will install node dependencies, run tests and report coverage
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: build

on:
push:
branches:
- feat-test-CI-implementation-187419042
- "*"
- develop

- "*"
pull_request:
branches:
- develop
- "*"

jobs:
test:
Expand All @@ -22,6 +18,11 @@ jobs:
DB_TEST_URL: ${{ secrets.DB_TEST_URL }}
DEV_MODE: ${{ secrets.DEV_MODE }}
DB_HOSTED_MODE: ${{ secrets.DB_HOSTED_MODE }}
ACCESS_TOKEN_SECRET: ${{ secrets.ACCESS_TOKEN_SECRET }}
SESSION_SECRET: ${{ secrets.SESSION_SECRET }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

strategy:
matrix:
Expand All @@ -37,15 +38,32 @@ jobs:
- name: Install dependencies
run: npm install

- name: Run tests
run: npm run test

- name: Run tests and build test coverage
run: npm run test:ci

- name: Test & publish code climate coverage
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: npm run test:ci
debug: true
coverageLocations: |
${{github.workspace}}/*.lcov:lcov
- name: Setup Code Climate test-reporter
run: |
# Download test reporter as a static binary
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Run tests
run: npm run test

- name: Store coverage report
if: always()
run: mkdir -p coverage


- name: Send coverage report to Code Climate
if: always()
run: ./cc-test-reporter after-build -t lcov -p coverage

- name: coveralls
run: npx coveralls < coverage/lcov.info


Loading

0 comments on commit cef80c8

Please sign in to comment.