From 25d0d22e2f47d08df69549ed20646046101dbeae Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Wed, 24 Jan 2024 09:44:17 -0800 Subject: [PATCH 1/8] feat: test out fail test ingestion --- .github/workflows/ci.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb23bd64..807382ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,17 +14,12 @@ jobs: 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: Run tests and collect coverage - run: pytest --cov app ${{ env.CODECOV_ATS_TESTS }} + run: pytest --cov app --junitxml=testresults.xml + + - name: Install CLI + run: pip install --no-cache-dir git+https://github.com/codecov/codecov-cli.git@joseph/test-results-staging - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4-beta - with: - flags: smart-tests - verbose: true + run: codecovcli -v do-upload --report-type test_results --file testresults.junit.xml env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 5d9738f4159abfad9227ba44cec8a46fd6c9d69d Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Wed, 24 Jan 2024 09:45:24 -0800 Subject: [PATCH 2/8] fix: add the url --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 807382ec..93150e45 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,6 @@ jobs: - name: Install CLI run: pip install --no-cache-dir git+https://github.com/codecov/codecov-cli.git@joseph/test-results-staging - name: Upload coverage to Codecov - run: codecovcli -v do-upload --report-type test_results --file testresults.junit.xml + run: codecovcli -v -u ${{ secrets.CODECOV_STAGING_API_URL }} do-upload --report-type test_results --file testresults.junit.xml env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 25c8a5d33fe44a13c98de5fc636b38dac344b4eb Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Wed, 24 Jan 2024 09:46:57 -0800 Subject: [PATCH 3/8] fix: use the staging org token --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93150e45..9178fd03 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,4 +22,4 @@ jobs: - name: Upload coverage to Codecov run: codecovcli -v -u ${{ secrets.CODECOV_STAGING_API_URL }} do-upload --report-type test_results --file testresults.junit.xml env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN_STAGING }} From c23476b34a002de43799bdc53c2ed4933654de6b Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Wed, 24 Jan 2024 09:48:31 -0800 Subject: [PATCH 4/8] fix: point to the right file --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9178fd03..ea4aa022 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,9 +17,12 @@ jobs: - name: Run tests and collect coverage run: pytest --cov app --junitxml=testresults.xml + - name: cat testresults.xml + run: cat testresults.xml + - name: Install CLI run: pip install --no-cache-dir git+https://github.com/codecov/codecov-cli.git@joseph/test-results-staging - name: Upload coverage to Codecov - run: codecovcli -v -u ${{ secrets.CODECOV_STAGING_API_URL }} do-upload --report-type test_results --file testresults.junit.xml + run: codecovcli -v -u ${{ secrets.CODECOV_STAGING_API_URL }} do-upload --report-type test_results --file testresults.xml env: CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN_STAGING }} From 5618d9e51eb491b50b78bf10e8d251eca713703a Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Wed, 24 Jan 2024 09:51:56 -0800 Subject: [PATCH 5/8] fix: make it 2 runs --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea4aa022..fb1922f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,11 @@ jobs: - name: Install CLI run: pip install --no-cache-dir git+https://github.com/codecov/codecov-cli.git@joseph/test-results-staging - - name: Upload coverage to Codecov + - name: Upload test results to Codecov run: codecovcli -v -u ${{ secrets.CODECOV_STAGING_API_URL }} do-upload --report-type test_results --file testresults.xml env: CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN_STAGING }} + - name: Upload coverage to Codecov + run: codecovcli -v -u ${{ secrets.CODECOV_STAGING_API_URL }} do-upload + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN_STAGING }} From 205d07bcb9f58bf058776fc180ea8732452c3764 Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Wed, 24 Jan 2024 09:54:18 -0800 Subject: [PATCH 6/8] fix: do upload-process instead of do-upload --- .github/workflows/ci.yml | 9 +++++---- app/test_calculator.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb1922f1..42c0a421 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,11 +22,12 @@ jobs: - name: Install CLI run: pip install --no-cache-dir git+https://github.com/codecov/codecov-cli.git@joseph/test-results-staging - - name: Upload test results to Codecov - run: codecovcli -v -u ${{ secrets.CODECOV_STAGING_API_URL }} do-upload --report-type test_results --file testresults.xml + + - name: Upload coverage to Codecov + run: codecovcli -v -u ${{ secrets.CODECOV_STAGING_API_URL }} upload-process env: CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN_STAGING }} - - name: Upload coverage to Codecov - run: codecovcli -v -u ${{ secrets.CODECOV_STAGING_API_URL }} do-upload + - name: Upload test results to Codecov + run: codecovcli -v -u ${{ secrets.CODECOV_STAGING_API_URL }} do-upload --report-type test_results --file testresults.xml env: CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN_STAGING }} diff --git a/app/test_calculator.py b/app/test_calculator.py index f5641938..3efaac11 100644 --- a/app/test_calculator.py +++ b/app/test_calculator.py @@ -2,7 +2,7 @@ def test_add(): - assert Calculator.add(1, 2) == 3.0 + assert Calculator.add(1, 2) == 4.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 From e92770f604805061b1dc8126072a6e7415c88c8c Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Wed, 24 Jan 2024 09:55:22 -0800 Subject: [PATCH 7/8] fix: continue-on-error --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 42c0a421..1e2c02dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,7 @@ jobs: run: pip install -r requirements.txt - name: Run tests and collect coverage run: pytest --cov app --junitxml=testresults.xml + continue-on-error: true - name: cat testresults.xml run: cat testresults.xml From dfbdbb3e2b71bc60c9ece534b353dbed829a3555 Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Wed, 24 Jan 2024 09:57:31 -0800 Subject: [PATCH 8/8] fix: space --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e2c02dd..5e5de7e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,6 @@ jobs: - name: cat testresults.xml run: cat testresults.xml - - name: Install CLI run: pip install --no-cache-dir git+https://github.com/codecov/codecov-cli.git@joseph/test-results-staging