Skip to content

Commit

Permalink
Merge pull request #36 from NCSU-SE-2024/codecovwf
Browse files Browse the repository at this point in the history
Added CodeCov workflow
  • Loading branch information
gsheth21 authored Oct 31, 2024
2 parents c039fa6 + c3c0b1d commit bcc38e7
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Run tests and upload coverage

on:
push

jobs:
test:
name: Run tests and collect coverage
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4

- name: Install dependencies
run: pip install pytest pytest-cov

- name: Run tests
run: python -m unittest tests/test_app.py

- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
verbose: true
env:
CODECOV_TOKEN: 8bc01886-e417-46b9-aa8d-cda6cd0ff54a
8 changes: 4 additions & 4 deletions app/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def signup():


@app.route('/view/<id>')
def view():
def view(id):
"""An API to help view review information"""
intialize_db()
job_review = JOBS_DB.find_one({"_id": id})
Expand All @@ -405,7 +405,7 @@ def view():


@app.route('/upvote/<id>')
def upvote():
def upvote(id):
"""An API to update upvote information"""
intialize_db()
job_review = JOBS_DB.find_one({"_id": id})
Expand All @@ -416,7 +416,7 @@ def upvote():


@app.route('/downvote/<id>')
def downvote():
def downvote(id):
"""An API to update upvote information"""
intialize_db()
job_review = JOBS_DB.find_one({"_id": id})
Expand All @@ -427,7 +427,7 @@ def downvote():


@app.route('/delete/<id>')
def delete():
def delete(id):
"""An API to help delete a review"""
intialize_db()
user = USERS_DB.find_one({"username": session['username']})
Expand Down

0 comments on commit bcc38e7

Please sign in to comment.