diff --git a/.travis.yml b/.travis.yml index ebb2e9bc94..5f9bc9597a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,6 +61,16 @@ env: # - python: "3.8" # - python: "3.9" + - name: "Unit Tests, Pack Tests (Python 3.7)" + python: 3.7 + dist: bionic + env: TASK="compilepy3 ci-py37-unit" CACHE_NAME=py37 PYTHON_VERSION=python3.7 COMMAND_THRESHOLD=750 + + - name: "Integration Tests (Python 3.7)" + python: 3.7 + dist: bionic + env: TASK="ci-py37-integration" CACHE_NAME=py37 PYTHON_VERSION=python3.7 COMMAND_THRESHOLD=770 + addons: apt: sources: diff --git a/Makefile b/Makefile index 65ca6204ae..3b83109a87 100644 --- a/Makefile +++ b/Makefile @@ -981,6 +981,31 @@ ci: ci-checks ci-unit ci-integration ci-packs-tests .PHONY: ci-checks ci-checks: .generated-files-check .pylint .flake8 check-requirements check-sdist-requirements .st2client-dependencies-check .st2common-circular-dependencies-check circle-lint-api-spec .rst-check .st2client-install-check check-python-packages +.PHONY: ci-py37-unit +ci-py37-unit: + @echo + @echo "==================== ci-py37-unit ====================" + @echo + NOSE_WITH_TIMER=$(NOSE_WITH_TIMER) tox -e py37-unit -vv + NOSE_WITH_TIMER=$(NOSE_WITH_TIMER) tox -e py37-packs -vv + +.PHONY: ci-py37-unit-nightly +ci-py37-unit-nightly: + @echo + @echo "==================== ci-py37-unit ====================" + @echo + NOSE_WITH_TIMER=$(NOSE_WITH_TIMER) tox -e py37-unit-nightly -vv + +.PHONY: ci-py37-integration +ci-py37-integration: requirements .ci-prepare-integration .ci-py37-integration + +.PHONY: .ci-py37-integration +.ci-py37-integration: + @echo + @echo "==================== ci-py37-integration ====================" + @echo + NOSE_WITH_TIMER=$(NOSE_WITH_TIMER) tox -e py37-integration -vv + .PHONY: .rst-check .rst-check: @echo diff --git a/fixed-requirements.txt b/fixed-requirements.txt index a98a90dc34..11c633e28d 100644 --- a/fixed-requirements.txt +++ b/fixed-requirements.txt @@ -7,9 +7,9 @@ chardet<3.1.0 # NOTE: 2.0 version breaks pymongo work with hosts dnspython>=1.16.0,<2.0.0 cryptography==3.3.2 -# Note: 0.20.0 removed select.poll() on which some of our code and libraries we -# depend on rely -eventlet==0.25.1 +# Bump eventlet 0.27.0 to support >=Python3.7 threading when monkeypatching. +# see https://github.com/eventlet/eventlet/pull/611 for details. +eventlet==0.27.0 flex==6.14.0 gitpython==2.1.15 # Note: greenlet is used by eventlet diff --git a/requirements.txt b/requirements.txt index 2b5aa2436c..67ffe80dae 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,7 +13,7 @@ bcrypt==3.1.7 chardet<3.1.0 cryptography==3.3.2 dnspython<2.0.0,>=1.16.0 -eventlet==0.25.1 +eventlet==0.27.0 flex==6.14.0 git+https://github.com/StackStorm/logshipper.git@stackstorm_patched#egg=logshipper git+https://github.com/StackStorm/orquesta.git@v1.3.0#egg=orquesta diff --git a/scripts/travis/install-requirements.sh b/scripts/travis/install-requirements.sh index 31d61de35f..50745324bf 100755 --- a/scripts/travis/install-requirements.sh +++ b/scripts/travis/install-requirements.sh @@ -4,7 +4,7 @@ # virtualenv prepartion is different for python3, so we want all py3 targets here. # We use a glob instead of listing TASKs so TASK reorganization doesn't require so many changes. -if [[ " ${TASK}" = *' ci-py3-'* ]]; then +if [[ " ${TASK}" = *' ci-py3-'* || " ${TASK}" = *' ci-py37-'* ]]; then pip install "tox==3.8.6" # NOTE: The makefile only checks to see if the activate script is present. @@ -53,6 +53,14 @@ if [[ " ${TASK}" = *' ci-py3-'* ]]; then if [[ " ${TASK} " = *' ci-py3-integration '* ]]; then tox -e py36-integration --notest fi + + if [[ " ${TASK} " = *' ci-py37-unit '* ]]; then + tox -e py37-unit --notest + fi + + if [[ " ${TASK} " = *' ci-py37-integration '* ]]; then + tox -e py37-integration --notest + fi else make requirements fi diff --git a/st2actions/requirements.txt b/st2actions/requirements.txt deleted file mode 100755 index 2ef4e057a8..0000000000 --- a/st2actions/requirements.txt +++ /dev/null @@ -1,23 +0,0 @@ -# Don't edit this file. It's generated automatically! -# If you want to update global dependencies, modify fixed-requirements.txt -# and then run 'make requirements' to update requirements.txt for all -# components. -# If you want to update depdencies for a single component, modify the -# in-requirements.txt for that component and then run 'make requirements' to -# update the component requirements.txt -apscheduler==3.6.3 -chardet<3.1.0 -eventlet==0.25.1 -git+https://github.com/StackStorm/logshipper.git@stackstorm_patched#egg=logshipper -gitpython==2.1.15 -jinja2==2.10.3 -kombu==4.6.6 -lockfile==0.12.2 -oslo.config<1.13,>=1.12.1 -oslo.utils<5.0,>=4.0.0 -pyinotify==0.9.6 ; platform_system == "Linux" -python-dateutil==2.8.0 -python-json-logger -pyyaml==5.1.2 -requests[security]==2.23.0 -six==1.13.0 diff --git a/st2api/requirements.txt b/st2api/requirements.txt index e9f8dca18f..1052dd860c 100644 --- a/st2api/requirements.txt +++ b/st2api/requirements.txt @@ -5,7 +5,7 @@ # If you want to update depdencies for a single component, modify the # in-requirements.txt for that component and then run 'make requirements' to # update the component requirements.txt -eventlet==0.25.1 +eventlet==0.27.0 gunicorn==19.9.0 jsonschema==2.6.0 kombu==4.6.6 diff --git a/st2auth/requirements.txt b/st2auth/requirements.txt index 838f0f9918..9b6ce540e2 100644 --- a/st2auth/requirements.txt +++ b/st2auth/requirements.txt @@ -6,7 +6,7 @@ # in-requirements.txt for that component and then run 'make requirements' to # update the component requirements.txt bcrypt==3.1.7 -eventlet==0.25.1 +eventlet==0.27.0 git+https://github.com/StackStorm/st2-auth-backend-flat-file.git@master#egg=st2-auth-backend-flat-file git+https://github.com/StackStorm/st2-auth-ldap.git@master#egg=st2-auth-ldap gunicorn==19.9.0 diff --git a/st2common/requirements.txt b/st2common/requirements.txt index c3ee24e5f3..e0b0d42cd0 100644 --- a/st2common/requirements.txt +++ b/st2common/requirements.txt @@ -10,7 +10,7 @@ apscheduler==3.6.3 chardet<3.1.0 cryptography==3.3.2 dnspython<2.0.0,>=1.16.0 -eventlet==0.25.1 +eventlet==0.27.0 flex==6.14.0 git+https://github.com/StackStorm/orquesta.git@v1.3.0#egg=orquesta git+https://github.com/StackStorm/st2-rbac-backend.git@master#egg=st2-rbac-backend diff --git a/st2exporter/requirements.txt b/st2exporter/requirements.txt index 21cb97016f..e733bfe6b5 100644 --- a/st2exporter/requirements.txt +++ b/st2exporter/requirements.txt @@ -5,7 +5,7 @@ # If you want to update depdencies for a single component, modify the # in-requirements.txt for that component and then run 'make requirements' to # update the component requirements.txt -eventlet==0.25.1 +eventlet==0.27.0 kombu==4.6.6 oslo.config<1.13,>=1.12.1 six==1.13.0 diff --git a/st2reactor/requirements.txt b/st2reactor/requirements.txt index 3da786fd47..e91c971d65 100644 --- a/st2reactor/requirements.txt +++ b/st2reactor/requirements.txt @@ -6,7 +6,7 @@ # in-requirements.txt for that component and then run 'make requirements' to # update the component requirements.txt apscheduler==3.6.3 -eventlet==0.25.1 +eventlet==0.27.0 jsonpath-rw==1.4.0 jsonschema==2.6.0 kombu==4.6.6 diff --git a/st2stream/requirements.txt b/st2stream/requirements.txt index fe3cbd71d7..077b902477 100644 --- a/st2stream/requirements.txt +++ b/st2stream/requirements.txt @@ -5,7 +5,7 @@ # If you want to update depdencies for a single component, modify the # in-requirements.txt for that component and then run 'make requirements' to # update the component requirements.txt -eventlet==0.25.1 +eventlet==0.27.0 gunicorn==19.9.0 jsonschema==2.6.0 kombu==4.6.6 diff --git a/tox.ini b/tox.ini index 451ceee8e1..f2a4606d7f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py36-unit,py36-integration +envlist = py36-unit,py36-integration,py37-unit,py37-integration skipsdist = true skip_missing_interpreters=true @@ -71,7 +71,81 @@ commands = [testenv:py36-integration] basepython = python3.6 -setenv = PYTHONPATH = {toxinidir}/external:{toxinidir}/st2common:{toxinidir}/st2auth:{toxinidir}/st2api:{toxinidir}/st2actions:{toxinidir}/st2exporter:{toxinidir}/st2reactor:{toxinidir}/st2tests:{toxinidir}/contrib/runners/action_chain_runner:{toxinidir}/contrib/runners/local_runner:{toxinidir}/contrib/runners/python_runner:{toxinidir}/contrib/runners/http_runner:{toxinidir}/contrib/runners/noop_runner:{toxinidir}/contrib/runners/announcement_runner:{toxinidir}/contrib/runners/remote_runner:{toxinidir}/contrib/runners/remote_runner:{toxinidir}/contrib/runners/orquesta_runner:{toxinidir}/contrib/runners/inquirer_runner:{toxinidir}/contrib/runners/http_runner:{toxinidir}/contrib/runners/winrm_runner +setenv = PYTHONPATH = {toxinidir}/external:{toxinidir}/st2common:{toxinidir}/st2auth:{toxinidir}/st2api:{toxinidir}/st2actions:{toxinidir}/st2exporter:{toxinidir}/st2reactor:{toxinidir}/st2tests:{toxinidir}/contrib/runners/action_chain_runner:{toxinidir}/contrib/runners/local_runner:{toxinidir}/contrib/runners/python_runner:{toxinidir}/contrib/runners/http_runner:{toxinidir}/contrib/runners/noop_runner:{toxinidir}/contrib/runners/announcement_runner:{toxinidir}/contrib/runners/remote_runner:{toxinidir}/contrib/runners/remote_runner:{toxinidir}/contrib/runners/orquesta_runner:{toxinidir}/contrib/runners/inquirer_runner:{toxinidir}/contrib/runners/http_runner:{toxinidir}/contrib/runners/winrm_runner + VIRTUALENV_DIR = {envdir} +passenv = NOSE_WITH_TIMER TRAVIS +install_command = pip install -U --force-reinstall {opts} {packages} +deps = virtualenv + -r{toxinidir}/requirements.txt + -e{toxinidir}/st2client + -e{toxinidir}/st2common +commands = + nosetests --rednose --immediate -sv st2actions/tests/integration/ + nosetests --rednose --immediate -sv st2api/tests/integration/ + nosetests --rednose --immediate -sv st2common/tests/integration/ + nosetests --rednose --immediate -sv st2debug/tests/integration/ + nosetests --rednose --immediate -sv st2exporter/tests/integration/ + nosetests --rednose --immediate -sv st2reactor/tests/integration/ + nosetests --rednose --immediate -sv contrib/runners/action_chain_runner/tests/integration/ + nosetests --rednose --immediate -sv contrib/runners/local_runner/tests/integration/ + nosetests --rednose --immediate -sv contrib/runners/orquesta_runner/tests/integration/ + nosetests --rednose --immediate -sv st2tests/integration/orquesta/ + nosetests --rednose --immediate -sv contrib/runners/python_runner/tests/integration/ + +# Python 3.7 tasks +[testenv:py37-unit] +basepython = python3.7 +setenv = PYTHONPATH = {toxinidir}/external:{toxinidir}/st2common:{toxinidir}/st2api:{toxinidir}/st2actions:{toxinidir}/st2exporter:{toxinidir}/st2reactor:{toxinidir}/st2tests:{toxinidir}/contrib/runners/action_chain_runner:{toxinidir}/contrib/runners/local_runner:{toxinidir}/contrib/runners/python_runner:{toxinidir}/contrib/runners/http_runner:{toxinidir}/contrib/runners/noop_runner:{toxinidir}/contrib/runners/announcement_runner:{toxinidir}/contrib/runners/remote_runner:{toxinidir}/contrib/runners/remote_runner:{toxinidir}/contrib/runners/orquesta_runner:{toxinidir}/contrib/runners/inquirer_runner:{toxinidir}/contrib/runners/http_runner:{toxinidir}/contrib/runners/winrm_runner + VIRTUALENV_DIR = {envdir} +passenv = NOSE_WITH_TIMER TRAVIS +install_command = pip install -U --force-reinstall {opts} {packages} +deps = virtualenv + -r{toxinidir}/requirements.txt + -e{toxinidir}/st2client + -e{toxinidir}/st2common +commands = + nosetests --rednose --immediate -sv st2actions/tests/unit/ + nosetests --rednose --immediate -sv st2auth/tests/unit/ + nosetests --rednose --immediate -sv st2api/tests/unit/controllers/v1/ + nosetests --rednose --immediate -sv st2api/tests/unit/controllers/exp/ + nosetests --rednose --immediate -sv st2common/tests/unit/ + nosetests --rednose --immediate -sv st2client/tests/unit/ + nosetests --rednose --immediate -sv st2debug/tests/unit/ + nosetests --rednose --immediate -sv st2exporter/tests/unit/ + nosetests --rednose --immediate -sv st2reactor/tests/unit/ + nosetests --rednose --immediate -sv st2stream/tests/unit/ + nosetests --rednose --immediate -sv contrib/runners/action_chain_runner/tests/unit/ + nosetests --rednose --immediate -sv contrib/runners/inquirer_runner/tests/unit/ + nosetests --rednose --immediate -sv contrib/runners/announcement_runner/tests/unit/ + nosetests --rednose --immediate -sv contrib/runners/http_runner/tests/unit/ + nosetests --rednose --immediate -sv contrib/runners/noop_runner/tests/unit/ + nosetests --rednose --immediate -sv contrib/runners/local_runner/tests/unit/ + nosetests --rednose --immediate -sv contrib/runners/orquesta_runner/tests/unit/ + nosetests --rednose --immediate -sv contrib/runners/python_runner/tests/unit/ + nosetests --rednose --immediate -sv contrib/runners/winrm_runner/tests/unit/ + +[testenv:py37-packs] +basepython = python3.7 +setenv = PYTHONPATH = {toxinidir}/external:{toxinidir}/st2common:{toxinidir}/st2api:{toxinidir}/st2actions:{toxinidir}/st2exporter:{toxinidir}/st2reactor:{toxinidir}/st2tests:{toxinidir}/contrib/runners/action_chain_runner:{toxinidir}/contrib/runners/local_runner:{toxinidir}/contrib/runners/python_runner:{toxinidir}/contrib/runners/http_runner:{toxinidir}/contrib/runners/noop_runner:{toxinidir}/contrib/runners/announcement_runner:{toxinidir}/contrib/runners/remote_runner:{toxinidir}/contrib/runners/remote_runner:{toxinidir}/contrib/runners/orquesta_runner:{toxinidir}/contrib/runners/inquirer_runner:{toxinidir}/contrib/runners/http_runner:{toxinidir}/contrib/runners/winrm_runner + VIRTUALENV_DIR = {envdir} +passenv = NOSE_WITH_TIMER TRAVIS +install_command = pip install -U --force-reinstall {opts} {packages} +deps = virtualenv + -r{toxinidir}/requirements.txt + -e{toxinidir}/st2client + -e{toxinidir}/st2common +commands = + st2-run-pack-tests -c -t -x -p contrib/packs + st2-run-pack-tests -c -t -x -p contrib/core + st2-run-pack-tests -c -t -x -p contrib/default + st2-run-pack-tests -c -t -x -p contrib/chatops + st2-run-pack-tests -c -t -x -p contrib/examples + st2-run-pack-tests -c -t -x -p contrib/linux + st2-run-pack-tests -c -t -x -p contrib/hello_st2 + +[testenv:py37-integration] +basepython = python3.7 +setenv = PYTHONPATH = {toxinidir}/external:{toxinidir}/st2common:{toxinidir}/st2auth:{toxinidir}/st2api:{toxinidir}/st2actions:{toxinidir}/st2exporter:{toxinidir}/st2reactor:{toxinidir}/st2tests:{toxinidir}/contrib/runners/action_chain_runner:{toxinidir}/contrib/runners/local_runner:{toxinidir}/contrib/runners/python_runner:{toxinidir}/contrib/runners/http_runner:{toxinidir}/contrib/runners/noop_runner:{toxinidir}/contrib/runners/announcement_runner:{toxinidir}/contrib/runners/remote_runner:{toxinidir}/contrib/runners/remote_runner:{toxinidir}/contrib/runners/orquesta_runner:{toxinidir}/contrib/runners/inquirer_runner:{toxinidir}/contrib/runners/http_runner:{toxinidir}/contrib/runners/winrm_runner VIRTUALENV_DIR = {envdir} passenv = NOSE_WITH_TIMER TRAVIS ST2_CI install_command = pip install -U --force-reinstall {opts} {packages}