From 1282e2efa1fc7804ef717686817109b7205328b0 Mon Sep 17 00:00:00 2001 From: Paulo Vital Date: Tue, 18 Mar 2025 08:27:41 +0100 Subject: [PATCH] ci: Add support to test Python 3.14.0a6. Signed-off-by: Paulo Vital --- .circleci/config.yml | 2 +- .tekton/pipeline.yaml | 4 +-- .tekton/python-tracer-prepuller.yaml | 4 +-- run_tests.sh | 50 ++++++++++++++++++++++++++++ 4 files changed, 55 insertions(+), 5 deletions(-) create mode 100755 run_tests.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 4eb25278..611a2433 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -359,7 +359,7 @@ jobs: python314: docker: - - image: public.ecr.aws/docker/library/python:3.14.0a5 + - image: public.ecr.aws/docker/library/python:3.14.0a6 - image: public.ecr.aws/docker/library/postgres:16.2-bookworm environment: POSTGRES_USER: root diff --git a/.tekton/pipeline.yaml b/.tekton/pipeline.yaml index 72c80111..7ee73dc0 100644 --- a/.tekton/pipeline.yaml +++ b/.tekton/pipeline.yaml @@ -38,8 +38,8 @@ spec: - "sha256:ae24158f83adcb3ec1dead14356e6debc9f3125167624408d95338faacc5cce3" # public.ecr.aws/docker/library/python:3.13.2-bookworm - "sha256:90a15cf04e17111d514958f3b17186f2e239546f75530b1e301059f0b70de41f" - # public.ecr.aws/docker/library/python:3.14.0a5-bookworm - - "sha256:c00e5b4b511a77e0b11c52b88cb195c0dcc371e71d2f7ebb3ba1173387d71f92" + # public.ecr.aws/docker/library/python:3.14.0a6-bookworm + - "sha256:cc1702492859ae14ce2c417060215a94153a51f42954eb7fd5f275b5b3039926" taskRef: name: python-tracer-unittest-default-task workspaces: diff --git a/.tekton/python-tracer-prepuller.yaml b/.tekton/python-tracer-prepuller.yaml index 80b86017..201b54fa 100644 --- a/.tekton/python-tracer-prepuller.yaml +++ b/.tekton/python-tracer-prepuller.yaml @@ -74,8 +74,8 @@ spec: image: public.ecr.aws/docker/library/python@sha256:90a15cf04e17111d514958f3b17186f2e239546f75530b1e301059f0b70de41f command: ["sh", "-c", "'true'"] - name: prepuller-314 - # public.ecr.aws/docker/library/python:3.14.0a5-bookworm - image: public.ecr.aws/docker/library/python@sha256:c00e5b4b511a77e0b11c52b88cb195c0dcc371e71d2f7ebb3ba1173387d71f92 + # public.ecr.aws/docker/library/python:3.14.0a6-bookworm + image: public.ecr.aws/docker/library/python@sha256:cc1702492859ae14ce2c417060215a94153a51f42954eb7fd5f275b5b3039926 command: ["sh", "-c", "'true'"] # Use the pause container to ensure the Pod goes into a `Running` phase diff --git a/run_tests.sh b/run_tests.sh new file mode 100755 index 00000000..28735e5c --- /dev/null +++ b/run_tests.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +set -x + +POSITIONAL_ARGS=() +TESTS=("tests") + +while [[ $# -gt 0 ]]; do + case $1 in + --aws) + TESTS=("tests_aws") + shift # past argument + shift # past value + ;; + --default) + TESTS=("tests") + shift # past argument + shift # past value + ;; + --all) + TESTS=("tests tests_aws") + shift # past argument + shift # past value + ;; + --cov) + COVERAGE=True + shift # past argument + shift # past value + ;; + -*|--*) + echo "Unknown option 1" # save positional arg + shift # past argument + ;; + esac +done + +set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters + +if [ -z ${COVERAGE} ]; then + pytest -vv "${TESTS[@]}" +else + coverage run \ + --source=instana \ + --module pytest \ + --verbose \ + --junitxml=test-results \ + "${TESTS[@]}" # pytest options (not coverage options anymore) + + coverage report -m + coverage html +fi \ No newline at end of file