Skip to content

fix: update E2E test regex to match new CUSTOM_JWT client-side error#832

Merged
aidandaly24 merged 1 commit intomainfrom
fix/e2e-custom-jwt-regex
Apr 13, 2026
Merged

fix: update E2E test regex to match new CUSTOM_JWT client-side error#832
aidandaly24 merged 1 commit intomainfrom
fix/e2e-custom-jwt-regex

Conversation

@aidandaly24
Copy link
Copy Markdown
Contributor

Description

PR #817 changed src/cli/commands/invoke/action.ts to fail fast client-side when a CUSTOM_JWT agent is invoked without a bearer token (and without stored client credentials for auto-fetch). The new error message:

Agent '...' is configured for CUSTOM_JWT but no bearer token is available.

The E2E tests in byo-custom-jwt.test.ts still expected the old server-side error pattern (/[Aa]uthoriz(ation|er).*mismatch|different.*authorization/i), causing 2 test failures on main.

This updates all 5 regex assertions (2 positive, 3 negative) to also match the new client-side message.

Related Issue

Closes #

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

How have you tested the change?

  • I ran npm run test:unit and npm run test:integ
  • I ran npm run typecheck
  • I ran npm run lint
  • If I modified src/assets/, I ran npm run test:update-snapshots and committed the updated snapshots

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.

PR #817 changed invoke to fail fast client-side when a CUSTOM_JWT agent
is invoked without a bearer token, producing a different error message.
The E2E assertions still expected the old server-side "authorization
mismatch" pattern, causing two test failures on main.
@aidandaly24 aidandaly24 requested a review from a team April 13, 2026 21:43
@github-actions github-actions bot added the size/s PR size: S label Apr 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Package Tarball

aws-agentcore-0.8.0.tgz

How to install

npm install https://github.com/aws/agentcore-cli/releases/download/pr-832-tarball/aws-agentcore-0.8.0.tgz

@github-actions
Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 44.59% 7063 / 15839
🔵 Statements 44.06% 7494 / 17005
🔵 Functions 42.08% 1266 / 3008
🔵 Branches 43.55% 4741 / 10884
Generated in workflow #1745 for commit 7642e0d by the Vitest Coverage Report Action

Copy link
Copy Markdown
Contributor

@jesseturner21 jesseturner21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@aidandaly24 aidandaly24 merged commit 4f178a5 into main Apr 13, 2026
23 checks passed
@aidandaly24 aidandaly24 deleted the fix/e2e-custom-jwt-regex branch April 13, 2026 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants