diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9ab0b5498..f274880f6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -60,8 +60,58 @@ jobs: pip install https://github.com/bboe/coveralls-python/archive/github_actions.zip coveralls + tests-integration: + name: "tests / integration" + runs-on: ubuntu-latest + strategy: + matrix: + test: +# - datanetwork + - blockchain +# - other + db: + - sqlite +# - postgres +# services: +# postgres: +# image: postgres:12 +# env: +# POSTGRES_USER: postgres +# POSTGRES_PASSWORD: postgres +# POSTGRES_DB: postgres +# ports: +# - 5432:5432 +# options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-python@v1 + with: + python-version: '3.7' + - if: matrix.test == 'other' + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends ffmpeg + - name: extract pip cache + uses: actions/cache@v2 + with: + path: ./.tox + key: tox-integration-${{ matrix.test }}-${{ matrix.db }}-${{ hashFiles('setup.py') }} + restore-keys: txo-integration-${{ matrix.test }}-${{ matrix.db }}- + - run: pip install tox + - env: + TEST_DB: ${{ matrix.db }} + run: tox -e ${{ matrix.test }} + - env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_PARALLEL: true + name: Submit to coveralls + run: | + pip install https://github.com/bboe/coveralls-python/archive/github_actions.zip + coverage combine tests + coveralls + coveralls-finished: - needs: tests-unit + needs: ["tests-unit", "tests-integration"] runs-on: ubuntu-latest steps: - name: Coveralls Finished @@ -70,48 +120,6 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} parallel-finished: true -# tests-integration: -# name: "tests / integration" -# runs-on: ubuntu-latest -# strategy: -# matrix: -# test: -## - datanetwork -# - blockchain -## - other -# db: -# - sqlite -## - postgres -## services: -## postgres: -## image: postgres:12 -## env: -## POSTGRES_USER: postgres -## POSTGRES_PASSWORD: postgres -## POSTGRES_DB: postgres -## ports: -## - 5432:5432 -## options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 -# steps: -# - uses: actions/checkout@v1 -# - uses: actions/setup-python@v1 -# with: -# python-version: '3.7' -# - if: matrix.test == 'other' -# run: | -# sudo apt-get update -# sudo apt-get install -y --no-install-recommends ffmpeg -# - name: extract pip cache -# uses: actions/cache@v2 -# with: -# path: ./.tox -# key: tox-integration-${{ matrix.test }}-${{ matrix.db }}-${{ hashFiles('setup.py') }} -# restore-keys: txo-integration-${{ matrix.test }}-${{ matrix.db }}- -# - run: pip install tox -# - env: -# TEST_DB: ${{ matrix.db }} -# run: tox -e ${{ matrix.test }} - # build: # needs: ["lint", "tests-unit", "tests-integration"] # name: "build" diff --git a/setup.cfg b/setup.cfg index 6f4ce3be3..60c72b9a9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,10 +1,11 @@ [coverage:run] +source = lbry branch = True -#[coverage:paths] -#source = -# lbry -# .tox/*/lib/python*/site-packages/lbry +[coverage:paths] +source = + lbry + .tox/*/lib/python*/site-packages/lbry [cryptography.*,coincurve.*,pbkdf2] ignore_missing_imports = True diff --git a/tox.ini b/tox.ini index 4b8371e7f..b7150a32f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,17 +1,15 @@ [testenv] deps = coverage - codecov extras = test changedir = {toxinidir}/tests setenv = HOME=/tmp -passenv = * -whitelist_externals = /bin/bash +passenv = + TEST_DB commands = - blockchain: coverage run --source={envsitepackagesdir}/lbry -m unittest -vv integration.blockchain.test_claim_commands.ChannelCommands.test_create_channel_names {posargs} + blockchain: coverage run -p --rcfile={toxinidir}/setup.cfg -m unittest -vv integration.blockchain.test_claim_commands.ChannelCommands.test_create_channel_names {posargs} #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} - codecov -F integration,{envname},{env:TEST_DB}