From e60d903b6fcdcec9e350fc80a1073e9af17335c7 Mon Sep 17 00:00:00 2001 From: Varsha GS Date: Mon, 28 Apr 2025 12:26:13 +0530 Subject: [PATCH 1/2] tests(autowrapt_bootstrap): Add tests to verify activating the tracer without code changes Signed-off-by: Varsha GS --- .circleci/config.yml | 36 +++++++++++++++++++++++++++++++ pytest.ini | 1 + tests/requirements-minimal.txt | 3 +++ tests_autowrapt/test_autowrapt.py | 6 ++++++ 4 files changed, 46 insertions(+) create mode 100644 tests/requirements-minimal.txt create mode 100644 tests_autowrapt/test_autowrapt.py diff --git a/.circleci/config.yml b/.circleci/config.yml index ddf67fae..3557d140 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -278,6 +278,38 @@ jobs: - store-pytest-results - store-coverage-report + py312autowrapt: + docker: + - image: public.ecr.aws/docker/library/python:3.12 + environment: + AUTOWRAPT_BOOTSTRAP: instana + working_directory: ~/repo + steps: + - checkout + - check-if-tests-needed + - pip-install-deps: + requirements: "tests/requirements-minimal.txt" + - run-tests-with-coverage-report: + tests: "tests_autowrapt" + - store-pytest-results + - store-coverage-report + + py313autowrapt: + docker: + - image: public.ecr.aws/docker/library/python:3.13 + environment: + AUTOWRAPT_BOOTSTRAP: instana + working_directory: ~/repo + steps: + - checkout + - check-if-tests-needed + - pip-install-deps: + requirements: "tests/requirements-minimal.txt" + - run-tests-with-coverage-report: + tests: "tests_autowrapt" + - store-pytest-results + - store-coverage-report + python313: docker: - image: public.ecr.aws/docker/library/python:3.13 @@ -423,6 +455,8 @@ workflows: - py39gevent_starlette - py312aws - py312kafka + - py312autowrapt + - py313autowrapt - final_job: requires: - python38 @@ -436,3 +470,5 @@ workflows: - py39cassandra - py39gevent_starlette - py312aws + - py312autowrapt + - py313autowrapt diff --git a/pytest.ini b/pytest.ini index e79dc7de..64b91610 100644 --- a/pytest.ini +++ b/pytest.ini @@ -7,5 +7,6 @@ pythonpath = src testpaths = tests tests_aws + tests_autowrapt markers = original: mark test to use the original method instead of the mocked ones under `conftest.py` diff --git a/tests/requirements-minimal.txt b/tests/requirements-minimal.txt new file mode 100644 index 00000000..a325691b --- /dev/null +++ b/tests/requirements-minimal.txt @@ -0,0 +1,3 @@ +coverage>=5.5 +pytest>=4.6 +setuptools diff --git a/tests_autowrapt/test_autowrapt.py b/tests_autowrapt/test_autowrapt.py new file mode 100644 index 00000000..61496d1f --- /dev/null +++ b/tests_autowrapt/test_autowrapt.py @@ -0,0 +1,6 @@ +import os +import sys + +def test_autowrapt_bootstrap(): + assert os.environ.get("AUTOWRAPT_BOOTSTRAP") == "instana" + assert "instana" in sys.modules From b449598e98d0248df23fc7e3447755fa9efac781 Mon Sep 17 00:00:00 2001 From: Varsha GS Date: Mon, 28 Apr 2025 12:27:46 +0530 Subject: [PATCH 2/2] chore: use minimal dependencies for aws tests Signed-off-by: Varsha GS --- .circleci/config.yml | 2 +- tests/requirements-aws.txt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 tests/requirements-aws.txt diff --git a/.circleci/config.yml b/.circleci/config.yml index 3557d140..b936a177 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -272,7 +272,7 @@ jobs: - checkout - check-if-tests-needed - pip-install-deps: - requirements: "tests/requirements.txt" + requirements: "tests/requirements-aws.txt" - run-tests-with-coverage-report: tests: "tests_aws" - store-pytest-results diff --git a/tests/requirements-aws.txt b/tests/requirements-aws.txt new file mode 100644 index 00000000..49b58f29 --- /dev/null +++ b/tests/requirements-aws.txt @@ -0,0 +1,2 @@ +-r requirements-minimal.txt +boto3