From 5e846d8a5ff53d28454d84db8f5862da8d11bb35 Mon Sep 17 00:00:00 2001 From: Rohan Gavankar Date: Tue, 24 Nov 2026 13:27:16 -0500 Subject: [PATCH 1/3] test: run integration tests for each project in parallel Experiment to measure CI time. Runs each project's integration tests as its own make target, 4 at a time, keeps going after a failure, and prints each project's duration. --- Makefile | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 4f6f6fa3..57ba9c16 100644 --- a/Makefile +++ b/Makefile @@ -58,12 +58,29 @@ test-functional: done # Calls live services, so it needs AWS credentials. +# Each project tests its own service, so projects run at once. -k runs every project +# even after one fails; make still exits non-zero if any failed. +INTEGRATION_JOBS ?= 4 +INTEGRATION_PROJECTS := $(filter-out $(INTEGRATION_SKIP),$(patsubst %/tests/integration,%,$(wildcard $(addsuffix /tests/integration,$(PROJECTS))))) +# Keeps each project's output together; needs GNU make 4.0 or later. +OUTPUT_SYNC := $(if $(filter output-sync,$(.FEATURES)),--output-sync=target) + test-integration: - @set -e; for p in $(filter-out $(INTEGRATION_SKIP),$(PROJECTS)); do \ - [ -d $$p/tests/integration ] || continue; \ - echo "== $$p"; \ - $(UV_RUN) $$p --group test --all-extras pytest $$p/tests/integration; \ - done + @start=$$(date +%s); \ + $(MAKE) --no-print-directory -k -j$(INTEGRATION_JOBS) $(OUTPUT_SYNC) $(addprefix integration/,$(INTEGRATION_PROJECTS)); \ + status=$$?; \ + echo "== test-integration finished in $$(( $$(date +%s) - start ))s (exit $$status)"; \ + exit $$status + +integration/%: FORCE + @start=$$(date +%s); \ + echo "== $*"; \ + $(UV_RUN) $* --group test --all-extras pytest $*/tests/integration --durations=5; \ + status=$$?; \ + echo "== $* finished in $$(( $$(date +%s) - start ))s (exit $$status)"; \ + exit $$status + +FORCE: # Regenerate every client from codegen/aws-models with codegen built from the # smithy-python commit in codegen/smithy-python.toml. Each client is cleared first, From 8d7906aacf51188649c04f153a96e050c857ad19 Mon Sep 17 00:00:00 2001 From: Rohan Gavankar Date: Tue, 24 Nov 2026 15:07:19 -0500 Subject: [PATCH 2/3] test: add deliberate integration failures to check parallel log readability DO NOT MERGE. Lambda, Polly and DynamoDB each get 3 failures and 2 errors (assertion, exception, setup and teardown errors) that don't call AWS. --- .../test_zz_intentional_failures.py | 42 +++++++++++++++++++ .../test_zz_intentional_failures.py | 42 +++++++++++++++++++ .../test_zz_intentional_failures.py | 42 +++++++++++++++++++ 3 files changed, 126 insertions(+) create mode 100644 clients/aws-sdk-dynamodb/tests/integration/test_zz_intentional_failures.py create mode 100644 clients/aws-sdk-lambda/tests/integration/test_zz_intentional_failures.py create mode 100644 clients/aws-sdk-polly/tests/integration/test_zz_intentional_failures.py diff --git a/clients/aws-sdk-dynamodb/tests/integration/test_zz_intentional_failures.py b/clients/aws-sdk-dynamodb/tests/integration/test_zz_intentional_failures.py new file mode 100644 index 00000000..75426ac4 --- /dev/null +++ b/clients/aws-sdk-dynamodb/tests/integration/test_zz_intentional_failures.py @@ -0,0 +1,42 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""DO NOT MERGE: deliberate failures to check how parallel runs report them.""" + +from collections.abc import Iterator + +import pytest + + +@pytest.fixture +def broken_setup() -> None: + raise RuntimeError("intentional setup error in dynamodb") + + +@pytest.fixture +def broken_teardown() -> Iterator[None]: + yield + raise RuntimeError("intentional teardown error in dynamodb") + + +@pytest.mark.parametrize("mode", ["sync", "async"]) +def test_intentional_assertion_failure(mode: str) -> None: + expected = {"client": "dynamodb", "mode": mode, "value": 1} + actual = {"client": "dynamodb", "mode": mode, "value": 2} + assert actual == expected + + +def test_intentional_exception() -> None: + raise ValueError("intentional exception in dynamodb") + + +def test_intentional_setup_error(broken_setup: None) -> None: + pass + + +def test_intentional_teardown_error(broken_teardown: None) -> None: + pass + + +def test_intentional_pass() -> None: + assert True diff --git a/clients/aws-sdk-lambda/tests/integration/test_zz_intentional_failures.py b/clients/aws-sdk-lambda/tests/integration/test_zz_intentional_failures.py new file mode 100644 index 00000000..727fa553 --- /dev/null +++ b/clients/aws-sdk-lambda/tests/integration/test_zz_intentional_failures.py @@ -0,0 +1,42 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""DO NOT MERGE: deliberate failures to check how parallel runs report them.""" + +from collections.abc import Iterator + +import pytest + + +@pytest.fixture +def broken_setup() -> None: + raise RuntimeError("intentional setup error in lambda") + + +@pytest.fixture +def broken_teardown() -> Iterator[None]: + yield + raise RuntimeError("intentional teardown error in lambda") + + +@pytest.mark.parametrize("mode", ["sync", "async"]) +def test_intentional_assertion_failure(mode: str) -> None: + expected = {"client": "lambda", "mode": mode, "value": 1} + actual = {"client": "lambda", "mode": mode, "value": 2} + assert actual == expected + + +def test_intentional_exception() -> None: + raise ValueError("intentional exception in lambda") + + +def test_intentional_setup_error(broken_setup: None) -> None: + pass + + +def test_intentional_teardown_error(broken_teardown: None) -> None: + pass + + +def test_intentional_pass() -> None: + assert True diff --git a/clients/aws-sdk-polly/tests/integration/test_zz_intentional_failures.py b/clients/aws-sdk-polly/tests/integration/test_zz_intentional_failures.py new file mode 100644 index 00000000..87afb09e --- /dev/null +++ b/clients/aws-sdk-polly/tests/integration/test_zz_intentional_failures.py @@ -0,0 +1,42 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""DO NOT MERGE: deliberate failures to check how parallel runs report them.""" + +from collections.abc import Iterator + +import pytest + + +@pytest.fixture +def broken_setup() -> None: + raise RuntimeError("intentional setup error in polly") + + +@pytest.fixture +def broken_teardown() -> Iterator[None]: + yield + raise RuntimeError("intentional teardown error in polly") + + +@pytest.mark.parametrize("mode", ["sync", "async"]) +def test_intentional_assertion_failure(mode: str) -> None: + expected = {"client": "polly", "mode": mode, "value": 1} + actual = {"client": "polly", "mode": mode, "value": 2} + assert actual == expected + + +def test_intentional_exception() -> None: + raise ValueError("intentional exception in polly") + + +def test_intentional_setup_error(broken_setup: None) -> None: + pass + + +def test_intentional_teardown_error(broken_teardown: None) -> None: + pass + + +def test_intentional_pass() -> None: + assert True From 6a139fc22d342be179aca38c0d2198d2f36021fa Mon Sep 17 00:00:00 2001 From: Rohan Gavankar Date: Tue, 24 Nov 2026 15:56:18 -0500 Subject: [PATCH 3/3] test: remove deliberate integration failures --- .../test_zz_intentional_failures.py | 42 ------------------- .../test_zz_intentional_failures.py | 42 ------------------- .../test_zz_intentional_failures.py | 42 ------------------- 3 files changed, 126 deletions(-) delete mode 100644 clients/aws-sdk-dynamodb/tests/integration/test_zz_intentional_failures.py delete mode 100644 clients/aws-sdk-lambda/tests/integration/test_zz_intentional_failures.py delete mode 100644 clients/aws-sdk-polly/tests/integration/test_zz_intentional_failures.py diff --git a/clients/aws-sdk-dynamodb/tests/integration/test_zz_intentional_failures.py b/clients/aws-sdk-dynamodb/tests/integration/test_zz_intentional_failures.py deleted file mode 100644 index 75426ac4..00000000 --- a/clients/aws-sdk-dynamodb/tests/integration/test_zz_intentional_failures.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -# SPDX-License-Identifier: Apache-2.0 - -"""DO NOT MERGE: deliberate failures to check how parallel runs report them.""" - -from collections.abc import Iterator - -import pytest - - -@pytest.fixture -def broken_setup() -> None: - raise RuntimeError("intentional setup error in dynamodb") - - -@pytest.fixture -def broken_teardown() -> Iterator[None]: - yield - raise RuntimeError("intentional teardown error in dynamodb") - - -@pytest.mark.parametrize("mode", ["sync", "async"]) -def test_intentional_assertion_failure(mode: str) -> None: - expected = {"client": "dynamodb", "mode": mode, "value": 1} - actual = {"client": "dynamodb", "mode": mode, "value": 2} - assert actual == expected - - -def test_intentional_exception() -> None: - raise ValueError("intentional exception in dynamodb") - - -def test_intentional_setup_error(broken_setup: None) -> None: - pass - - -def test_intentional_teardown_error(broken_teardown: None) -> None: - pass - - -def test_intentional_pass() -> None: - assert True diff --git a/clients/aws-sdk-lambda/tests/integration/test_zz_intentional_failures.py b/clients/aws-sdk-lambda/tests/integration/test_zz_intentional_failures.py deleted file mode 100644 index 727fa553..00000000 --- a/clients/aws-sdk-lambda/tests/integration/test_zz_intentional_failures.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -# SPDX-License-Identifier: Apache-2.0 - -"""DO NOT MERGE: deliberate failures to check how parallel runs report them.""" - -from collections.abc import Iterator - -import pytest - - -@pytest.fixture -def broken_setup() -> None: - raise RuntimeError("intentional setup error in lambda") - - -@pytest.fixture -def broken_teardown() -> Iterator[None]: - yield - raise RuntimeError("intentional teardown error in lambda") - - -@pytest.mark.parametrize("mode", ["sync", "async"]) -def test_intentional_assertion_failure(mode: str) -> None: - expected = {"client": "lambda", "mode": mode, "value": 1} - actual = {"client": "lambda", "mode": mode, "value": 2} - assert actual == expected - - -def test_intentional_exception() -> None: - raise ValueError("intentional exception in lambda") - - -def test_intentional_setup_error(broken_setup: None) -> None: - pass - - -def test_intentional_teardown_error(broken_teardown: None) -> None: - pass - - -def test_intentional_pass() -> None: - assert True diff --git a/clients/aws-sdk-polly/tests/integration/test_zz_intentional_failures.py b/clients/aws-sdk-polly/tests/integration/test_zz_intentional_failures.py deleted file mode 100644 index 87afb09e..00000000 --- a/clients/aws-sdk-polly/tests/integration/test_zz_intentional_failures.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -# SPDX-License-Identifier: Apache-2.0 - -"""DO NOT MERGE: deliberate failures to check how parallel runs report them.""" - -from collections.abc import Iterator - -import pytest - - -@pytest.fixture -def broken_setup() -> None: - raise RuntimeError("intentional setup error in polly") - - -@pytest.fixture -def broken_teardown() -> Iterator[None]: - yield - raise RuntimeError("intentional teardown error in polly") - - -@pytest.mark.parametrize("mode", ["sync", "async"]) -def test_intentional_assertion_failure(mode: str) -> None: - expected = {"client": "polly", "mode": mode, "value": 1} - actual = {"client": "polly", "mode": mode, "value": 2} - assert actual == expected - - -def test_intentional_exception() -> None: - raise ValueError("intentional exception in polly") - - -def test_intentional_setup_error(broken_setup: None) -> None: - pass - - -def test_intentional_teardown_error(broken_teardown: None) -> None: - pass - - -def test_intentional_pass() -> None: - assert True