diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 523dda61f01..e7ead5cc0d5 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -23,8 +23,8 @@ jobs: - name: Run Pytest with Coverage run: | - coverage run --source=./src/tribler/core -p -m pytest ./src/tribler/core - coverage run --source=./src/tribler/core -p -m pytest ./src/tribler/core/components/tunnel/tests/test_full_session --tunneltests + coverage run --source=./src/tribler/core -p -m pytest ./src/tribler/core --looptime + coverage run --source=./src/tribler/core -p -m pytest ./src/tribler/core/components/tunnel/tests/test_full_session --tunneltests --looptime coverage combine coverage xml diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 9f49f1bd613..a2e519fce90 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -13,6 +13,13 @@ jobs: matrix: python-version: [ '3.8' ] os: [ macos-latest, windows-latest, ubuntu-latest ] + include: + - os: macos-latest + pytest-arguments: --timeout=300 --looptime + - os: windows-latest + pytest-arguments: --timeout=300 + - os: ubuntu-latest + pytest-arguments: --timeout=60 --looptime steps: - uses: actions/checkout@v3 @@ -22,7 +29,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install Libsodium + - name: Install Libsodium (win) if: matrix.os == 'windows-latest' run: | C:\msys64\usr\bin\wget.exe -q https://download.libsodium.org/libsodium/releases/libsodium-1.0.17-msvc.zip @@ -34,21 +41,10 @@ jobs: python -m pip install --upgrade pip pip install -r ./requirements-test.txt - #https://pypi.org/project/pytest-timeout/ - - name: Override PYTEST_TIMEOUT (mac) - if: matrix.os == 'macos-latest' - run: | - echo "PYTEST_TIMEOUT=300" >> $GITHUB_ENV - - - name: Override PYTEST_TIMEOUT (win) - if: matrix.os == 'windows-latest' - run: | - echo "PYTEST_TIMEOUT=300" >> $env:GITHUB_ENV - - name: Run Pytest run: | - pytest ./src/tribler/core + pytest ./src/tribler/core ${{matrix.pytest-arguments}} - name: Run Tunnels Tests run: | - pytest ./src/tribler/core/components/tunnel/tests/test_full_session --tunneltests + pytest ./src/tribler/core/components/tunnel/tests/test_full_session --tunneltests ${{matrix.pytest-arguments}} diff --git a/requirements-test.txt b/requirements-test.txt index 51cd343e9ef..eed40540517 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ -r requirements.txt -pytest==7.1.1 +pytest==7.1.2 pytest-aiohttp==1.0.4 pytest-asyncio==0.18.3 pytest-mock==3.7.0 @@ -9,5 +9,6 @@ pytest-timeout==2.1.0 pytest-freezegun==0.4.2 freezegun==1.2.1 coverage==6.3.2 +looptime==0.2 asynctest==0.13.0 # this library has to be installed to properly work with ipv8 TestBase. \ No newline at end of file