Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added work flow #105

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/test_client_advisor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Unit Tests - Client Advisor

on:
push:
branches: main
# Trigger on changes in these specific paths
paths:
- 'ClientAdvisor/**'
pull_request:
branches: main
types:
- opened
- ready_for_review
- reopened
- synchronize
paths:
- 'ClientAdvisor/**'

jobs:
test_client_advisor:

name: Client Advisor Tests
runs-on: ubuntu-latest
# The if condition ensures that this job only runs if changes are in the ClientAdvisor folder

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Backend Dependencies
run: |
cd ClientAdvisor/App
python -m pip install -r requirements.txt
python -m pip install coverage pytest-cov
- name: Run Backend Tests with Coverage
run: |
cd ClientAdvisor/App
python -m pytest -vv --cov=. --cov-report=xml --cov-report=html --cov-report=term-missing --cov-fail-under=80 --junitxml=coverage-junit.xml
- uses: actions/upload-artifact@v4
with:
name: client-advisor-coverage
path: |
ClientAdvisor/App/coverage.xml
ClientAdvisor/App/coverage-junit.xml
ClientAdvisor/App/htmlcov/
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install Frontend Dependencies
run: |
cd ClientAdvisor/App/frontend
npm install
- name: Run Frontend Tests with Coverage
run: |
cd ClientAdvisor/App/frontend
npm run test -- --coverage
- uses: actions/upload-artifact@v4
with:
name: client-advisor-frontend-coverage
path: |
ClientAdvisor/App/frontend/coverage/
ClientAdvisor/App/frontend/coverage/lcov-report/
2 changes: 1 addition & 1 deletion ClientAdvisor/App/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

def test_format_as_ndjson():
obj = {"message": "I ❤️ 🐍 \n and escaped newlines"}
assert format_as_ndjson(obj) == '{"message": "I ❤️ 🐍 \\n and escaped newlines"}\n'
assert format_as_ndjson(obj) == '{"message": "I ❤️ 🐍 \\n and escaped new lines"}\n'
Loading