Skip to content

Commit

Permalink
ci: Add new pipeline to test Python 3.14.0a2.
Browse files Browse the repository at this point in the history
Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
  • Loading branch information
pvital committed Nov 29, 2024
1 parent b8592b4 commit ff05f4c
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 3 deletions.
31 changes: 31 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,34 @@ jobs:
- store-pytest-results
- store-coverage-report

python314:
docker:
- image: public.ecr.aws/docker/library/python:3.14.0a2
- image: public.ecr.aws/docker/library/postgres:16.2-bookworm
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: passw0rd
POSTGRES_DB: instana_test_db
- image: public.ecr.aws/docker/library/mariadb:11.3.2
environment:
MYSQL_ROOT_PASSWORD: passw0rd
MYSQL_DATABASE: instana_test_db
- image: public.ecr.aws/docker/library/redis:7.2.4-bookworm
- image: public.ecr.aws/docker/library/rabbitmq:3.13.0
- image: public.ecr.aws/docker/library/mongo:7.0.6
- image: quay.io/thekevjames/gcloud-pubsub-emulator:latest
environment:
PUBSUB_EMULATOR_HOST: 0.0.0.0:8681
PUBSUB_PROJECT1: test-project,test-topic
working_directory: ~/repo
steps:
- checkout
- pip-install-deps:
requirements: "tests/requirements-pre314.txt"
- run-tests-with-coverage-report
- store-pytest-results
- store-coverage-report

py39cassandra:
docker:
- image: public.ecr.aws/docker/library/python:3.9
Expand Down Expand Up @@ -328,6 +356,7 @@ workflows:
- python311
- python312
- python313
- python314
- py39cassandra
- py39gevent_starlette
- py312aws
Expand All @@ -339,6 +368,8 @@ workflows:
- python311
- python312
- python313
# Uncomment the following when giving real support to 3.14
# - python314
- py39cassandra
- py39gevent_starlette
- py312aws
2 changes: 2 additions & 0 deletions .tekton/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ spec:
- "sha256:4429a1580a1db32addb5127499a88a8bc6eecb08c7ea19a77b5b69c32f840acd"
# public.ecr.aws/docker/library/python:3.13.0-bookworm
- "sha256:ecd27b6c43d8d84b0058e7db4aaa06a1bfe970d0fb9bb7cf39f9536850f71510"
# public.ecr.aws/docker/library/python:3.14.0a2-bookworm
- "sha256:67eabdadd211c2768dbe0b4f311b27f889b755a6cb93392f41c8773c15affd67"
taskRef:
name: python-tracer-unittest-default-task
workspaces:
Expand Down
6 changes: 5 additions & 1 deletion .tekton/python-tracer-prepuller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,13 @@ spec:
image: public.ecr.aws/docker/library/python@sha256:4429a1580a1db32addb5127499a88a8bc6eecb08c7ea19a77b5b69c32f840acd
command: ["sh", "-c", "'true'"]
- name: prepuller-313
# public.ecr.aws/docker/library/python:3.13.0
# public.ecr.aws/docker/library/python:3.13.0-bookworm
image: public.ecr.aws/docker/library/python@sha256:ecd27b6c43d8d84b0058e7db4aaa06a1bfe970d0fb9bb7cf39f9536850f71510
command: ["sh", "-c", "'true'"]
- name: prepuller-314
# public.ecr.aws/docker/library/python:3.14.0a2-bookworm
image: public.ecr.aws/docker/library/python@sha256:67eabdadd211c2768dbe0b4f311b27f889b755a6cb93392f41c8773c15affd67
command: ["sh", "-c", "'true'"]

# Use the pause container to ensure the Pod goes into a `Running` phase
# but doesn't take up resource on the cluster
Expand Down
4 changes: 2 additions & 2 deletions .tekton/run_unittests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ PYTHON_MINOR_VERSION="$(echo "${PYTHON_VERSION}" | cut -d'.' -f 2)"

case "${TEST_CONFIGURATION}" in
default)
export REQUIREMENTS='requirements.txt'
[ "${PYTHON_MINOR_VERSION}" -eq "14" ] && export REQUIREMENTS='requirements-pre314.txt' || export REQUIREMENTS='requirements.txt'
export TESTS=('tests') ;;
cassandra)
export REQUIREMENTS='requirements-cassandra.txt'
Expand All @@ -34,7 +34,7 @@ aws)
export TESTS=('tests_aws') ;;
*)
echo "ERROR \$TEST_CONFIGURATION='${TEST_CONFIGURATION}' is unsupported " \
"not in (default|cassandra|gevent_starlette)" >&2
"not in (default|cassandra|gevent_starlette|aws)" >&2
exit 3 ;;
esac

Expand Down
9 changes: 9 additions & 0 deletions tests/clients/test_google-cloud-storage.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# (c) Copyright IBM Corp. 2021
# (c) Copyright Instana Inc. 2020

import sys
from typing import Generator
import json
import pytest
Expand Down Expand Up @@ -538,6 +539,10 @@ def test_objects_attrs(self, mock_requests: Mock) -> None:
assert gcs_span.data["gcs"]["bucket"] == "test bucket"
assert gcs_span.data["gcs"]["object"] == "test object"

@pytest.mark.skipif(
sys.version_info >= (3, 14),
reason='Avoiding "Fatal Python error: Segmentation fault"',
)
@patch("requests.Session.request")
def test_objects_get(self, mock_requests: Mock) -> None:
mock_requests.return_value = self._mock_response(
Expand Down Expand Up @@ -1077,6 +1082,10 @@ def test_execute_with_instana_tracing_is_off(self) -> None:
response = client.list_buckets()
assert isinstance(response.client, storage.Client)

@pytest.mark.skipif(
sys.version_info >= (3, 14),
reason='Avoiding "Fatal Python error: Segmentation fault"',
)
@patch("requests.Session.request")
def test_download_with_instana_tracing_is_off(self, mock_requests: Mock) -> None:
mock_requests.return_value = self._mock_response(
Expand Down
7 changes: 7 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@
collect_ignore_glob.append("*test_sanic*")


if sys.version_info >= (3, 14):
# Currently not installable dependencies because of 3.14 incompatibilities
collect_ignore_glob.append("*test_fastapi*")
# aiohttp-server tests failing due to deprecated methods used
collect_ignore_glob.append("*test_aiohttp_server*")


@pytest.fixture(scope="session")
def celery_config():
return {
Expand Down
42 changes: 42 additions & 0 deletions tests/requirements-pre314.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
aiofiles>=0.5.0
aiohttp>=3.8.3
boto3>=1.17.74
bottle>=0.12.25
celery>=5.2.7
coverage>=5.5
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"
flask>=2.3.2
# gevent is taking more than 20min to build on 3.14
# gevent>=1.4.0
grpcio>=1.14.1
google-cloud-pubsub>=2.0.0
google-cloud-storage>=1.24.0
legacy-cgi>=2.6.1
lxml>=4.9.2
mock>=4.0.3
moto>=4.1.2
mysqlclient>=2.0.3
PyMySQL[rsa]>=1.0.2
psycopg2-binary>=2.8.6
pika>=1.2.0
pymongo>=3.11.4
pyramid>=2.0.1
pytest>=6.2.4
pytest-mock>=3.12.0
pytz>=2024.1
redis>=3.5.3
requests-mock
responses<=0.17.0
# Sanic is not installable on 3.13 because `httptools, uvloop` dependencies fail to compile:
# `too few arguments to function ‘_PyLong_AsByteArray’`
sanic>=19.9.0; python_version < "3.13"
sanic-testing>=24.6.0; python_version < "3.13"
starlette>=0.38.2
sqlalchemy>=2.0.0
tornado>=6.4.1
uvicorn>=0.13.4
urllib3>=1.26.5
httpx>=0.27.0

0 comments on commit ff05f4c

Please sign in to comment.