From 63946feed9c428562fc748f23147a4eee616f574 Mon Sep 17 00:00:00 2001 From: David Fulmer Date: Mon, 9 Jun 2025 19:22:31 +0000 Subject: [PATCH 01/16] step0: add python dependencies --- api/requirements.txt | 132 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 api/requirements.txt diff --git a/api/requirements.txt b/api/requirements.txt new file mode 100644 index 000000000..489845288 --- /dev/null +++ b/api/requirements.txt @@ -0,0 +1,132 @@ +anyio==4.9.0 +argon2-cffi==23.1.0 +argon2-cffi-bindings==21.2.0 +arrow==1.3.0 +asttokens==3.0.0 +async-lru==2.0.5 +attrs==25.3.0 +babel==2.17.0 +beautifulsoup4==4.13.3 +bleach==6.2.0 +blinker==1.9.0 +certifi==2025.1.31 +cffi==1.17.1 +charset-normalizer==3.4.1 +click==8.2.1 +colorama==0.4.6 +comm==0.2.2 +contourpy==1.3.1 +coverage==7.8.2 +cycler==0.12.1 +debugpy==1.8.13 +decorator==5.2.1 +defusedxml==0.7.1 +executing==2.2.0 +fastjsonschema==2.21.1 +filelock==3.13.1 +Flask==3.1.1 +fonttools==4.56.0 +fqdn==1.5.1 +fsspec==2024.6.1 +gitdb==4.0.12 +GitPython==3.1.44 +h11==0.14.0 +httpcore==1.0.7 +httpx==0.28.1 +idna==3.10 +iniconfig==2.1.0 +ipykernel==6.29.5 +ipython==9.0.2 +ipython_pygments_lexers==1.1.1 +isoduration==20.11.0 +itsdangerous==2.2.0 +jedi==0.19.2 +Jinja2==3.1.6 +joblib==1.4.2 +json5==0.10.0 +jsonpointer==3.0.0 +jsonschema==4.23.0 +jsonschema-specifications==2024.10.1 +jupyter-events==0.12.0 +jupyter-lsp==2.2.5 +jupyter-server-mathjax==0.2.6 +jupyter_client==8.6.3 +jupyter_core==5.7.2 +jupyter_server==2.15.0 +jupyter_server_terminals==0.5.3 +jupyterlab==4.3.6 +jupyterlab_git==0.51.0 +jupyterlab_pygments==0.3.0 +jupyterlab_server==2.27.3 +kiwisolver==1.4.8 +MarkupSafe==3.0.2 +matplotlib==3.10.1 +matplotlib-inline==0.1.7 +mistune==3.1.2 +mpmath==1.3.0 +narwhals==1.31.0 +nbclient==0.10.2 +nbconvert==7.16.6 +nbdime==4.0.2 +nbformat==5.10.4 +nest-asyncio==1.6.0 +networkx==3.3 +notebook_shim==0.2.4 +numpy==2.2.4 +overrides==7.7.0 +packaging==24.2 +pandas==2.2.3 +pandocfilters==1.5.1 +parso==0.8.4 +pexpect==4.9.0 +pillow==11.1.0 +platformdirs==4.3.6 +plotly==6.0.1 +pluggy==1.6.0 +prometheus_client==0.21.1 +prompt_toolkit==3.0.50 +psutil==7.0.0 +ptyprocess==0.7.0 +pure_eval==0.2.3 +pycparser==2.22 +Pygments==2.19.1 +pyparsing==3.2.1 +pytest==8.4.0 +pytest-cov==6.1.1 +python-dateutil==2.9.0.post0 +python-json-logger==3.3.0 +pytz==2025.1 +PyYAML==6.0.2 +pyzmq==26.3.0 +referencing==0.36.2 +requests==2.32.3 +rfc3339-validator==0.1.4 +rfc3986-validator==0.1.1 +rpds-py==0.23.1 +scikit-learn==1.6.1 +scipy==1.15.2 +seaborn==0.13.2 +Send2Trash==1.8.3 +setuptools==76.0.0 +six==1.17.0 +smmap==5.0.2 +sniffio==1.3.1 +soupsieve==2.6 +stack-data==0.6.3 +sympy==1.13.1 +terminado==0.18.1 +threadpoolctl==3.6.0 +tinycss2==1.4.0 +torch==2.6.0+cpu +tornado==6.4.2 +traitlets==5.14.3 +types-python-dateutil==2.9.0.20241206 +typing_extensions==4.12.2 +tzdata==2025.1 +uri-template==1.3.0 +urllib3==2.3.0 +wcwidth==0.2.13 +webcolors==24.11.1 +webencodings==0.5.1 +websocket-client==1.8.0 +Werkzeug==3.1.3 From c6491427e4586aa5d3a4eda9c51b509993014fd2 Mon Sep 17 00:00:00 2001 From: David Fulmer Date: Mon, 9 Jun 2025 19:36:57 +0000 Subject: [PATCH 02/16] step1: add calculator backend and tests --- api/app.py | 35 +++++++++++++++++++++++++++++++ api/calculator/__init__.py | 0 api/calculator/calculator.py | 14 +++++++++++++ api/calculator/test_calculator.py | 30 ++++++++++++++++++++++++++ 4 files changed, 79 insertions(+) create mode 100644 api/app.py create mode 100644 api/calculator/__init__.py create mode 100644 api/calculator/calculator.py create mode 100644 api/calculator/test_calculator.py diff --git a/api/app.py b/api/app.py new file mode 100644 index 000000000..d91792d1b --- /dev/null +++ b/api/app.py @@ -0,0 +1,35 @@ +from flask import ( + Flask, + request, +) + +from calculator.calculator import Calculator + +app = Flask(__name__) + +@app.route('/api/add', methods=['POST']) +def add(): + return operation('add', 2) + +@app.route('/api/subtract', methods=['POST']) +def subtract(): + return operation('subtract', 2) + +@app.route('/api/multiply', methods=['POST']) +def multiply(): + return operation('multiply', 2) + +@app.route('/api/divide', methods=['POST']) +def divide(): + return operation('divide', 2) + +def operation(method, num_factors): + factors = [] + if num_factors == 2: + factors.append(float(request.json.get('x'))) + factors.append(float(request.json.get('y'))) + + return str(getattr(Calculator, method)(*factors)) + + +app.run(host='0.0.0.0', port=8080) \ No newline at end of file diff --git a/api/calculator/__init__.py b/api/calculator/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/api/calculator/calculator.py b/api/calculator/calculator.py new file mode 100644 index 000000000..eac4e7acb --- /dev/null +++ b/api/calculator/calculator.py @@ -0,0 +1,14 @@ +class Calculator: + def add(x, y): + return x + y + + def subtract(x, y): + return x - y + + def multiply(x, y): + return x * y + + def divide(x, y): + if y == 0: + return 'Cannot divide by 0' + return x * 1.0 / y \ No newline at end of file diff --git a/api/calculator/test_calculator.py b/api/calculator/test_calculator.py new file mode 100644 index 000000000..69fa778f1 --- /dev/null +++ b/api/calculator/test_calculator.py @@ -0,0 +1,30 @@ +from .calculator import Calculator + + +def test_add(): + assert Calculator.add(1, 2) == 3.0 + assert Calculator.add(1.0, 2.0) == 3.0 + assert Calculator.add(0, 2.0) == 2.0 + assert Calculator.add(2.0, 0) == 2.0 + assert Calculator.add(-4, 2.0) == -2.0 + +def test_subtract(): + assert Calculator.subtract(1, 2) == -1.0 + assert Calculator.subtract(2, 1) == 1.0 + assert Calculator.subtract(1.0, 2.0) == -1.0 + assert Calculator.subtract(0, 2.0) == -2.0 + assert Calculator.subtract(2.0, 0.0) == 2.0 + assert Calculator.subtract(-4, 2.0) == -6.0 + +def test_multiply(): + assert Calculator.multiply(1, 2) == 2.0 + assert Calculator.multiply(1.0, 2.0) == 2.0 + assert Calculator.multiply(0, 2.0) == 0.0 + assert Calculator.multiply(2.0, 0.0) == 0.0 + assert Calculator.multiply(-4, 2.0) == -8.0 + +def test_divide(): + assert Calculator.divide(1, 2) == 0.5 + assert Calculator.divide(1.0, 2.0) == 0.5 + assert Calculator.divide(0, 2.0) == 0 + assert Calculator.divide(-4, 2.0) == -2.0 \ No newline at end of file From 26d4cd52bd3055a056e4f89ac663bfcb60df5700 Mon Sep 17 00:00:00 2001 From: David Fulmer Date: Wed, 11 Jun 2025 13:46:08 +0000 Subject: [PATCH 03/16] step2: upload coverage reports to Codecov --- .github/workflows/api.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/api.yml diff --git a/.github/workflows/api.yml b/.github/workflows/api.yml new file mode 100644 index 000000000..9fd271126 --- /dev/null +++ b/.github/workflows/api.yml @@ -0,0 +1,21 @@ +name: API workflow + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + name: Test python API + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v2 + with: + 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: Upload coverage reports to Codecov with GitHub Action + uses: codecov/codecov-action@v5 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file From 19aff3948cbf47cfb0d83761f232c84e54949f7e Mon Sep 17 00:00:00 2001 From: David Fulmer Date: Wed, 11 Jun 2025 14:03:55 +0000 Subject: [PATCH 04/16] step2: upload coverage reports to Codecov Try 2 --- .gitignore | 1 + api/requirements.txt | 120 +------------------------------------------ 2 files changed, 2 insertions(+), 119 deletions(-) diff --git a/.gitignore b/.gitignore index cfa4ab2ef..85aada097 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ __pycache__ coverage.xml node_modules/ coverage/ +venv/* \ No newline at end of file diff --git a/api/requirements.txt b/api/requirements.txt index 489845288..b7029c42e 100644 --- a/api/requirements.txt +++ b/api/requirements.txt @@ -1,132 +1,14 @@ -anyio==4.9.0 -argon2-cffi==23.1.0 -argon2-cffi-bindings==21.2.0 -arrow==1.3.0 -asttokens==3.0.0 -async-lru==2.0.5 -attrs==25.3.0 -babel==2.17.0 -beautifulsoup4==4.13.3 -bleach==6.2.0 blinker==1.9.0 -certifi==2025.1.31 -cffi==1.17.1 -charset-normalizer==3.4.1 click==8.2.1 -colorama==0.4.6 -comm==0.2.2 -contourpy==1.3.1 coverage==7.8.2 -cycler==0.12.1 -debugpy==1.8.13 -decorator==5.2.1 -defusedxml==0.7.1 -executing==2.2.0 -fastjsonschema==2.21.1 -filelock==3.13.1 Flask==3.1.1 -fonttools==4.56.0 -fqdn==1.5.1 -fsspec==2024.6.1 -gitdb==4.0.12 -GitPython==3.1.44 -h11==0.14.0 -httpcore==1.0.7 -httpx==0.28.1 -idna==3.10 iniconfig==2.1.0 -ipykernel==6.29.5 -ipython==9.0.2 -ipython_pygments_lexers==1.1.1 -isoduration==20.11.0 itsdangerous==2.2.0 -jedi==0.19.2 Jinja2==3.1.6 -joblib==1.4.2 -json5==0.10.0 -jsonpointer==3.0.0 -jsonschema==4.23.0 -jsonschema-specifications==2024.10.1 -jupyter-events==0.12.0 -jupyter-lsp==2.2.5 -jupyter-server-mathjax==0.2.6 -jupyter_client==8.6.3 -jupyter_core==5.7.2 -jupyter_server==2.15.0 -jupyter_server_terminals==0.5.3 -jupyterlab==4.3.6 -jupyterlab_git==0.51.0 -jupyterlab_pygments==0.3.0 -jupyterlab_server==2.27.3 -kiwisolver==1.4.8 MarkupSafe==3.0.2 -matplotlib==3.10.1 -matplotlib-inline==0.1.7 -mistune==3.1.2 -mpmath==1.3.0 -narwhals==1.31.0 -nbclient==0.10.2 -nbconvert==7.16.6 -nbdime==4.0.2 -nbformat==5.10.4 -nest-asyncio==1.6.0 -networkx==3.3 -notebook_shim==0.2.4 -numpy==2.2.4 -overrides==7.7.0 -packaging==24.2 -pandas==2.2.3 -pandocfilters==1.5.1 -parso==0.8.4 -pexpect==4.9.0 -pillow==11.1.0 -platformdirs==4.3.6 -plotly==6.0.1 +packaging==25.0 pluggy==1.6.0 -prometheus_client==0.21.1 -prompt_toolkit==3.0.50 -psutil==7.0.0 -ptyprocess==0.7.0 -pure_eval==0.2.3 -pycparser==2.22 Pygments==2.19.1 -pyparsing==3.2.1 pytest==8.4.0 pytest-cov==6.1.1 -python-dateutil==2.9.0.post0 -python-json-logger==3.3.0 -pytz==2025.1 -PyYAML==6.0.2 -pyzmq==26.3.0 -referencing==0.36.2 -requests==2.32.3 -rfc3339-validator==0.1.4 -rfc3986-validator==0.1.1 -rpds-py==0.23.1 -scikit-learn==1.6.1 -scipy==1.15.2 -seaborn==0.13.2 -Send2Trash==1.8.3 -setuptools==76.0.0 -six==1.17.0 -smmap==5.0.2 -sniffio==1.3.1 -soupsieve==2.6 -stack-data==0.6.3 -sympy==1.13.1 -terminado==0.18.1 -threadpoolctl==3.6.0 -tinycss2==1.4.0 -torch==2.6.0+cpu -tornado==6.4.2 -traitlets==5.14.3 -types-python-dateutil==2.9.0.20241206 -typing_extensions==4.12.2 -tzdata==2025.1 -uri-template==1.3.0 -urllib3==2.3.0 -wcwidth==0.2.13 -webcolors==24.11.1 -webencodings==0.5.1 -websocket-client==1.8.0 Werkzeug==3.1.3 From 139833bb1d4da0d19a3b2aa20537f92fa22e346f Mon Sep 17 00:00:00 2001 From: David Fulmer Date: Wed, 11 Jun 2025 14:37:55 +0000 Subject: [PATCH 05/16] step3: add project status check target --- codecov.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 codecov.yml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..b6ac064fd --- /dev/null +++ b/codecov.yml @@ -0,0 +1,6 @@ +coverage: + status: + project: + default: + target: 100% + threshold: 1% \ No newline at end of file From e578cac8668796cedebcf785bc264406fc6eaa19 Mon Sep 17 00:00:00 2001 From: David Fulmer Date: Wed, 11 Jun 2025 14:49:48 +0000 Subject: [PATCH 06/16] step3.1: taking out a test --- api/calculator/test_calculator.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/api/calculator/test_calculator.py b/api/calculator/test_calculator.py index 69fa778f1..50dbbe0cf 100644 --- a/api/calculator/test_calculator.py +++ b/api/calculator/test_calculator.py @@ -1,12 +1,12 @@ from .calculator import Calculator -def test_add(): - assert Calculator.add(1, 2) == 3.0 - assert Calculator.add(1.0, 2.0) == 3.0 - assert Calculator.add(0, 2.0) == 2.0 - assert Calculator.add(2.0, 0) == 2.0 - assert Calculator.add(-4, 2.0) == -2.0 +# def test_add(): +# assert Calculator.add(1, 2) == 3.0 +# assert Calculator.add(1.0, 2.0) == 3.0 +# assert Calculator.add(0, 2.0) == 2.0 +# assert Calculator.add(2.0, 0) == 2.0 +# assert Calculator.add(-4, 2.0) == -2.0 def test_subtract(): assert Calculator.subtract(1, 2) == -1.0 From ebfb242eeb75f2b424f63cf5d22d140cb0adbb3c Mon Sep 17 00:00:00 2001 From: David Fulmer Date: Wed, 11 Jun 2025 15:07:02 +0000 Subject: [PATCH 07/16] step3: adjusting the codecov.yml --- codecov.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/codecov.yml b/codecov.yml index b6ac064fd..96e606068 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,6 +1,3 @@ coverage: - status: - project: - default: - target: 100% - threshold: 1% \ No newline at end of file + status: + project: true \ No newline at end of file From 996f06d86bca540869089a615efabc29b5b19aa5 Mon Sep 17 00:00:00 2001 From: David Fulmer Date: Wed, 11 Jun 2025 15:10:48 +0000 Subject: [PATCH 08/16] step3: adjusting the codecov.yml a second time --- codecov.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codecov.yml b/codecov.yml index 96e606068..a70122c26 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,3 +1,3 @@ coverage: - status: - project: true \ No newline at end of file + status: + project: true From a5756af342104f4950772adbda20ef52ca75753f Mon Sep 17 00:00:00 2001 From: David Fulmer Date: Wed, 11 Jun 2025 15:13:41 +0000 Subject: [PATCH 09/16] step3: putting back codecov.yml the way it was --- codecov.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/codecov.yml b/codecov.yml index a70122c26..b6ac064fd 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,3 +1,6 @@ coverage: status: - project: true + project: + default: + target: 100% + threshold: 1% \ No newline at end of file From db76feb11a94af06c3ea5c332376f5793de535d2 Mon Sep 17 00:00:00 2001 From: David Fulmer Date: Wed, 11 Jun 2025 15:15:37 +0000 Subject: [PATCH 10/16] step3: adding square method --- api/calculator/calculator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/calculator/calculator.py b/api/calculator/calculator.py index eac4e7acb..7f0977fbb 100644 --- a/api/calculator/calculator.py +++ b/api/calculator/calculator.py @@ -11,4 +11,7 @@ def multiply(x, y): def divide(x, y): if y == 0: return 'Cannot divide by 0' - return x * 1.0 / y \ No newline at end of file + return x * 1.0 / y + + def square(x, y): + return x ** 2 \ No newline at end of file From 5baef44e7dc4b80835710170d13403f25f008401 Mon Sep 17 00:00:00 2001 From: David Fulmer Date: Wed, 11 Jun 2025 15:18:02 +0000 Subject: [PATCH 11/16] step3: cover divide by 0 case --- api/calculator/calculator.py | 5 +---- api/calculator/test_calculator.py | 17 ++++++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/api/calculator/calculator.py b/api/calculator/calculator.py index 7f0977fbb..eac4e7acb 100644 --- a/api/calculator/calculator.py +++ b/api/calculator/calculator.py @@ -11,7 +11,4 @@ def multiply(x, y): def divide(x, y): if y == 0: return 'Cannot divide by 0' - return x * 1.0 / y - - def square(x, y): - return x ** 2 \ No newline at end of file + return x * 1.0 / y \ No newline at end of file diff --git a/api/calculator/test_calculator.py b/api/calculator/test_calculator.py index 50dbbe0cf..4c0e68150 100644 --- a/api/calculator/test_calculator.py +++ b/api/calculator/test_calculator.py @@ -1,12 +1,12 @@ from .calculator import Calculator -# def test_add(): -# assert Calculator.add(1, 2) == 3.0 -# assert Calculator.add(1.0, 2.0) == 3.0 -# assert Calculator.add(0, 2.0) == 2.0 -# assert Calculator.add(2.0, 0) == 2.0 -# assert Calculator.add(-4, 2.0) == -2.0 +def test_add(): + assert Calculator.add(1, 2) == 3.0 + assert Calculator.add(1.0, 2.0) == 3.0 + assert Calculator.add(0, 2.0) == 2.0 + assert Calculator.add(2.0, 0) == 2.0 + assert Calculator.add(-4, 2.0) == -2.0 def test_subtract(): assert Calculator.subtract(1, 2) == -1.0 @@ -27,4 +27,7 @@ def test_divide(): assert Calculator.divide(1, 2) == 0.5 assert Calculator.divide(1.0, 2.0) == 0.5 assert Calculator.divide(0, 2.0) == 0 - assert Calculator.divide(-4, 2.0) == -2.0 \ No newline at end of file + assert Calculator.divide(-4, 2.0) == -2.0 + +def test_divide_by_0(): + assert Calculator.divide(2.0, 0) == 'Cannot divide by 0' \ No newline at end of file From f0cd83abeb297512117c41bc13c99f8b0d5d7d05 Mon Sep 17 00:00:00 2001 From: David Fulmer Date: Wed, 11 Jun 2025 15:22:25 +0000 Subject: [PATCH 12/16] step3: add Codecov badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2c27a415d..b80e4068a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ +[![codecov](https://codecov.io/gh/dfulmer/codecov-demo/graph/badge.svg?token=Y9KAYHKTQ5)](https://codecov.io/gh/dfulmer/codecov-demo) # codecov-demo This repository is meant to show Codecov's features and functionalities. You can follow along [here](https://docs.codecov.com/docs/codecov-tutorial). From bd29a9386c47f528e959584e434aaf78e552c338 Mon Sep 17 00:00:00 2001 From: David Fulmer Date: Wed, 11 Jun 2025 15:28:21 +0000 Subject: [PATCH 13/16] step4: add smiles --- .github/workflows/api.yml | 6 ++++-- api/smiles/__init__.py | 0 api/smiles/smiles.py | 6 ++++++ api/smiles/test_smiles.py | 4 ++++ 4 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 api/smiles/__init__.py create mode 100644 api/smiles/smiles.py create mode 100644 api/smiles/test_smiles.py diff --git a/.github/workflows/api.yml b/.github/workflows/api.yml index 9fd271126..f86f2aa13 100644 --- a/.github/workflows/api.yml +++ b/.github/workflows/api.yml @@ -13,8 +13,10 @@ 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@v5 env: diff --git a/api/smiles/__init__.py b/api/smiles/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/api/smiles/smiles.py b/api/smiles/smiles.py new file mode 100644 index 000000000..765cabf0e --- /dev/null +++ b/api/smiles/smiles.py @@ -0,0 +1,6 @@ +class Smiles: + def smile(self): + return ":)" + + def frown(self): + return ":(" \ No newline at end of file diff --git a/api/smiles/test_smiles.py b/api/smiles/test_smiles.py new file mode 100644 index 000000000..39e188f16 --- /dev/null +++ b/api/smiles/test_smiles.py @@ -0,0 +1,4 @@ +from .smiles import Smiles + +def test_smile(): + assert Smiles().smile() == ":)" \ No newline at end of file From ce1332df0de58efeeb02ada8ddc3468f02519cfb Mon Sep 17 00:00:00 2001 From: David Fulmer Date: Wed, 11 Jun 2025 15:35:26 +0000 Subject: [PATCH 14/16] step4: add Codecov Component --- codecov.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/codecov.yml b/codecov.yml index b6ac064fd..4fa5b5230 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,3 +1,12 @@ +comment: + layout: "condensed_header, diff, flags, components" + +component_management: + individual_components: + - component_id: api # this is an identifier that should not be changed + name: api # this is a display name, and can be changed freely + paths: + - api coverage: status: project: From a3ac4044bc06100d5823b7618a2761ae73e65e4a Mon Sep 17 00:00:00 2001 From: David Fulmer Date: Wed, 11 Jun 2025 15:39:39 +0000 Subject: [PATCH 15/16] step4: aggregate tests and split Component --- .github/workflows/api.yml | 8 +++----- codecov.yml | 10 +++++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/api.yml b/.github/workflows/api.yml index f86f2aa13..e9230edab 100644 --- a/.github/workflows/api.yml +++ b/.github/workflows/api.yml @@ -13,11 +13,9 @@ jobs: python-version: '3.10' - name: Install requirements run: pip install -r api/requirements.txt - - 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: Run tests and collect coverage + run: pytest --cov - name: Upload coverage reports to Codecov with GitHub Action uses: codecov/codecov-action@v5 env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/codecov.yml b/codecov.yml index 4fa5b5230..ae8f3f21d 100644 --- a/codecov.yml +++ b/codecov.yml @@ -3,10 +3,14 @@ comment: component_management: individual_components: - - component_id: api # this is an identifier that should not be changed - name: api # this is a display name, and can be changed freely + - 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 + - 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/ coverage: status: project: From 3e1754d2f063b863cf26de7deac1d267cdb3e5fb Mon Sep 17 00:00:00 2001 From: David Fulmer Date: Wed, 11 Jun 2025 15:43:25 +0000 Subject: [PATCH 16/16] step4: aggregate tests and split Component-fixing the api.yml --- .github/workflows/api.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/api.yml b/.github/workflows/api.yml index e9230edab..2c2f08c71 100644 --- a/.github/workflows/api.yml +++ b/.github/workflows/api.yml @@ -18,4 +18,4 @@ jobs: - name: Upload coverage reports to Codecov with GitHub Action uses: codecov/codecov-action@v5 env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file