diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aca64f3509c..b8f996e30db 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,6 +20,8 @@ on: jobs: build: runs-on: ${{ matrix.os }} + env: + PYTEST_ADDOPTS: "-vv" strategy: fail-fast: false @@ -140,12 +142,13 @@ jobs: - name: Prepare coverage token if: success() && !matrix.skip_coverage && ( github.repository == 'pytest-dev/pytest' || github.event_name == 'pull_request' ) run: | - python scripts/append_codecov_token.py + python scripts/append-codecov-token.py - name: Combine coverage if: success() && !matrix.skip_coverage run: | python -m coverage combine + python -m coverage report --show-missing python -m coverage xml - name: Codecov upload @@ -154,7 +157,6 @@ jobs: with: token: ${{ secrets.codecov }} file: ./coverage.xml - flags: ${{ runner.os }} fail_ci_if_error: false name: ${{ matrix.name }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d813cf07a80..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,92 +0,0 @@ -language: python -dist: xenial -python: '3.7' -cache: false - -env: - global: - - PYTEST_ADDOPTS=-vv - -# setuptools-scm needs all tags in order to obtain a proper version -git: - depth: false - -install: - - python -m pip install --upgrade --pre tox - -jobs: - include: - # OSX tests - first (in test stage), since they are the slower ones. - # Coverage for: - # - osx - # - verbose=1 - - os: osx - osx_image: xcode10.1 - language: generic - env: TOXENV=py37-xdist PYTEST_COVERAGE=1 PYTEST_ADDOPTS=-v - before_install: - - which python3 - - python3 -V - - ln -sfn "$(which python3)" /usr/local/bin/python - - python -V - - test $(python -c 'import sys; print("%d%d" % sys.version_info[0:2])') = 37 - - # Full run of latest supported version, without xdist. - # Coverage for: - # - pytester's LsofFdLeakChecker - # - TestArgComplete (linux only) - # - numpy - # - old attrs - # - verbose=0 - # - test_sys_breakpoint_interception (via pexpect). - - env: TOXENV=py37-lsof-numpy-oldattrs-pexpect-twisted PYTEST_COVERAGE=1 PYTEST_ADDOPTS= - python: '3.7' - - # Coverage for Python 3.5.{0,1} specific code, mostly typing related. - - env: TOXENV=py35 PYTEST_COVERAGE=1 PYTEST_ADDOPTS="-k test_raises_cyclic_reference" - python: '3.5.1' - dist: trusty - - - env: TOXENV=linting,docs,doctesting PYTEST_COVERAGE=1 - cache: - directories: - - $HOME/.cache/pre-commit - -before_script: - - | - # Do not (re-)upload coverage with cron runs. - if [[ "$TRAVIS_EVENT_TYPE" = cron ]]; then - PYTEST_COVERAGE=0 - fi - - | - if [[ "$PYTEST_COVERAGE" = 1 ]]; then - export COVERAGE_FILE="$PWD/.coverage" - export COVERAGE_PROCESS_START="$PWD/.coveragerc" - export _PYTEST_TOX_COVERAGE_RUN="coverage run -m" - export _PYTEST_TOX_EXTRA_DEP=coverage-enable-subprocess - fi - -script: tox - -after_success: - - | - if [[ "$PYTEST_COVERAGE" = 1 ]]; then - env CODECOV_NAME="$TOXENV-$TRAVIS_OS_NAME" scripts/report-coverage.sh - fi - -notifications: - irc: - channels: - - "chat.freenode.net#pytest" - on_success: change - on_failure: change - skip_join: true - email: - - pytest-commit@python.org - -branches: - only: - - master - - features - - 4.6-maintenance - - /^\d+(\.\d+)+$/ diff --git a/README.rst b/README.rst index 3235dd4c294..16fcc46d5a7 100644 --- a/README.rst +++ b/README.rst @@ -19,11 +19,8 @@ :target: https://codecov.io/gh/pytest-dev/pytest :alt: Code coverage Status -.. image:: https://travis-ci.org/pytest-dev/pytest.svg?branch=master - :target: https://travis-ci.org/pytest-dev/pytest - -.. image:: https://dev.azure.com/pytest-dev/pytest/_apis/build/status/pytest-CI?branchName=master - :target: https://dev.azure.com/pytest-dev/pytest +.. image:: https://github.com/pytest-dev/pytest/workflows/main/badge.svg + :target: https://github.com/pytest-dev/pytest/actions .. image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/psf/black diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index a6d856d9187..00000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,80 +0,0 @@ -trigger: -- master -- features - -variables: - PYTEST_ADDOPTS: "--junitxml=build/test-results/$(tox.env).xml -vv" - PYTEST_COVERAGE: '0' - -jobs: - -- job: 'Test' - pool: - vmImage: "vs2017-win2016" - strategy: - matrix: - # -- pypy3 disabled for now: #5279 -- - # pypy3: - # python.version: 'pypy3' - # tox.env: 'pypy3' - py35-xdist: - python.version: '3.5' - tox.env: 'py35-xdist' - # Coverage for: - # - test_supports_breakpoint_module_global - PYTEST_COVERAGE: '1' - py36-xdist: - python.version: '3.6' - tox.env: 'py36-xdist' - py37: - python.version: '3.7' - tox.env: 'py37-twisted-numpy' - # Coverage for: - # - _py36_windowsconsoleio_workaround (with py36+) - # - test_request_garbage (no xdist) - PYTEST_COVERAGE: '1' - py37-linting/docs/doctesting: - python.version: '3.7' - tox.env: 'linting,docs,doctesting' - py37-pluggymaster-xdist: - python.version: '3.7' - tox.env: 'py37-pluggymaster-xdist' - py38-xdist: - python.version: '3.8' - tox.env: 'py38-xdist' - maxParallel: 10 - - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '$(python.version)' - architecture: 'x64' - - - script: python -m pip install --upgrade pip && python -m pip install tox - displayName: 'Install tox' - - - bash: | - if [[ "$PYTEST_COVERAGE" == "1" ]]; then - export _PYTEST_TOX_COVERAGE_RUN="coverage run -m" - export _PYTEST_TOX_EXTRA_DEP=coverage-enable-subprocess - export COVERAGE_FILE="$PWD/.coverage" - export COVERAGE_PROCESS_START="$PWD/.coveragerc" - fi - python -m tox -e $(tox.env) - displayName: 'Run tests' - - - task: PublishTestResults@2 - inputs: - testResultsFiles: 'build/test-results/$(tox.env).xml' - testRunTitle: '$(tox.env)' - condition: succeededOrFailed() - - - bash: | - if [[ "$PYTEST_COVERAGE" == 1 ]]; then - scripts/report-coverage.sh - fi - env: - CODECOV_NAME: $(tox.env) - CODECOV_TOKEN: $(CODECOV_TOKEN) - displayName: Report and upload coverage - condition: eq(variables['PYTEST_COVERAGE'], '1') diff --git a/scripts/append_codecov_token.py b/scripts/append-codecov-token.py similarity index 100% rename from scripts/append_codecov_token.py rename to scripts/append-codecov-token.py diff --git a/scripts/report-coverage.sh b/scripts/report-coverage.sh deleted file mode 100755 index 165426a119e..00000000000 --- a/scripts/report-coverage.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -x - -if [ -z "$TOXENV" ]; then - python -m pip install coverage -else - # Add last TOXENV to $PATH. - PATH="$PWD/.tox/${TOXENV##*,}/bin:$PATH" -fi - -python -m coverage combine -python -m coverage xml -python -m coverage report -m -# Set --connect-timeout to work around https://github.com/curl/curl/issues/4461 -curl -S -L --connect-timeout 5 --retry 6 -s https://codecov.io/bash -o codecov-upload.sh -bash codecov-upload.sh -Z -X fix -f coverage.xml diff --git a/scripts/retry.cmd b/scripts/retry.cmd deleted file mode 100644 index ac383650857..00000000000 --- a/scripts/retry.cmd +++ /dev/null @@ -1,21 +0,0 @@ -@echo off -rem Source: https://github.com/appveyor/ci/blob/master/scripts/appveyor-retry.cmd -rem initiate the retry number -set retryNumber=0 -set maxRetries=3 - -:RUN -%* -set LastErrorLevel=%ERRORLEVEL% -IF %LastErrorLevel% == 0 GOTO :EOF -set /a retryNumber=%retryNumber%+1 -IF %reTryNumber% == %maxRetries% (GOTO :FAILED) - -:RETRY -set /a retryNumberDisp=%retryNumber%+1 -@echo Command "%*" failed with exit code %LastErrorLevel%. Retrying %retryNumberDisp% of %maxRetries% -GOTO :RUN - -: FAILED -@echo Sorry, we tried running command for %maxRetries% times and all attempts were unsuccessful! -EXIT /B %LastErrorLevel% diff --git a/tox.ini b/tox.ini index 91c50ececf0..4b4317275e0 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,6 @@ isolated_build = True minversion = 3.5.3 distshare = {homedir}/.tox/distshare -# make sure to update environment list in travis.yml and appveyor.yml envlist = linting py35 @@ -22,7 +21,7 @@ commands = {env:_PYTEST_TOX_COVERAGE_RUN:} pytest {posargs:{env:_PYTEST_TOX_DEFAULT_POSARGS:}} coverage: coverage combine coverage: coverage report -m -passenv = USER USERNAME COVERAGE_* TRAVIS PYTEST_ADDOPTS TERM +passenv = USER USERNAME COVERAGE_* PYTEST_ADDOPTS TERM setenv = _PYTEST_TOX_DEFAULT_POSARGS={env:_PYTEST_TOX_POSARGS_LSOF:} {env:_PYTEST_TOX_POSARGS_XDIST:} @@ -167,7 +166,7 @@ filterwarnings = default:Using or importing the ABCs:DeprecationWarning:unittest2.* default:the imp module is deprecated in favour of importlib:DeprecationWarning:nose.* ignore:Module already imported so cannot be rewritten:pytest.PytestWarning - # produced by python3.6/site.py itself (3.6.7 on Travis, could not trigger it with 3.6.8). + # produced by python3.6/site.py itself ignore:.*U.*mode is deprecated:DeprecationWarning:(?!(pytest|_pytest)) # produced by pytest-xdist ignore:.*type argument to addoption.*:DeprecationWarning