From 4ba0f82e265661d253eac995128f90f14b3c30e9 Mon Sep 17 00:00:00 2001 From: Rohan Bhaumik Date: Fri, 22 Sep 2023 12:14:48 -0400 Subject: [PATCH 01/10] set up codecov --- app/test_calculator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test_calculator.py b/app/test_calculator.py index f5641938..43bc650e 100644 --- a/app/test_calculator.py +++ b/app/test_calculator.py @@ -24,7 +24,7 @@ def test_multiply(): assert Calculator.multiply(-4, 2.0) == -8.0 def test_divide(): - # assert Calculator.divide(1, 2) == 0.5 + 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 From 0335bd8d26ddd1d5f7a1d34c9b29301bb373b5b9 Mon Sep 17 00:00:00 2001 From: Rohan Bhaumik Date: Fri, 22 Sep 2023 12:18:14 -0400 Subject: [PATCH 02/10] set up codecov again --- app/calculator.py | 2 +- app/test_calculator.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/calculator.py b/app/calculator.py index 8a976b25..f509acdd 100644 --- a/app/calculator.py +++ b/app/calculator.py @@ -12,4 +12,4 @@ def multiply(x, y): def divide(x, y): if y == 0: return 'Cannot divide by 0' - return x * 1.0 / y + return x * 1.0 / y \ No newline at end of file diff --git a/app/test_calculator.py b/app/test_calculator.py index 43bc650e..62a63906 100644 --- a/app/test_calculator.py +++ b/app/test_calculator.py @@ -28,4 +28,4 @@ def test_divide(): assert Calculator.divide(1.0, 2.0) == 0.5 assert Calculator.divide(0, 2.0) == 0 assert Calculator.divide(-4, 2.0) == -2.0 - # assert Calculator.divide(2.0, 0.0) == 'Cannot divide by 0' + assert Calculator.divide(2.0, 0.0) == 'Cannot divide by 0' From 5704ad850e94df6f4441b4fbddd6a0d35d415dea Mon Sep 17 00:00:00 2001 From: Rohan Bhaumik Date: Fri, 22 Sep 2023 12:21:28 -0400 Subject: [PATCH 03/10] here we go --- app/test_calculator.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/test_calculator.py b/app/test_calculator.py index 62a63906..57d6eafc 100644 --- a/app/test_calculator.py +++ b/app/test_calculator.py @@ -29,3 +29,5 @@ def test_divide(): assert Calculator.divide(0, 2.0) == 0 assert Calculator.divide(-4, 2.0) == -2.0 assert Calculator.divide(2.0, 0.0) == 'Cannot divide by 0' + assert Calculator.divide(3.0, 0.0) == 'Cannot divide by 0' + From 8656c1a2c4a78124db83ccc3f4c20b1e50f9e4e9 Mon Sep 17 00:00:00 2001 From: Rohan Bhaumik Date: Fri, 22 Sep 2023 12:27:14 -0400 Subject: [PATCH 04/10] adding ATS to CI --- .github/workflows/ci.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0bce60d5..33e82a13 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,14 +6,22 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Python 3.10 uses: actions/setup-python@v4 with: python-version: '3.10' + - name: Run ATS + uses: codecov/codecov-ats@v0 + env: + CODECOV_STATIC_TOKEN: ${{ secrets.CODECOV_STATIC_TOKEN }} + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - name: Install dependencies run: pip install -r requirements.txt - name: Run tests and collect coverage - run: pytest --cov app + run: pytest --cov app ${{ env.CODECOV_ATS_TESTS_TO_RUN }} - name: Upload coverage to Codecov uses: codecov/codecov-action@v4-beta env: From 869a494d1a6da393b4e52bfab4d1dc39f7d269e5 Mon Sep 17 00:00:00 2001 From: Rohan Bhaumik Date: Fri, 22 Sep 2023 12:32:55 -0400 Subject: [PATCH 05/10] new fun --- app/calculator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/calculator.py b/app/calculator.py index f509acdd..40a477ae 100644 --- a/app/calculator.py +++ b/app/calculator.py @@ -12,4 +12,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 exponent(x,y): + return x**y \ No newline at end of file From 3fb51a50fa8ab9445e9a43e81475e74eadc4fc67 Mon Sep 17 00:00:00 2001 From: Rohan Bhaumik Date: Fri, 22 Sep 2023 12:35:21 -0400 Subject: [PATCH 06/10] futz2 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33e82a13..161c9a1b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,13 +13,13 @@ jobs: uses: actions/setup-python@v4 with: python-version: '3.10' + - name: Install dependencies + run: pip install -r requirements.txt - name: Run ATS uses: codecov/codecov-ats@v0 env: CODECOV_STATIC_TOKEN: ${{ secrets.CODECOV_STATIC_TOKEN }} CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - - name: Install dependencies - run: pip install -r requirements.txt - name: Run tests and collect coverage run: pytest --cov app ${{ env.CODECOV_ATS_TESTS_TO_RUN }} - name: Upload coverage to Codecov From 5f1b4c480a0bcd17367eaec75fffc0019ecc5a7f Mon Sep 17 00:00:00 2001 From: Rohan Bhaumik Date: Fri, 22 Sep 2023 12:48:40 -0400 Subject: [PATCH 07/10] adding tests for exponent --- app/test_calculator.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/test_calculator.py b/app/test_calculator.py index 57d6eafc..7e5033c6 100644 --- a/app/test_calculator.py +++ b/app/test_calculator.py @@ -31,3 +31,5 @@ def test_divide(): assert Calculator.divide(2.0, 0.0) == 'Cannot divide by 0' assert Calculator.divide(3.0, 0.0) == 'Cannot divide by 0' +def test_exponent(): + assert Calculator.exponent(2.0,2.0) == 4.0 \ No newline at end of file From c83973baf83ae3a75269e148046fc8abe958ff75 Mon Sep 17 00:00:00 2001 From: Rohan Bhaumik Date: Mon, 25 Sep 2023 09:40:42 -0400 Subject: [PATCH 08/10] CLI Config changes --- codecov.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/codecov.yml b/codecov.yml index 6f151f75..86e36ae8 100644 --- a/codecov.yml +++ b/codecov.yml @@ -4,3 +4,17 @@ profiling: comment: show_critical_paths: true + +flag_management: + individual_flags: + - name: smart-tests + carryforward: true + carryforward_mode: "labels" + statuses: + - type: "project" + - type: "patch" + +cli: + plugins: + pycoverage: + report_type: "json" From dc143914579726e3a3f8d9901debf4b90ce19ee3 Mon Sep 17 00:00:00 2001 From: Rohan Bhaumik Date: Mon, 25 Sep 2023 09:50:19 -0400 Subject: [PATCH 09/10] removing exponent function --- app/calculator.py | 5 +---- app/test_calculator.py | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/app/calculator.py b/app/calculator.py index 40a477ae..1214e45f 100644 --- a/app/calculator.py +++ b/app/calculator.py @@ -12,7 +12,4 @@ def multiply(x, y): def divide(x, y): if y == 0: return 'Cannot divide by 0' - return x * 1.0/y - - def exponent(x,y): - return x**y \ No newline at end of file + return x * 1.0/y \ No newline at end of file diff --git a/app/test_calculator.py b/app/test_calculator.py index 7e5033c6..3b150671 100644 --- a/app/test_calculator.py +++ b/app/test_calculator.py @@ -29,7 +29,4 @@ def test_divide(): assert Calculator.divide(0, 2.0) == 0 assert Calculator.divide(-4, 2.0) == -2.0 assert Calculator.divide(2.0, 0.0) == 'Cannot divide by 0' - assert Calculator.divide(3.0, 0.0) == 'Cannot divide by 0' - -def test_exponent(): - assert Calculator.exponent(2.0,2.0) == 4.0 \ No newline at end of file + assert Calculator.divide(3.0, 0.0) == 'Cannot divide by 0' \ No newline at end of file From 4630bf3d7badc3eaab3068d0edba15e4953293a4 Mon Sep 17 00:00:00 2001 From: Rohan Bhaumik Date: Mon, 25 Sep 2023 11:35:38 -0400 Subject: [PATCH 10/10] Uploadd report in XML - see if reports can be parsed again --- codecov.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/codecov.yml b/codecov.yml index 86e36ae8..312db705 100644 --- a/codecov.yml +++ b/codecov.yml @@ -14,7 +14,7 @@ flag_management: - type: "project" - type: "patch" -cli: - plugins: - pycoverage: - report_type: "json" +#cli: + #plugins: + #pycoverage: + #report_type: "json"