Skip to content

Commit 5962711

Browse files
fix(e2e): use uv run for import test Python scripts (#845)
* fix(ci): unpin boto3 in e2e workflow The pinned boto3==1.38.0 did not include the bedrock-agentcore-control service model, causing import-resources e2e tests to fail with UnknownServiceError. Using latest boto3 ensures new AWS services are always available. * fix(e2e): use uv run for import test Python scripts The import e2e tests call python3 directly to run setup scripts that use boto3. On CI runners, the system-installed boto3 is too old to include the bedrock-agentcore-control service model. pip install boto3 installs to user site-packages which the child process doesn't pick up. Switch to uv run --with boto3 python3 so the scripts always get a current boto3 in an isolated environment. Remove the now-unnecessary pip install step from the workflow.
1 parent f2964e3 commit 5962711

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

.github/workflows/e2e-tests-full.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ jobs:
4040
git config --global user.email "ci@amazon.com"
4141
git config --global user.name "CI"
4242
- uses: astral-sh/setup-uv@v7
43-
- name: Install Python dependencies for import tests
44-
run: pip install boto3
4543
- name: Configure AWS credentials
4644
uses: aws-actions/configure-aws-credentials@v6
4745
with:

e2e-tests/import-resources.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const hasPython =
2222
hasCommand('python3') &&
2323
(() => {
2424
try {
25-
execSync('python3 -c "import boto3"', { stdio: 'ignore' });
25+
execSync('uv run --with boto3 python3 -c "import boto3"', { stdio: 'ignore' });
2626
return true;
2727
} catch {
2828
return false;
@@ -51,7 +51,7 @@ describe.sequential('e2e: import runtime/memory/evaluator', () => {
5151
// Scripts run sequentially because save_resource() does a read-modify-write
5252
// on a shared bugbash-resources.json file — parallel runs would race.
5353
for (const script of ['setup_runtime_basic.py', 'setup_memory_full.py', 'setup_evaluator.py']) {
54-
const result = await spawnAndCollect('python3', [script], fixtureDir, {
54+
const result = await spawnAndCollect('uv', ['run', '--with', 'boto3', 'python3', script], fixtureDir, {
5555
AWS_REGION: region,
5656
DEFAULT_EVALUATOR_MODEL,
5757
});
@@ -100,7 +100,9 @@ describe.sequential('e2e: import runtime/memory/evaluator', () => {
100100

101101
// 2. Fallback: delete any resources that weren't imported into CFN
102102
try {
103-
await spawnAndCollect('python3', ['cleanup_resources.py'], fixtureDir, { AWS_REGION: region });
103+
await spawnAndCollect('uv', ['run', '--with', 'boto3', 'python3', 'cleanup_resources.py'], fixtureDir, {
104+
AWS_REGION: region,
105+
});
104106
} catch {
105107
/* ignore — resources may already be deleted by CFN teardown */
106108
}

0 commit comments

Comments
 (0)