-
Notifications
You must be signed in to change notification settings - Fork 35
Feat: Introduce targets to verify A2A and MCP servers start #209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7fea1e1
01d3e78
ef86790
1301d17
688bbfb
5ffae13
99bb136
086498d
cfa6462
71366b7
7f8f68c
feb19e8
337aeef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| .PHONY: lint fmt test-docker test-a2a test-mcp sync-all-uv sync-a2a sync-mcp | ||
| SHELL := /bin/bash | ||
|
|
||
| .PHONY: lint fmt test-docker test-a2a test-mcp sync-all-uv sync-a2a sync-mcp test-startup-all test-startup-a2a test-startup-mcp | ||
|
|
||
| lint: | ||
| pre-commit run --all-files | ||
|
|
@@ -48,3 +50,26 @@ sync-mcp: | |
| uv sync --no-dev || exit; \ | ||
| popd; \ | ||
| done | ||
|
|
||
| test-startup-all: test-startup-a2a test-startup-mcp | ||
|
|
||
| # Run the test_startup.exp script for each A2A example that has one to verify it starts successfully. | ||
| test-startup-a2a: | ||
| @for f in $(shell find a2a -mindepth 1 -maxdepth 1 -type d); do \ | ||
| pushd $${f} || exit; \ | ||
| if [ -f test_startup.exp ]; then \ | ||
| echo "Testing startup for $${f}..."; \ | ||
| expect -f test_startup.exp || exit; \ | ||
| fi; \ | ||
| popd; \ | ||
| done | ||
|
|
||
| test-startup-mcp: | ||
| @for f in $(shell find mcp -mindepth 1 -maxdepth 1 -type d); do \ | ||
| pushd $${f} || exit; \ | ||
| if [ -f test_startup.exp ]; then \ | ||
| echo "Testing startup for $${f}..."; \ | ||
| expect -f test_startup.exp || exit; \ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: |
||
| fi; \ | ||
| popd; \ | ||
| done | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,4 @@ | ||
| .venv | ||
| .venv | ||
|
|
||
| # `expect` scripts | ||
| test_startup.exp |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # This script tests if the server has dependencies and reaches the point of starting its server. | ||
|
|
||
| # Run with `expect -f test_startup.exp` | ||
|
|
||
| set timeout 120 | ||
|
|
||
| # This is similar the Dockerfile CMD | ||
| spawn env HOST=localhost PORT=8001 uv run --locked . --host localhost --port 8001 | ||
|
|
||
| expect { | ||
| "Uvicorn running on" { puts "Success"; exit 0 } | ||
| timeout { puts "Timed out waiting for startup"; exit 1 } | ||
| eof { puts "Process exited early"; exit 2 } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,5 @@ | ||
| .venv | ||
| deployment | ||
|
|
||
| # `expect` scripts | ||
| test_startup.exp |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # This script tests if the server has dependencies and reaches the point of starting its server. | ||
|
|
||
| # Run with `expect -f test_startup.exp` | ||
|
|
||
| set timeout 120 | ||
|
|
||
| # This is similar the Dockerfile CMD | ||
| spawn env HOST=localhost PORT=8001 uv run --locked app --host localhost --port 8001 | ||
|
|
||
| expect { | ||
| "Uvicorn running on" { puts "Success"; exit 0 } | ||
| timeout { puts "Timed out waiting for startup"; exit 1 } | ||
| eof { puts "Process exited early"; exit 2 } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,3 +2,6 @@ __pycache__ | |
| *.pyc | ||
| .venv | ||
| .git | ||
|
|
||
| # `expect` scripts | ||
| test_startup.exp | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # This script tests if the server has dependencies and reaches the point of starting its server. | ||
|
|
||
| # Run with `expect -f test_startup.exp` | ||
|
|
||
| set timeout 120 | ||
|
|
||
| # This is similar the Dockerfile CMD | ||
| spawn env HOST=localhost PORT=8001 uv run --locked server --host localhost --port 8001 | ||
|
|
||
| expect { | ||
| "Uvicorn running on" { puts "Success"; exit 0 } | ||
| timeout { puts "Timed out waiting for startup"; exit 1 } | ||
| eof { puts "Process exited early"; exit 2 } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,4 @@ | ||
| .venv | ||
| .venv | ||
|
|
||
| # `expect` scripts | ||
| test_startup.exp |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # This script tests if the server has dependencies and reaches the point of starting its server. | ||
|
|
||
| # Run with `expect -f test_startup.exp` | ||
|
|
||
| set timeout 120 | ||
|
|
||
| # This is similar the Dockerfile CMD | ||
| spawn env HOST=localhost PORT=8001 uv run --locked server --host localhost --port 8001 | ||
|
|
||
| expect { | ||
| "Uvicorn running on" { puts "Success"; exit 0 } | ||
| timeout { puts "Timed out waiting for startup"; exit 1 } | ||
| eof { puts "Process exited early"; exit 2 } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,4 @@ | ||
| .venv | ||
| .venv | ||
|
|
||
| # `expect` scripts | ||
| test_startup.exp |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # This script tests if the server has dependencies and reaches the point of starting its server. | ||
|
|
||
| # Run with `expect -f test_startup.exp` | ||
|
|
||
| set timeout 120 | ||
|
|
||
| # This is similar the Dockerfile CMD | ||
| spawn env HOST=localhost PORT=8001 uv run --locked server --host localhost --port 8001 | ||
|
|
||
| expect { | ||
| "Uvicorn running on" { puts "Success"; exit 0 } | ||
| timeout { puts "Timed out waiting for startup"; exit 1 } | ||
| eof { puts "Process exited early"; exit 2 } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| .venv | ||
|
|
||
| # `expect` scripts | ||
| test_startup.exp |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # This script tests if the server has dependencies and reaches the point of starting its server. | ||
|
|
||
| # Run with `expect -f test_startup.exp` | ||
|
|
||
| set timeout 120 | ||
|
|
||
| # This is similar the Dockerfile CMD | ||
| set child_pid [spawn env HOST=localhost PORT=8001 uv run --locked server] | ||
|
|
||
| expect { | ||
| "Uvicorn running on" { | ||
| # Unlike the other servers, this one opens a child process. | ||
| # Without the explicit `pkill -P` it would leave a `uv` process running. | ||
| puts "Spawned pid was $child_pid" | ||
| exec pkill -P $child_pid | ||
| puts "Success"; exit 0 | ||
| } | ||
| timeout { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: The |
||
| exec pkill -P $child_pid | ||
| puts "Timed out waiting for startup"; exit 1 | ||
| } | ||
| eof { puts "Process exited early"; exit 2 } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,4 @@ | ||
| .venv | ||
| .venv | ||
|
|
||
| # `expect` scripts | ||
| test_startup.exp |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # This script tests if the server has dependencies and reaches the point of starting its server. | ||
|
|
||
| # Run with `expect -f test_startup.exp` | ||
|
|
||
| set timeout 120 | ||
|
|
||
| # This is similar the Dockerfile CMD | ||
| spawn env HOST=localhost PORT=8001 uv run --locked server --host localhost --port 8001 | ||
|
|
||
| expect { | ||
| "Uvicorn running on" { puts "Success"; exit 0 } | ||
| timeout { puts "Timed out waiting for startup"; exit 1 } | ||
| eof { puts "Process exited early"; exit 2 } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,3 +2,6 @@ __pycache__ | |
| *.pyc | ||
| .venv | ||
| .git | ||
|
|
||
| # `expect` scripts | ||
| test_startup.exp | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # This script tests if the server has dependencies and reaches the point of starting its server. | ||
|
|
||
| # Run with `expect -f test_startup.exp` | ||
|
|
||
| set timeout 120 | ||
|
|
||
| # This is similar the Dockerfile CMD | ||
| spawn env HOST=localhost PORT=8001 uv run --locked server --host localhost --port 8001 | ||
|
|
||
| expect { | ||
| "Uvicorn running on" { puts "Success"; exit 0 } | ||
| timeout { puts "Timed out waiting for startup"; exit 1 } | ||
| eof { puts "Process exited early"; exit 2 } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,3 +13,6 @@ build | |
| .git | ||
| .gitignore | ||
| .DS_Store | ||
|
|
||
| # `expect` scripts | ||
| test_startup.exp | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # This script tests if the server has dependencies and reaches the point of starting its server. | ||
|
|
||
| # Run with `expect -f test_startup.exp` | ||
|
|
||
| set timeout 120 | ||
|
|
||
| # This is similar the Dockerfile CMD | ||
| spawn env HOST=localhost PORT=8001 uv run --locked python -c "from src.reservation_service.agent import run; run()" --host localhost --port 8001 | ||
|
|
||
| expect { | ||
| "Uvicorn running on" { puts "Success"; exit 0 } | ||
| timeout { puts "Timed out waiting for startup"; exit 1 } | ||
| eof { puts "Process exited early"; exit 2 } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,4 +18,7 @@ README.md | |
| tests | ||
| .pytest_cache | ||
| .coverage | ||
| htmlcov | ||
| htmlcov | ||
|
|
||
| # `expect` scripts | ||
| test_startup.exp | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # This script tests if the server has dependencies and reaches the point of starting its server. | ||
|
|
||
| # Run with `expect -f test_startup.exp` | ||
|
|
||
| set timeout 120 | ||
|
|
||
| # This is similar the Dockerfile CMD | ||
| spawn env HOST=localhost PORT=8001 uv run --locked python -c "from src.simple_generalist.main import run; run()" --host localhost --port 8001 | ||
|
|
||
| expect { | ||
| "Uvicorn running on" { puts "Success"; exit 0 } | ||
| timeout { puts "Timed out waiting for startup"; exit 1 } | ||
| eof { puts "Process exited early"; exit 2 } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,4 @@ | ||
| .venv | ||
| .venv | ||
|
|
||
| # `expect` scripts | ||
| test_startup.exp |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # This script tests if the server has dependencies and reaches the point of starting its server. | ||
|
|
||
| # Run with `expect -f test_startup.exp` | ||
|
|
||
| set timeout 120 | ||
|
|
||
| # This is similar the Dockerfile CMD | ||
| spawn env HOST=localhost PORT=8001 uv run --locked server --host localhost --port 8001 | ||
|
|
||
| expect { | ||
| "Uvicorn running on" { puts "Success"; exit 0 } | ||
| timeout { puts "Timed out waiting for startup"; exit 1 } | ||
| eof { puts "Process exited early"; exit 2 } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,3 +2,6 @@ __pycache__ | |
| *.pyc | ||
| .venv | ||
| .git | ||
|
|
||
| # `expect` scripts | ||
| test_startup.exp | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # This script tests if the server has dependencies and reaches the point of starting its server. | ||
|
|
||
| # Run with `expect -f test_startup.exp` | ||
|
|
||
| set timeout 120 | ||
|
|
||
| # This is similar the Dockerfile CMD | ||
| spawn env HOST=localhost PORT=8001 uv run --locked python -c "from src.trivia_agent.agent import run; run()" --host localhost --port 8001 | ||
|
|
||
| expect { | ||
| "Uvicorn running on" { puts "Success"; exit 0 } | ||
| timeout { puts "Timed out waiting for startup"; exit 1 } | ||
| eof { puts "Process exited early"; exit 2 } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,3 +2,5 @@ | |
|
|
||
| deployment | ||
|
|
||
| # `expect` scripts | ||
| test_startup.exp | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # This script tests if the server has dependencies and reaches the point of starting its server. | ||
|
|
||
| # Run with `expect -f test_startup.exp` | ||
|
|
||
| set timeout 120 | ||
|
|
||
| # This is similar the Dockerfile CMD | ||
| spawn env HOST=localhost PORT=8001 uv run --locked server --host localhost --port 8001 | ||
|
|
||
| expect { | ||
| "Uvicorn running on" { puts "Success"; exit 0 } | ||
| timeout { puts "Timed out waiting for startup"; exit 1 } | ||
| eof { puts "Process exited early"; exit 2 } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,4 @@ | ||
| .venv | ||
| .venv | ||
|
|
||
| # `expect` scripts | ||
| test_startup.exp |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # This script tests if the server has dependencies and reaches the point of starting its server. | ||
|
|
||
| # Run with `expect -f test_startup.exp` | ||
|
|
||
| set timeout 120 | ||
|
|
||
| # This is similar the Dockerfile CMD | ||
| spawn env HOST=localhost PORT=8001 uv run --locked cloud_storage_tool.py | ||
|
|
||
| expect { | ||
| "Uvicorn running on" { puts "Success"; exit 0 } | ||
| timeout { puts "Timed out waiting for startup"; exit 1 } | ||
| eof { puts "Process exited early"; exit 2 } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| .venv | ||
|
|
||
| # `expect` scripts | ||
| test_startup.exp |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # This script tests if the server has dependencies and reaches the point of starting its server. | ||
|
|
||
| # Run with `expect -f test_startup.exp` | ||
|
|
||
| set timeout 120 | ||
|
|
||
| # This is similar the Dockerfile CMD | ||
| spawn env HOST=localhost PORT=8001 uv run --locked flight_tool.py | ||
|
|
||
| expect { | ||
| "http://localhost:8001/mcp" { puts "Success"; exit 0 } | ||
| timeout { puts "Timed out waiting for startup"; exit 1 } | ||
| eof { puts "Process exited early"; exit 2 } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,4 @@ | ||
| .venv | ||
| .venv | ||
|
|
||
| # `expect` scripts | ||
| test_startup.exp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
praise: Good use of SHA-pinned actions with version comments. The
timeout-minutes: 15is a sensible guardrail.