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

step4: add smiles #8

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
8 changes: 5 additions & 3 deletions .github/workflows/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ jobs:
python-version: '3.10'
- name: Install requirements
run: pip install -r api/requirements.txt
- name: Run tests and collect coverage
run: pytest --cov=api.calculator --cov-report=xml
- name: Run tests and collect coverage for calculator
run: pytest --cov=api.calculator --cov-report=xml:calculator-coverage.xml
- name: Run tests and collect coverage for smiles
run: pytest --cov=api.smiles --cov-report=xml:smiles-coverage.xml
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v4.2.0
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Empty file added api/smiles/__init__.py
Empty file.
6 changes: 6 additions & 0 deletions api/smiles/smiles.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class Smiles:
def smile(self):
return ":)"

def frown(self):
return ":("

Check warning on line 6 in api/smiles/smiles.py

View check run for this annotation

Codecov / codecov/patch

api/smiles/smiles.py#L6

Added line #L6 was not covered by tests
4 changes: 4 additions & 0 deletions api/smiles/test_smiles.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .smiles import Smiles

def test_smile():
assert Smiles().smile() == ":)"
16 changes: 10 additions & 6 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
coverage:
status:
project:
default:
target: 100%
threshold: 1%
component_management:
individual_components:
- component_id: api-calculator # this is an identifier that should not be changed
name: calculator # this is a display name, and can be changed freely
paths:
- api/calculator/
- component_id: api-smiles # this is an identifier that should not be changed
name: smiles # this is a display name, and can be changed freely
paths:
- api/smiles/
Loading