From 856d451709875699ffd0e41ef80089abd9c4117b Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Fri, 9 Apr 2021 10:53:12 -0400 Subject: [PATCH] Switch to automatic flags and add new tests --- .github/workflows/ci.yaml | 18 ++++++++++++++++++ codecov.yml | 40 +++++++++++++++++++++------------------ new_feature/__init__.py | 0 new_feature/auth.py | 6 ++++++ smiles/smiles.py | 1 + tests/test_auth.py | 5 +++++ 6 files changed, 52 insertions(+), 18 deletions(-) create mode 100644 new_feature/__init__.py create mode 100644 new_feature/auth.py create mode 100644 tests/test_auth.py diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 855b5a8..74575c2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,6 +15,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt + - name: Test calculator run: | coverage run -m pytest tests/test_calculator.py @@ -22,6 +23,7 @@ jobs: - uses: codecov/codecov-action@v1 with: flags: calculator + - name: Test smiles run: | coverage run -m pytest tests/test_smiles.py @@ -29,3 +31,19 @@ jobs: - uses: codecov/codecov-action@v1 with: flags: smiles + + - name: Test smiles + run: | + coverage run -m pytest tests/test_auth.py + coverage xml + - uses: codecov/codecov-action@v1 + with: + flags: auth + + - name: Test old features together + run: | + coverage run -m pytest tests/test_calculator.py tests/test_smiles.py + coverage xml + - uses: codecov/codecov-action@v1 + with: + flags: old-features diff --git a/codecov.yml b/codecov.yml index ed7fbda..b2bd42c 100644 --- a/codecov.yml +++ b/codecov.yml @@ -2,28 +2,32 @@ coverage: status: project: default: - target: 50% - calculator: - target: 100% - flags: - - calculator - smiles: - target: 75% - flags: - - smiles + target: 83.33% patch: default: - target: 100% + target: 75% -flags: - calculator: - paths: - - calculator/ - carryforward: true - smiles: - paths: - - smiles/ +flag_management: + default_rules: carryforward: true + statuses: + - name_prefix: proj- + type: project + target: 75% + threshold: 1% + - name_prefix: patch- + type: patch + target: 75% + individual_flags: + - name: old_features + paths: + - smiles/ + - calculator/ + carryforward: true + statuses: + - name_prefix: proj- + type: project + target: 87.5% ignore: - tests/* diff --git a/new_feature/__init__.py b/new_feature/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/new_feature/auth.py b/new_feature/auth.py new file mode 100644 index 0000000..8cd0814 --- /dev/null +++ b/new_feature/auth.py @@ -0,0 +1,6 @@ +def login(): + return True + + +def logout(): + return True diff --git a/smiles/smiles.py b/smiles/smiles.py index 4d34acc..65047f1 100644 --- a/smiles/smiles.py +++ b/smiles/smiles.py @@ -1,5 +1,6 @@ def smile(): return ":)" + def frown(): return ":(" diff --git a/tests/test_auth.py b/tests/test_auth.py new file mode 100644 index 0000000..6d79f54 --- /dev/null +++ b/tests/test_auth.py @@ -0,0 +1,5 @@ +from new_feature import auth + + +def test_login(): + assert auth.login() is True