From 1ad0cd2f914c815778adfe12dbdf95b5617af9a7 Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Fri, 12 Jun 2020 18:29:01 -0400 Subject: [PATCH 01/25] Fix GitHub Actions service --- codecov/__init__.py | 2 +- tests/test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codecov/__init__.py b/codecov/__init__.py index 046f4cef..3308d1b9 100644 --- a/codecov/__init__.py +++ b/codecov/__init__.py @@ -805,7 +805,7 @@ def main(*argv, **kwargs): # https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables query.update( dict( - service="github", + service="github-actions", build=os.getenv("GITHUB_RUN_ID"), commit=os.getenv("GITHUB_SHA"), slug=os.getenv("GITHUB_REPOSITORY"), diff --git a/tests/test.py b/tests/test.py index 2188dac3..fa88b4cb 100644 --- a/tests/test.py +++ b/tests/test.py @@ -889,7 +889,7 @@ def test_ci_github(self): ) self.fake_report() res = self.run_cli() - self.assertEqual(res["query"]["service"], "github") + self.assertEqual(res["query"]["service"], "github-actions") self.assertEqual( res["query"]["commit"], "d653b934ed59c1a785cc1cc79d08c9aaa4eba73b" ) From e47b94d6aca95b2f7b65715b138fd404ea95b2c7 Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Fri, 12 Jun 2020 18:30:00 -0400 Subject: [PATCH 02/25] Bump version --- CHANGELOG.md | 4 ++++ codecov/__version__.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ac93e00..aa695dda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### `2.1.6` + +- [#275](https://github.com/codecov/codecov-python/pull/275) Fix GitHub Actions implementation + ### `2.1.5` - [#273](https://github.com/codecov/codecov-python/pull/273) Implement retries on Codecov API calls diff --git a/codecov/__version__.py b/codecov/__version__.py index 0ff00ce8..8344be9c 100644 --- a/codecov/__version__.py +++ b/codecov/__version__.py @@ -5,4 +5,4 @@ __license__ = "Apache 2.0" __title__ = "codecov" __url__ = "https://github.com/codecov/codecov-python" -__version__ = "2.1.5" +__version__ = "2.1.6" From 74bdc6ddce30845aa64d0e185eadda98c970ce29 Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Fri, 12 Jun 2020 18:36:09 -0400 Subject: [PATCH 03/25] Add a GitHub Actions workflow --- .github/workflows/build-test.yml | 43 ++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/build-test.yml diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml new file mode 100644 index 00000000..a39a0a43 --- /dev/null +++ b/.github/workflows/build-test.yml @@ -0,0 +1,43 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python package + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.5, 3.6, 3.7, 3.8] + + steps: + - uses: actions/checkout@v1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test + run: | + make reinstall + make test + - name: Upload coverage reports to Codecov + run: | + codecov From ce2658a07726454455486e699c3c34f0866eda5a Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Fri, 12 Jun 2020 18:37:22 -0400 Subject: [PATCH 04/25] Lint later --- .github/workflows/build-test.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index a39a0a43..37e0b02f 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -28,12 +28,6 @@ jobs: python -m pip install --upgrade pip pip install flake8 pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test run: | make reinstall From 9e8c4730809e2396b39fcf3b2c8e392b6d27c6c0 Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Fri, 12 Jun 2020 18:40:16 -0400 Subject: [PATCH 05/25] Install requirements --- .github/workflows/build-test.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 37e0b02f..a4d2ba9a 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.5, 3.6, 3.7, 3.8] + python-version: [3.5, 3.6, 3.7] steps: - uses: actions/checkout@v1 @@ -26,8 +26,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install -r tests/requirements.txt - name: Test run: | make reinstall From 36bc6d8bae38f1c63b6c43d9cffbbe86d5679a05 Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Fri, 12 Jun 2020 18:44:39 -0400 Subject: [PATCH 06/25] log --- codecov/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/codecov/__init__.py b/codecov/__init__.py index 3308d1b9..2afaa533 100644 --- a/codecov/__init__.py +++ b/codecov/__init__.py @@ -820,6 +820,7 @@ def main(*argv, **kwargs): query["branch"] = os.getenv("GITHUB_REF").split("/", 3)[-1] if os.getenv("GITHUB_HEAD_REF"): # PR refs are in the format: refs/pull/7/merge + write(os.getenv("GITHUB_REF")) query["pr"] = os.getenv("GITHUB_REF").split("/")[-2] query["branch"] = os.getenv("GITHUB_HEAD_REF") From 349409cc8987f64ae6d3aec32b87fd538d64a93a Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Fri, 12 Jun 2020 18:48:16 -0400 Subject: [PATCH 07/25] more logging --- .github/workflows/build-test.yml | 6 ++++++ codecov/__init__.py | 1 - tests/test.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index a4d2ba9a..e408f99d 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -27,6 +27,12 @@ jobs: run: | python -m pip install --upgrade pip pip install -r tests/requirements.txt + - name: Print Environment variables + run: | + echo $GITHUB_REF + echo $GITHUB_HEAD_REF + echo $GITHUB_RUN_ID + echo $GITHUB_REPOSITORY - name: Test run: | make reinstall diff --git a/codecov/__init__.py b/codecov/__init__.py index 2afaa533..3308d1b9 100644 --- a/codecov/__init__.py +++ b/codecov/__init__.py @@ -820,7 +820,6 @@ def main(*argv, **kwargs): query["branch"] = os.getenv("GITHUB_REF").split("/", 3)[-1] if os.getenv("GITHUB_HEAD_REF"): # PR refs are in the format: refs/pull/7/merge - write(os.getenv("GITHUB_REF")) query["pr"] = os.getenv("GITHUB_REF").split("/")[-2] query["branch"] = os.getenv("GITHUB_HEAD_REF") diff --git a/tests/test.py b/tests/test.py index fa88b4cb..a816187e 100644 --- a/tests/test.py +++ b/tests/test.py @@ -878,7 +878,7 @@ def test_ci_gitlab(self): ) def test_ci_github(self): self.set_env( - GITHUB_REF="master", + GITHUB_REF="refs/pull/7/", GITHUB_RUN_ID="1399372237", GITHUB_REPOSITORY="owner/repo", GITHUB_ACTION="6de813bb999760c81f96f3cf5dbdcd51cead172f", From 9e9783d430723645ddec92210d4fac404c7eb5ba Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Fri, 12 Jun 2020 18:58:07 -0400 Subject: [PATCH 08/25] Set some env variables --- .github/workflows/build-test.yml | 9 ++++----- tests/test.py | 5 +---- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index e408f99d..b934c1eb 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -27,12 +27,11 @@ jobs: run: | python -m pip install --upgrade pip pip install -r tests/requirements.txt - - name: Print Environment variables + - name: Set environment variables run: | - echo $GITHUB_REF - echo $GITHUB_HEAD_REF - echo $GITHUB_RUN_ID - echo $GITHUB_REPOSITORY + echo '::set-env name=GITHUB_SHA::d653b934ed59c1a785cc1cc79d08c9aaa4eba73b' + echo '::set-env name=GITHUB_RUN_ID::1399372237' + echo '::set-env name=GITHUB_REPOSITORY::owner/repo' - name: Test run: | make reinstall diff --git a/tests/test.py b/tests/test.py index a816187e..49fbaa8f 100644 --- a/tests/test.py +++ b/tests/test.py @@ -878,11 +878,8 @@ def test_ci_gitlab(self): ) def test_ci_github(self): self.set_env( - GITHUB_REF="refs/pull/7/", - GITHUB_RUN_ID="1399372237", - GITHUB_REPOSITORY="owner/repo", + GITHUB_REF="refs/pull/7/merge", GITHUB_ACTION="6de813bb999760c81f96f3cf5dbdcd51cead172f", - GITHUB_SHA="d653b934ed59c1a785cc1cc79d08c9aaa4eba73b", HOME="/", CODECOV_TOKEN="token", CODECOV_NAME="name", From 5d7be94f7daa388919bd442c83a55db15eaeac49 Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Fri, 12 Jun 2020 19:00:45 -0400 Subject: [PATCH 09/25] log --- .github/workflows/build-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index b934c1eb..6c4bf95d 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -32,6 +32,7 @@ jobs: echo '::set-env name=GITHUB_SHA::d653b934ed59c1a785cc1cc79d08c9aaa4eba73b' echo '::set-env name=GITHUB_RUN_ID::1399372237' echo '::set-env name=GITHUB_REPOSITORY::owner/repo' + echo $GITHUB_SHA - name: Test run: | make reinstall From c34fee71615e63fd70ffc12c19eeb93f111dce8e Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Fri, 12 Jun 2020 19:08:41 -0400 Subject: [PATCH 10/25] set env in the action --- .github/workflows/build-test.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 6c4bf95d..eb7116cd 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -27,16 +27,14 @@ jobs: run: | python -m pip install --upgrade pip pip install -r tests/requirements.txt - - name: Set environment variables - run: | - echo '::set-env name=GITHUB_SHA::d653b934ed59c1a785cc1cc79d08c9aaa4eba73b' - echo '::set-env name=GITHUB_RUN_ID::1399372237' - echo '::set-env name=GITHUB_REPOSITORY::owner/repo' - echo $GITHUB_SHA - name: Test run: | make reinstall make test + env: + GITHUB_SHA: d653b934ed59c1a785cc1cc79d08c9aaa4eba73b + GITHUB_RUN_ID: 1399372237 + GITHUB_REPOSITORY: owner/repo - name: Upload coverage reports to Codecov run: | codecov From c2cf197b9dc080cdac18ea39ca98b86a562c8023 Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Fri, 12 Jun 2020 19:11:40 -0400 Subject: [PATCH 11/25] will it run --- tests/test.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tests/test.py b/tests/test.py index 49fbaa8f..47b28b31 100644 --- a/tests/test.py +++ b/tests/test.py @@ -886,14 +886,6 @@ def test_ci_github(self): ) self.fake_report() res = self.run_cli() - self.assertEqual(res["query"]["service"], "github-actions") - self.assertEqual( - res["query"]["commit"], "d653b934ed59c1a785cc1cc79d08c9aaa4eba73b" - ) - self.assertEqual(res["query"]["build"], "1399372237") - self.assertEqual(res["query"]["slug"], "owner/repo") - self.assertEqual(res["codecov"].token, "token") - self.assertEqual(res["codecov"].name, "name") @unittest.skip("Skip CI None") def test_ci_none(self): From 23d507cf2230482beb345815fab3619dceb8e27e Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Fri, 12 Jun 2020 19:22:18 -0400 Subject: [PATCH 12/25] one test --- .github/workflows/build-test.yml | 1 - tests/test.py | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index eb7116cd..36bafeca 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -32,7 +32,6 @@ jobs: make reinstall make test env: - GITHUB_SHA: d653b934ed59c1a785cc1cc79d08c9aaa4eba73b GITHUB_RUN_ID: 1399372237 GITHUB_REPOSITORY: owner/repo - name: Upload coverage reports to Codecov diff --git a/tests/test.py b/tests/test.py index 47b28b31..e8d489fb 100644 --- a/tests/test.py +++ b/tests/test.py @@ -886,6 +886,14 @@ def test_ci_github(self): ) self.fake_report() res = self.run_cli() + self.assertEqual(res["query"]["service"], "github-actions") + self.assertEqual( + res["query"]["commit"], os.getenv('GITHUB_SHA') + ) + #self.assertEqual(res["query"]["build"], "1399372237") + #self.assertEqual(res["query"]["slug"], "owner/repo") + #self.assertEqual(res["codecov"].token, "token") + #self.assertEqual(res["codecov"].name, "name") @unittest.skip("Skip CI None") def test_ci_none(self): From 767b8cd8cca708a33c2cfc4d55dd5eb483688cda Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Sat, 13 Jun 2020 11:45:34 -0400 Subject: [PATCH 13/25] Use the write SHA --- .github/workflows/build-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 36bafeca..d7a8473b 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -19,6 +19,8 @@ jobs: steps: - uses: actions/checkout@v1 + with: + ref: ${{ github.event.pull_request.head.sha }} - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: From 70577fdd4d42ddd879a5d60f1e41459123df6509 Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Sat, 13 Jun 2020 11:45:53 -0400 Subject: [PATCH 14/25] black --- tests/test.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/test.py b/tests/test.py index e8d489fb..0173b769 100644 --- a/tests/test.py +++ b/tests/test.py @@ -887,13 +887,11 @@ def test_ci_github(self): self.fake_report() res = self.run_cli() self.assertEqual(res["query"]["service"], "github-actions") - self.assertEqual( - res["query"]["commit"], os.getenv('GITHUB_SHA') - ) - #self.assertEqual(res["query"]["build"], "1399372237") - #self.assertEqual(res["query"]["slug"], "owner/repo") - #self.assertEqual(res["codecov"].token, "token") - #self.assertEqual(res["codecov"].name, "name") + self.assertEqual(res["query"]["commit"], os.getenv("GITHUB_SHA")) + # self.assertEqual(res["query"]["build"], "1399372237") + # self.assertEqual(res["query"]["slug"], "owner/repo") + # self.assertEqual(res["codecov"].token, "token") + # self.assertEqual(res["codecov"].name, "name") @unittest.skip("Skip CI None") def test_ci_none(self): From 8f480b64ce392912cde5a0eb2b1d23cc28b1b484 Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Sat, 13 Jun 2020 11:48:49 -0400 Subject: [PATCH 15/25] Maybe checkout v2 --- .github/workflows/build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index d7a8473b..6de19b66 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -18,7 +18,7 @@ jobs: python-version: [3.5, 3.6, 3.7] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 with: ref: ${{ github.event.pull_request.head.sha }} - name: Set up Python ${{ matrix.python-version }} From 73472e5eb6abea7550db4cda42201cae206d8514 Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Sat, 13 Jun 2020 11:54:16 -0400 Subject: [PATCH 16/25] Fixes --- .github/workflows/build-test.yml | 2 ++ tests/test.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 6de19b66..613ea5e0 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -39,3 +39,5 @@ jobs: - name: Upload coverage reports to Codecov run: | codecov + env: # Or as an environment variable + super_secret: ${{ secrets.CODECOV_TOKEN }} diff --git a/tests/test.py b/tests/test.py index 0173b769..7568c59e 100644 --- a/tests/test.py +++ b/tests/test.py @@ -888,8 +888,8 @@ def test_ci_github(self): res = self.run_cli() self.assertEqual(res["query"]["service"], "github-actions") self.assertEqual(res["query"]["commit"], os.getenv("GITHUB_SHA")) - # self.assertEqual(res["query"]["build"], "1399372237") - # self.assertEqual(res["query"]["slug"], "owner/repo") + self.assertEqual(res["query"]["build"], "1399372237") + self.assertEqual(res["query"]["slug"], "owner/repo") # self.assertEqual(res["codecov"].token, "token") # self.assertEqual(res["codecov"].name, "name") From b5c28ba87a84c44cd1c47886ead4e351c1adabed Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Sat, 13 Jun 2020 11:55:10 -0400 Subject: [PATCH 17/25] All the things --- .github/workflows/build-test.yml | 4 +++- tests/test.py | 12 +++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 613ea5e0..71e3268c 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -34,8 +34,10 @@ jobs: make reinstall make test env: - GITHUB_RUN_ID: 1399372237 + CODECOV_NAME: name + CODECOV_TOKEN: token GITHUB_REPOSITORY: owner/repo + GITHUB_RUN_ID: 1399372237 - name: Upload coverage reports to Codecov run: | codecov diff --git a/tests/test.py b/tests/test.py index 7568c59e..f3276a48 100644 --- a/tests/test.py +++ b/tests/test.py @@ -877,21 +877,15 @@ def test_ci_gitlab(self): "Skip GitHub Actions CI test", ) def test_ci_github(self): - self.set_env( - GITHUB_REF="refs/pull/7/merge", - GITHUB_ACTION="6de813bb999760c81f96f3cf5dbdcd51cead172f", - HOME="/", - CODECOV_TOKEN="token", - CODECOV_NAME="name", - ) + self.set_env(HOME="/") self.fake_report() res = self.run_cli() self.assertEqual(res["query"]["service"], "github-actions") self.assertEqual(res["query"]["commit"], os.getenv("GITHUB_SHA")) self.assertEqual(res["query"]["build"], "1399372237") self.assertEqual(res["query"]["slug"], "owner/repo") - # self.assertEqual(res["codecov"].token, "token") - # self.assertEqual(res["codecov"].name, "name") + self.assertEqual(res["codecov"].token, "token") + self.assertEqual(res["codecov"].name, "name") @unittest.skip("Skip CI None") def test_ci_none(self): From 8bc2bb2235afc3b238a0302f9fd50536cc3bdccc Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Sat, 13 Jun 2020 11:56:30 -0400 Subject: [PATCH 18/25] Maybe token like this --- .github/workflows/build-test.yml | 2 -- tests/test.py | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 71e3268c..634dbbbb 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -34,8 +34,6 @@ jobs: make reinstall make test env: - CODECOV_NAME: name - CODECOV_TOKEN: token GITHUB_REPOSITORY: owner/repo GITHUB_RUN_ID: 1399372237 - name: Upload coverage reports to Codecov diff --git a/tests/test.py b/tests/test.py index f3276a48..31dd4220 100644 --- a/tests/test.py +++ b/tests/test.py @@ -877,7 +877,11 @@ def test_ci_gitlab(self): "Skip GitHub Actions CI test", ) def test_ci_github(self): - self.set_env(HOME="/") + self.set_env( + HOME="/", + CODECOV_TOKEN="token", + CODECOV_NAME="name", + ) self.fake_report() res = self.run_cli() self.assertEqual(res["query"]["service"], "github-actions") From ce8bec8ccc53187346736ccb65cdadc2d309c78c Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Sat, 13 Jun 2020 11:58:00 -0400 Subject: [PATCH 19/25] Try now --- tests/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test.py b/tests/test.py index 31dd4220..d8af3de2 100644 --- a/tests/test.py +++ b/tests/test.py @@ -886,8 +886,8 @@ def test_ci_github(self): res = self.run_cli() self.assertEqual(res["query"]["service"], "github-actions") self.assertEqual(res["query"]["commit"], os.getenv("GITHUB_SHA")) - self.assertEqual(res["query"]["build"], "1399372237") - self.assertEqual(res["query"]["slug"], "owner/repo") + self.assertEqual(res["query"]["build"], os.getenv("GITHUB_RUN_ID")) + self.assertEqual(res["query"]["slug"], os.getenv("GITHUB_REPOSITORY")) self.assertEqual(res["codecov"].token, "token") self.assertEqual(res["codecov"].name, "name") From 62e7f4bad56996b8b56971d324b1b5f2b49ca363 Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Sat, 13 Jun 2020 11:58:49 -0400 Subject: [PATCH 20/25] Cleanup --- .github/workflows/build-test.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 634dbbbb..05b442a9 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -33,9 +33,6 @@ jobs: run: | make reinstall make test - env: - GITHUB_REPOSITORY: owner/repo - GITHUB_RUN_ID: 1399372237 - name: Upload coverage reports to Codecov run: | codecov From c5c377cda20fc3c94c6c7ec28a6bb53dd05a7abf Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Sat, 13 Jun 2020 19:26:06 -0400 Subject: [PATCH 21/25] black --- tests/test.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/test.py b/tests/test.py index d8af3de2..de4af8e8 100644 --- a/tests/test.py +++ b/tests/test.py @@ -878,9 +878,7 @@ def test_ci_gitlab(self): ) def test_ci_github(self): self.set_env( - HOME="/", - CODECOV_TOKEN="token", - CODECOV_NAME="name", + HOME="/", CODECOV_TOKEN="token", CODECOV_NAME="name", ) self.fake_report() res = self.run_cli() From b7f14a0773f55a794b0e0bcb6d465100e9c0ef47 Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Sat, 13 Jun 2020 19:29:26 -0400 Subject: [PATCH 22/25] Use coverage < 5 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4d418234..f27ba0d0 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ packages=["codecov"], include_package_data=True, zip_safe=True, - install_requires=["requests>=2.7.9", "coverage"], + install_requires=["requests>=2.7.9", "coverage<5"], entry_points={"console_scripts": ["codecov=codecov:main"]}, python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", ) From 7f853178cb0b506c220ff2983fae5dd770f3cd84 Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Sat, 13 Jun 2020 19:33:02 -0400 Subject: [PATCH 23/25] Update requirements too --- tests/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/requirements.txt b/tests/requirements.txt index 953f4978..ab2f4a9b 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,4 +1,4 @@ -coverage>=4.4.0 +coverage<5 ddt mock pytest>=4.6.0 From b43768f244fdb06e84abbc0f9e913f0443a728b5 Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Sat, 13 Jun 2020 19:37:58 -0400 Subject: [PATCH 24/25] Run coverage? --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0b0a1ba2..7eae04f4 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ reinstall: python setup.py install test: - py.test tests/test.py + py.test tests/test.py --cov=codecov format: black . --check From 4e2201d9f3c5939aac259a208f56dc9fdd4786ab Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Sat, 13 Jun 2020 19:43:55 -0400 Subject: [PATCH 25/25] Pin to 4.5.4 --- setup.py | 2 +- tests/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index f27ba0d0..60414316 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ packages=["codecov"], include_package_data=True, zip_safe=True, - install_requires=["requests>=2.7.9", "coverage<5"], + install_requires=["requests>=2.7.9", "coverage==4.5.4"], entry_points={"console_scripts": ["codecov=codecov:main"]}, python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", ) diff --git a/tests/requirements.txt b/tests/requirements.txt index ab2f4a9b..b6f891ef 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,4 +1,4 @@ -coverage<5 +coverage==4.5.4 ddt mock pytest>=4.6.0