2121 - hotfix
2222
2323jobs :
24- # frontend_tests:
25- # runs-on: ubuntu-latest
26-
27- # steps:
28- # - name: Checkout code
29- # uses: actions/checkout@v3
30-
31- # - name: Set up Node.js
32- # uses: actions/setup-node@v3
33- # with:
34- # node-version: '20'
35-
36- # - name: Check if Frontend Test Files Exist
37- # id: check_frontend_tests
38- # run: |
39- # if [ -z "$(find src/tests/frontend -type f -name '*.test.js' -o -name '*.test.ts' -o -name '*.test.tsx')" ]; then
40- # echo "No frontend test files found, skipping frontend tests."
41- # echo "skip_frontend_tests=true" >> $GITHUB_ENV
42- # else
43- # echo "Frontend test files found, running tests."
44- # echo "skip_frontend_tests=false" >> $GITHUB_ENV
45- # fi
46-
47- # - name: Install Frontend Dependencies
48- # if: env.skip_frontend_tests == 'false'
49- # run: |
50- # cd src/frontend
51- # npm install
52-
53- # - name: Run Frontend Tests with Coverage
54- # if: env.skip_frontend_tests == 'false'
55- # run: |
56- # cd src/tests/frontend
57- # npm run test -- --coverage
58-
59- # - name: Skip Frontend Tests
60- # if: env.skip_frontend_tests == 'true'
61- # run: |
62- # echo "Skipping frontend tests because no test files were found."
63-
6424 backend_tests :
6525 runs-on : ubuntu-latest
66-
67-
6826 steps :
6927 - name : Checkout code
7028 uses : actions/checkout@v3
@@ -74,36 +32,22 @@ jobs:
7432 with :
7533 python-version : ' 3.11'
7634
77- - name : Install Backend Dependencies
35+ - name : Install Dependencies
7836 run : |
7937 python -m pip install --upgrade pip
8038 pip install -r src/backend/requirements.txt
8139 pip install -r src/frontend/requirements.txt
82- pip install pytest-cov
83- pip install pytest-asyncio
40+ pip install pytest-cov pytest-asyncio
41+
8442 - name : Set PYTHONPATH
8543 run : echo "PYTHONPATH=$PWD/src/backend" >> $GITHUB_ENV
8644
87- - name : Check if Backend Test Files Exist
88- id : check_backend_tests
89- run : |
90- if [ -z "$(find src/tests/backend -type f -name '*_test.py')" ]; then
91- echo "No backend test files found, skipping backend tests."
92- echo "skip_backend_tests=true" >> $GITHUB_ENV
93- else
94- echo "Backend test files found, running tests."
95- echo "skip_backend_tests=false" >> $GITHUB_ENV
96- fi
97-
98- - name : Run Backend Tests with Coverage (Using .coveragerc)
99- if : env.skip_backend_tests == 'false'
45+ - name : Run Backend Tests with Coverage
10046 run : |
10147 cd src
102- pytest --cov=. --cov-report=term-missing --cov-report=xml --cov-config=.coveragerc
103-
104-
105-
106- - name : Skip Backend Tests
107- if : env.skip_backend_tests == 'true'
108- run : |
109- echo "Skipping backend tests because no test files were found."
48+ # only measure coverage for src/backend, omit tests via .coveragerc
49+ pytest \
50+ --cov=backend \
51+ --cov-report=term-missing \
52+ --cov-report=xml \
53+ --cov-config=../.coveragerc
0 commit comments