From 597146b136216fb642f8dad2be74552d989584a6 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Sat, 21 Aug 2021 09:04:44 -0400 Subject: [PATCH 01/15] submit coverage to coveralls --- .github/workflows/main.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2a8103924..101a56982 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -61,6 +61,12 @@ jobs: env: HOME: /tmp run: python -m unittest tests/unit/test_conf.py + - name: submit coverage report + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.github_token }} + flag-name: tests-unit-${{ matrix.os }} + parallel: true tests-integration: name: "tests / integration" @@ -99,6 +105,16 @@ jobs: - run: pip install tox - run: tox -e ${{ matrix.test }} + coverage: + needs: ["tests-unit", "tests-integration"] + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.github_token }} + parallel-finished: true + build: needs: ["lint", "tests-unit", "tests-integration"] name: "build / binary" From ea485778644f087047e9ffa35f287825aca0b6e4 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Sat, 21 Aug 2021 09:15:20 -0400 Subject: [PATCH 02/15] github workflow syntax fix --- .github/workflows/main.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 101a56982..e3808856a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -61,12 +61,12 @@ jobs: env: HOME: /tmp run: python -m unittest tests/unit/test_conf.py - - name: submit coverage report - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.github_token }} - flag-name: tests-unit-${{ matrix.os }} - parallel: true + - name: submit coverage report + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.github_token }} + flag-name: tests-unit-${{ matrix.os }} + parallel: true tests-integration: name: "tests / integration" @@ -109,11 +109,11 @@ jobs: needs: ["tests-unit", "tests-integration"] runs-on: ubuntu-latest steps: - - name: Coveralls Finished - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.github_token }} - parallel-finished: true + - name: Coveralls Finished + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.github_token }} + parallel-finished: true build: needs: ["lint", "tests-unit", "tests-integration"] From 66da8b164f85f6a3be9833f7c40f631ea89d6b86 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Sat, 21 Aug 2021 09:28:20 -0400 Subject: [PATCH 03/15] try AndreMiras/coveralls-python-action action --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e3808856a..2a31272ce 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -62,7 +62,7 @@ jobs: HOME: /tmp run: python -m unittest tests/unit/test_conf.py - name: submit coverage report - uses: coverallsapp/github-action@master + uses: AndreMiras/coveralls-python-action@master with: github-token: ${{ secrets.github_token }} flag-name: tests-unit-${{ matrix.os }} @@ -110,7 +110,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Coveralls Finished - uses: coverallsapp/github-action@master + uses: AndreMiras/coveralls-python-action@master with: github-token: ${{ secrets.github_token }} parallel-finished: true From 8329e649b08b116485bab559890fe2da645088fa Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Sat, 21 Aug 2021 09:41:16 -0400 Subject: [PATCH 04/15] try python coveralls package insead of github action --- .github/workflows/main.yml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2a31272ce..f9e344e8e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -62,11 +62,13 @@ jobs: HOME: /tmp run: python -m unittest tests/unit/test_conf.py - name: submit coverage report - uses: AndreMiras/coveralls-python-action@master - with: - github-token: ${{ secrets.github_token }} - flag-name: tests-unit-${{ matrix.os }} - parallel: true + env: + GITHUB_TOKEN: ${{ secrets.github_token }} + COVERALLS_FLAG_NAME: tests-unit-${{ runner.os }} + COVERALLS_PARALLEL: true + run: | + pip install coveralls + coveralls --service=github tests-integration: name: "tests / integration" @@ -109,11 +111,12 @@ jobs: needs: ["tests-unit", "tests-integration"] runs-on: ubuntu-latest steps: - - name: Coveralls Finished - uses: AndreMiras/coveralls-python-action@master - with: - github-token: ${{ secrets.github_token }} - parallel-finished: true + - name: finalize coverage report submission + env: + GITHUB_TOKEN: ${{ secrets.github_token }} + run: | + pip install coveralls + coveralls --service=github --finish build: needs: ["lint", "tests-unit", "tests-integration"] From dc8d5a39eadf8d73e361b3525502a91e45c2a67b Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Sat, 21 Aug 2021 09:42:18 -0400 Subject: [PATCH 05/15] fix spaces --- .github/workflows/main.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f9e344e8e..e9940ced6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -62,12 +62,12 @@ jobs: HOME: /tmp run: python -m unittest tests/unit/test_conf.py - name: submit coverage report - env: + env: GITHUB_TOKEN: ${{ secrets.github_token }} - COVERALLS_FLAG_NAME: tests-unit-${{ runner.os }} + COVERALLS_FLAG_NAME: tests-unit-${{ runner.os }} COVERALLS_PARALLEL: true run: | - pip install coveralls + pip install coveralls coveralls --service=github tests-integration: @@ -112,10 +112,10 @@ jobs: runs-on: ubuntu-latest steps: - name: finalize coverage report submission - env: + env: GITHUB_TOKEN: ${{ secrets.github_token }} run: | - pip install coveralls + pip install coveralls coveralls --service=github --finish build: From 1136ac70e808a2852bc28ea438c2a4728afacd71 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Sat, 21 Aug 2021 10:26:55 -0400 Subject: [PATCH 06/15] fix makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d9e9f5461..d3349e525 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ test-unit: python -m unittest discover tests.unit test-unit-coverage: - coverage run -p --source=lbry -m unittest discover -vv tests.unit + coverage run --source=lbry -m unittest discover -vv tests.unit test-integration: tox From 8d93594771ca56783ab86532004ee91b1df962eb Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Sat, 21 Aug 2021 10:51:37 -0400 Subject: [PATCH 07/15] coverage on win and mac --- .github/workflows/main.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e9940ced6..22cba5bef 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -60,7 +60,7 @@ jobs: - if: startsWith(runner.os, 'linux') != true env: HOME: /tmp - run: python -m unittest tests/unit/test_conf.py + run: coverage run --source=lbry -m unittest tests/unit/test_conf.py - name: submit coverage report env: GITHUB_TOKEN: ${{ secrets.github_token }} diff --git a/README.md b/README.md index 57fa8b920..a2ccf3425 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# LBRY LBRY SDK [![Gitlab CI Badge](https://ci.lbry.tech/lbry/lbry-sdk/badges/master/pipeline.svg)](https://ci.lbry.tech/lbry/lbry-sdk) +# LBRY LBRY SDK [![ci](https://github.com/lbryio/lbry-sdk/actions/workflows/main.yml/badge.svg)](https://github.com/lbryio/lbry-sdk/actions/workflows/main.yml) [![coverage](https://coveralls.io/repos/github/lbryio/lbry-sdk/badge.svg)](https://coveralls.io/github/lbryio/lbry-sdk) LBRY is a decentralized peer-to-peer protocol for publishing and accessing digital content. It utilizes the [LBRY blockchain](https://github.com/lbryio/lbrycrd) as a global namespace and database of digital content. Blockchain entries contain searchable content metadata, identities, rights and access rules. LBRY also provides a data network that consists of peers (seeders) uploading and downloading data from other peers, possibly in exchange for payments, as well as a distributed hash table used by peers to discover other peers. From 0974afd26dd0985a9d4cd7d8b0d19490747b486c Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Sat, 21 Aug 2021 12:06:45 -0400 Subject: [PATCH 08/15] guess coverralls service --- .github/workflows/main.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 22cba5bef..ee502c484 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -68,7 +68,7 @@ jobs: COVERALLS_PARALLEL: true run: | pip install coveralls - coveralls --service=github + coveralls -v tests-integration: name: "tests / integration" @@ -108,7 +108,8 @@ jobs: - run: tox -e ${{ matrix.test }} coverage: - needs: ["tests-unit", "tests-integration"] + #needs: ["tests-unit", "tests-integration"] + needs: ["tests-unit"] runs-on: ubuntu-latest steps: - name: finalize coverage report submission @@ -116,7 +117,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.github_token }} run: | pip install coveralls - coveralls --service=github --finish + coveralls -v --finish build: needs: ["lint", "tests-unit", "tests-integration"] From 1e541d02256d20eb584aff27ee09e0b63c9edb3c Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Sat, 21 Aug 2021 13:52:33 -0400 Subject: [PATCH 09/15] explicit coverralls service --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ee502c484..716457b6f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -68,7 +68,7 @@ jobs: COVERALLS_PARALLEL: true run: | pip install coveralls - coveralls -v + coveralls -v --service=github tests-integration: name: "tests / integration" @@ -117,7 +117,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.github_token }} run: | pip install coveralls - coveralls -v --finish + coveralls -v --service=github --finish build: needs: ["lint", "tests-unit", "tests-integration"] From e49cfb1d2b604731bc444438e0156df05987350b Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Sat, 21 Aug 2021 14:44:59 -0400 Subject: [PATCH 10/15] another attempt --- .github/workflows/main.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 716457b6f..c0c2fc5c4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,6 +48,10 @@ jobs: path: ${{ steps.pip-cache.outputs.dir }} key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }} restore-keys: ${{ runner.os }}-pip- + - id: os-name + uses: ASzc/change-string-case-action@v1 + with: + string: ${{ runner.os }} - run: pip install --user --upgrade pip wheel - if: startsWith(runner.os, 'linux') run: pip install -e .[torrent,test] @@ -63,12 +67,12 @@ jobs: run: coverage run --source=lbry -m unittest tests/unit/test_conf.py - name: submit coverage report env: - GITHUB_TOKEN: ${{ secrets.github_token }} - COVERALLS_FLAG_NAME: tests-unit-${{ runner.os }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_FLAG_NAME: tests-unit-${{ steps.os-name.outputs.lowercase }} COVERALLS_PARALLEL: true run: | pip install coveralls - coveralls -v --service=github + coveralls --service=github tests-integration: name: "tests / integration" @@ -114,10 +118,10 @@ jobs: steps: - name: finalize coverage report submission env: - GITHUB_TOKEN: ${{ secrets.github_token }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | pip install coveralls - coveralls -v --service=github --finish + coveralls --service=github --finish build: needs: ["lint", "tests-unit", "tests-integration"] From 5576c21e6711efb7eca494b0c92e1a7dbdd3966f Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Sat, 21 Aug 2021 15:26:14 -0400 Subject: [PATCH 11/15] coverage for integration tests --- .github/workflows/main.yml | 9 +++++++++ tox.ini | 1 + 2 files changed, 10 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c0c2fc5c4..4dd8f72ac 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -110,6 +110,15 @@ jobs: restore-keys: txo-integration-${{ matrix.test }}- - run: pip install tox - run: tox -e ${{ matrix.test }} + - name: submit coverage report + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_FLAG_NAME: tests-integration-${{ steps.os-name.outputs.lowercase }} + COVERALLS_PARALLEL: true + run: | + pip install coveralls + coveralls --service=github + coverage: #needs: ["tests-unit", "tests-integration"] diff --git a/tox.ini b/tox.ini index 0b8b7ff90..f8dbde108 100644 --- a/tox.ini +++ b/tox.ini @@ -13,3 +13,4 @@ commands = blockchain: coverage run -p --source={envsitepackagesdir}/lbry -m unittest discover -vv integration.blockchain {posargs} datanetwork: coverage run -p --source={envsitepackagesdir}/lbry -m unittest discover -vv integration.datanetwork {posargs} other: coverage run -p --source={envsitepackagesdir}/lbry -m unittest discover -vv integration.other {posargs} + coverage combine tests From 7828a79a96a736978d0a9d41a2cffee9160d9943 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Sat, 21 Aug 2021 15:31:50 -0400 Subject: [PATCH 12/15] coverage combine corrected --- .github/workflows/main.yml | 3 +-- tox.ini | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4dd8f72ac..9c3acd06a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -121,8 +121,7 @@ jobs: coverage: - #needs: ["tests-unit", "tests-integration"] - needs: ["tests-unit"] + needs: ["tests-unit", "tests-integration"] runs-on: ubuntu-latest steps: - name: finalize coverage report submission diff --git a/tox.ini b/tox.ini index f8dbde108..10d8c1e6a 100644 --- a/tox.ini +++ b/tox.ini @@ -13,4 +13,4 @@ commands = blockchain: coverage run -p --source={envsitepackagesdir}/lbry -m unittest discover -vv integration.blockchain {posargs} datanetwork: coverage run -p --source={envsitepackagesdir}/lbry -m unittest discover -vv integration.datanetwork {posargs} other: coverage run -p --source={envsitepackagesdir}/lbry -m unittest discover -vv integration.other {posargs} - coverage combine tests + coverage combine From 0085ac534d72a9eb168c66575e696a3cf9622a6a Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Sat, 21 Aug 2021 15:41:06 -0400 Subject: [PATCH 13/15] coverage fix --- .github/workflows/main.yml | 4 ++-- tox.ini | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9c3acd06a..9911ac59f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -108,7 +108,7 @@ jobs: path: ./.tox key: tox-integration-${{ matrix.test }}-${{ hashFiles('setup.py') }} restore-keys: txo-integration-${{ matrix.test }}- - - run: pip install tox + - run: pip install tox coverage coveralls - run: tox -e ${{ matrix.test }} - name: submit coverage report env: @@ -116,7 +116,7 @@ jobs: COVERALLS_FLAG_NAME: tests-integration-${{ steps.os-name.outputs.lowercase }} COVERALLS_PARALLEL: true run: | - pip install coveralls + coverage combine tests coveralls --service=github diff --git a/tox.ini b/tox.ini index 10d8c1e6a..0b8b7ff90 100644 --- a/tox.ini +++ b/tox.ini @@ -13,4 +13,3 @@ commands = blockchain: coverage run -p --source={envsitepackagesdir}/lbry -m unittest discover -vv integration.blockchain {posargs} datanetwork: coverage run -p --source={envsitepackagesdir}/lbry -m unittest discover -vv integration.datanetwork {posargs} other: coverage run -p --source={envsitepackagesdir}/lbry -m unittest discover -vv integration.other {posargs} - coverage combine From 2cdec7298501f69463a3def26f46c692fd478a5b Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Sat, 21 Aug 2021 16:22:01 -0400 Subject: [PATCH 14/15] coveralls fix --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9911ac59f..260c15d3f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -113,7 +113,7 @@ jobs: - name: submit coverage report env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERALLS_FLAG_NAME: tests-integration-${{ steps.os-name.outputs.lowercase }} + COVERALLS_FLAG_NAME: tests-integration COVERALLS_PARALLEL: true run: | coverage combine tests From 8e27297a810c34fd854c3b2717176983420ac7a8 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Sat, 21 Aug 2021 16:47:17 -0400 Subject: [PATCH 15/15] coveralls flag name fix --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 260c15d3f..f1a8ff4ab 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -113,7 +113,7 @@ jobs: - name: submit coverage report env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERALLS_FLAG_NAME: tests-integration + COVERALLS_FLAG_NAME: tests-integration-${{ matrix.test }} COVERALLS_PARALLEL: true run: | coverage combine tests