diff --git a/.github/workflows/python_next_test.yml b/.github/workflows/python_next_test.yml new file mode 100644 index 00000000..755fdabe --- /dev/null +++ b/.github/workflows/python_next_test.yml @@ -0,0 +1,67 @@ +name: Test Python future version + +on: + workflow_dispatch: # Manual trigger. + schedule: + - cron: '1 3 * * 1-5' # Every Monday to Friday at 03:01 AM. + push: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + container: + image: ghcr.io/pvital/pvital-python:latest + services: + postgres: + image: public.ecr.aws/docker/library/postgres:16.10-trixie + env: + POSTGRES_USER: root + POSTGRES_PASSWORD: passw0rd + POSTGRES_DB: instana_test_db + mariadb: + image: public.ecr.aws/docker/library/mariadb:11.3.2 + env: + MYSQL_ROOT_PASSWORD: passw0rd + MYSQL_DATABASE: instana_test_db + redis: + image: public.ecr.aws/docker/library/redis:7.2.4-bookworm + rabbitmq: + image: public.ecr.aws/docker/library/rabbitmq:3.13.0 + mongo: + image: public.ecr.aws/docker/library/mongo:7.0.6 + gcloud-pubsub: + image: quay.io/thekevjames/gcloud-pubsub-emulator:latest + env: + PUBSUB_EMULATOR_HOST: 0.0.0.0:8681 + PUBSUB_PROJECT1: test-project,test-topic + steps: + - uses: actions/checkout@v5 + #- name: Set up Python 3.15.0 + # uses: actions/setup-python@v5 + # with: + # python-version: 3.15.0-alpha.7 + - name: Display Python version + run: python -c "import sys; print(sys.version)" + - name: Install Python dependencies + run: | + cp -a /root/base/venv ./venv + . venv/bin/activate + python -m pip install --upgrade pip + pip install -r requirements.txt + #- name: Install Python test dependencies + # run: | + # pip install -r tests/requirements-pre315.txt + - name: Test with pytest + run: | + . venv/bin/activate + pytest -v --junitxml=output_file.xml tests | tee pytest.log + - uses: actions/upload-artifact@v4 + with: + name: python_next_test_results + path: | + output_file.xml + pytest.log + overwrite: true + diff --git a/pytest.ini b/pytest.ini index 64b91610..70588eaf 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,4 +1,5 @@ [pytest] +timeout = 60 log_cli = 1 log_cli_level = WARN log_cli_format = %(asctime)s %(levelname)s %(message)s @@ -10,3 +11,4 @@ testpaths = tests_autowrapt markers = original: mark test to use the original method instead of the mocked ones under `conftest.py` + diff --git a/tests/clients/test_google-cloud-pubsub.py b/tests/clients/test_google-cloud-pubsub.py index 98168bda..5ce1d1c5 100644 --- a/tests/clients/test_google-cloud-pubsub.py +++ b/tests/clients/test_google-cloud-pubsub.py @@ -21,6 +21,7 @@ os.environ["PUBSUB_EMULATOR_HOST"] = "localhost:8681" +@pytest.mark.timeout(30) class TestPubSubPublish(_TraceContextMixin): publisher = PublisherClient() @@ -111,6 +112,7 @@ def __call__(self, message) -> None: self.calls += 1 +@pytest.mark.timeout(30) class TestPubSubSubscribe(_TraceContextMixin): @classmethod def setup_class(cls) -> None: diff --git a/tests/conftest.py b/tests/conftest.py index 44088c85..8e87abf3 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -76,15 +76,13 @@ collect_ignore_glob.append("*test_spyne*") -if sys.version_info >= (3, 14): +if sys.version_info >= (3, 15): collect_ignore_glob.extend( [ - # Currently not installable dependencies because of 3.14 incompatibilities + # Currently not installable dependencies because of 3.15 incompatibilities "*test_fastapi*", - # aiohttp-server tests failing due to deprecated methods used - "*test_aiohttp_server*", - # Currently Sanic does not support python >= 3.14 - "*test_sanic*", + # Development version of Python always break logging tests, so we skip then + "*test_logging*", ] ) diff --git a/tests/requirements-minimal.txt b/tests/requirements-minimal.txt index 464adb34..be190a95 100644 --- a/tests/requirements-minimal.txt +++ b/tests/requirements-minimal.txt @@ -1,2 +1,3 @@ coverage>=5.5 pytest>=4.6 +pytest-timeout>=2.4.0 diff --git a/tests/requirements-pre314.txt b/tests/requirements-pre315.txt similarity index 52% rename from tests/requirements-pre314.txt rename to tests/requirements-pre315.txt index 2ad1e026..ad141a85 100644 --- a/tests/requirements-pre314.txt +++ b/tests/requirements-pre315.txt @@ -1,18 +1,20 @@ --r requirements-minimal.txt +# requirements-minimal.txt +-r requirements-minimal.txt +pytest-timeout>=2.4.0 +# setuptools upperbound pinning is temporary and will remain in place until +# packages resolve the failures caused by the pkg_resources deprecation. +setuptools<=81.0.0 +# requirements.txt aioamqp>=0.15.0 aiofiles>=0.5.0 -aiohttp>=3.8.3 +aiohttp>=3.12.14 aio-pika>=9.5.2 boto3>=1.17.74 bottle>=0.12.25 celery>=5.2.7 Django>=4.2.16 -# FastAPI depends on pydantic-core which requires rust to be installed and -# it's not compiling due to python_version restrictions. -# fastapi>=0.115.0; python_version >= "3.13" +# fastapi>=0.115.0 flask>=2.3.2 -# gevent is taking more than 20min to build on 3.14 -# gevent>=23.9.0.post1 grpcio>=1.14.1 google-cloud-pubsub>=2.0.0 google-cloud-storage>=1.24.0 @@ -24,6 +26,7 @@ mysqlclient>=2.0.3 PyMySQL[rsa]>=1.0.2 psycopg2-binary>=2.8.6 pika>=1.2.0 +# protobuf<=6.30.2 pymongo>=3.11.4 pyramid>=2.0.1 pytest-mock>=3.12.0 @@ -31,13 +34,16 @@ pytz>=2024.1 redis>=3.5.3 requests-mock responses<=0.17.0 -# Sanic doesn't support python-3.14 yet -# sanic>=19.9.0 -# sanic-testing>=24.6.0 -starlette>=0.38.2 +sanic>=19.9.0 +sanic-testing>=24.6.0 +spyne>=2.14.0 sqlalchemy>=2.0.0 +starlette>=0.38.2; tornado>=6.4.1 uvicorn>=0.13.4 urllib3>=1.26.5 httpx>=0.27.0 -protobuf<=6.30.2 +gevent>=23.9.0.post1 +confluent-kafka>=2.0.0 +kafka-python-ng>=2.0.0 +