Skip to content

Commit 1ffe714

Browse files
committed
fix(payments): use RUNTIME_ROLE_ARN with pytest.skip for CP integ tests
Replace hardcoded dummy role ARN with env var lookup matching the pattern used by other integ test groups (runtime, gateway, etc.). Tests skip gracefully when RUNTIME_ROLE_ARN is not set.
1 parent 2be8a6a commit 1ffe714

1 file changed

Lines changed: 5 additions & 14 deletions

File tree

tests_integ/payments/test_payment_client.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,14 @@ class TestPaymentClientControlPlane:
6464
def setup_class(cls):
6565
"""Set up test environment."""
6666
cls.region = os.environ.get("BEDROCK_TEST_REGION", "us-west-2")
67-
cls.role_arn = os.environ.get(
68-
"TEST_PAYMENT_ROLE_ARN",
69-
"arn:aws:iam::123456789012:role/bedrock-payment-role",
70-
)
67+
cls.role_arn = os.environ.get("RUNTIME_ROLE_ARN")
68+
if not cls.role_arn:
69+
pytest.skip("RUNTIME_ROLE_ARN must be set")
7170
cls.client = PaymentClient(region_name=cls.region)
72-
# Use timestamp with microseconds for uniqueness
7371
cls.test_prefix = f"t{int(time.time() * 1000000)}"
7472
cls.created_managers = []
7573
cls.created_connectors = []
76-
cls.role_arn = os.environ.get(
77-
"TEST_PAYMENT_ROLE_ARN",
78-
"arn:aws:iam::123456789012:role/bedrock-payment-role",
79-
)
8074

81-
@classmethod
8275
@classmethod
8376
def teardown_class(cls):
8477
"""Clean up test resources."""
@@ -285,10 +278,8 @@ def setup_class(cls):
285278
cls.api_key_secret = os.environ.get("PAYMENT_TEST_API_KEY_SECRET")
286279
cls.wallet_secret = os.environ.get("PAYMENT_TEST_WALLET_SECRET")
287280
cls.skip_tests = not (cls.api_key_secret and cls.wallet_secret)
288-
cls.role_arn = os.environ.get(
289-
"TEST_PAYMENT_ROLE_ARN",
290-
"arn:aws:iam::123456789012:role/bedrock-payment-role",
291-
)
281+
cls.role_arn = os.environ.get("RUNTIME_ROLE_ARN")
282+
cls.skip_tests = cls.skip_tests or not cls.role_arn
292283

293284
@classmethod
294285
def teardown_class(cls):

0 commit comments

Comments
 (0)