Skip to content

test: add Q CLI and MCP integration testing#6

Closed
ezhang6811 wants to merge 28 commits intoaws-actions:mainfrom
ezhang6811:integ-test
Closed

test: add Q CLI and MCP integration testing#6
ezhang6811 wants to merge 28 commits intoaws-actions:mainfrom
ezhang6811:integ-test

Conversation

@ezhang6811
Copy link
Copy Markdown
Contributor

@ezhang6811 ezhang6811 commented Nov 5, 2025

Issue #, if available:

Description of changes:
Created two integration tests that verify the communication between Q CLI and MCP servers.

  • integ-test.yml: runs on merges to main and manual dispatch (pre-release), runs action from source code
  • soak-test.yml: runs hourly, points to published version of action (TODO after initial release), emits a cloudwatch metric

Both tests pass in a custom prompt that tell Q CLI to call both Application Signals and Cloudwatch MCP tools. In test mode (only runnable from this repo in the main branch), the logic to read the Github context is bypassed and the agent reads the custom prompt directly.

The tests uploads the saved raw output file, and then verifies that the output logs the list_monitored_services tool call to the Application Signals MCP server, as well as the get_active_alarms tool call from the CloudWatch MCP server.

Successful test run: https://github.com/ezhang6811/application-observability-for-aws/actions/runs/19115766214

Next steps:

  • validate input will deterministically generate MCP tool call
  • publish CW metric for successful workflow calls
  • verify no conflict with regular user invocation of the action

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

Comment thread .github/workflows/integ-test.yml Outdated
- cron: '0 */6 * * *'
push:
branches:
- integ-test
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

temporary manual trigger, remove before merging

Comment thread .github/workflows/integ-test.yml Outdated
Comment on lines +28 to +29
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

TODO: let's change this to use IAM role later

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

will address in next PR.

@@ -0,0 +1,77 @@
name: Integration Test
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So this test will be triggered in 2 scenarios?

  1. PR push
  2. Periodical check like soaking test? should we emit metrics on result and alarm for any issues

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added two triggers. One is a main build (PR merged to main), the other is a soak test (every 6 hours but can be reduced). Currently both point to the source code; once we release the initial version of the action I will update the soak test trigger uses: aws-actions/apm-action@v1.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added job to publish success metric.

Comment thread action.yml Outdated
ALLOWED_NON_WRITE_USERS: ${{ inputs.allowed_non_write_users }}
GITHUB_RUN_ID: ${{ github.run_id }}
DEFAULT_WORKFLOW_TOKEN: ${{ github.token }}
TRACING_MODE: ${{ inputs.tracing_mode }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why tracing mode got enabled?

Comment thread src/init.js Outdated
const targetBranch = process.env.TARGET_BRANCH || '';
const allowedNonWriteUsers = process.env.ALLOWED_NON_WRITE_USERS || '';
const customPrompt = process.env.CUSTOM_PROMPT || '';
const tracingMode = process.env.TRACING_MODE || 'false';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the same

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

removed both instances

Comment thread src/init.js
mxiamxia
mxiamxia previously approved these changes Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants