Skip to content

Commit 57e1198

Browse files
committed
feat: adding version parameter to e2e parameterized tests
1 parent 6e3ff93 commit 57e1198

7 files changed

Lines changed: 17 additions & 9 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ git clone https://github.com/agntcy/app-sdk.git
5959
pip install -e app-sdk
6060
```
6161

62-
Add a desc...
62+
The following examples demonstrate how to use the factory to create A2A servers, clients, and MCP clients with a SLIM or NATS transport.
6363

6464
[**A2A Server**](#a2a-server-with-transport-example): Create an A2A server bridge with a `SLIM` | `NATS` transport.
6565
[**A2A Client**](#a2a-client-with-transport-example): Create an A2A client with a `SLIM` | `NATS` transport.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "agntcy-app-sdk"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
description = "Agntcy Application SDK for Python"
55
authors = [{ name = "Cody Hartsook", email = "[email protected]" }]
66
requires-python = "~=3.12"

src/agntcy_app_sdk/factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def __init__(
5757
self.log_level = log_level
5858
try:
5959
logger.setLevel(log_level.upper())
60-
except:
60+
except ValueError:
6161
logger.error(f"Invalid log level '{log_level}'. Defaulting to DEBUG.")
6262
self.log_level = "DEBUG"
6363
logger.setLevel(self.log_level)

tests/e2e/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
def run_server():
1919
procs = []
2020

21-
def _run(transport, endpoint):
21+
def _run(transport, endpoint, version="1.0.0"):
2222
cmd = [
2323
"uv",
2424
"run",
@@ -28,6 +28,8 @@ def _run(transport, endpoint):
2828
transport,
2929
"--endpoint",
3030
endpoint,
31+
"--version",
32+
version,
3133
]
3234

3335
proc = subprocess.Popen(cmd, preexec_fn=os.setsid)

tests/e2e/test_conncurrent_a2a.py

Whitespace-only changes.

tests/server/__server__.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
from agntcy_app_sdk.factory import TransportTypes
1919
from agntcy_app_sdk.factory import AgntcyFactory
2020

21-
factory = AgntcyFactory(enable_tracing=False)
21+
factory = AgntcyFactory(enable_tracing=True)
2222

2323

24-
async def main(transport_type: str, endpoint: str, block: bool = True):
24+
async def main(transport_type: str, endpoint: str, version="1.0.0", block: bool = True):
2525
"""
2626
This is a simple example of how to create a bridge between an A2A server and a transport.
2727
It creates a Hello World agent and sets up the transport to communicate with it.
@@ -38,7 +38,7 @@ async def main(transport_type: str, endpoint: str, block: bool = True):
3838
name="Hello World Agent",
3939
description="Just a hello world agent",
4040
url="http://localhost:9999/",
41-
version="1.0.0",
41+
version=version,
4242
defaultInputModes=["text"],
4343
defaultOutputModes=["text"],
4444
capabilities=AgentCapabilities(streaming=True),
@@ -83,6 +83,12 @@ async def main(transport_type: str, endpoint: str, block: bool = True):
8383
default="localhost:4222",
8484
help="Endpoint for the transport (default: localhost:4222)",
8585
)
86+
parser.add_argument(
87+
"--version",
88+
type=str,
89+
default="1.0.0",
90+
help="Version of the agent (default: 1.0.0)",
91+
)
8692
parser.add_argument(
8793
"--non-blocking",
8894
action="store_false",
@@ -92,4 +98,4 @@ async def main(transport_type: str, endpoint: str, block: bool = True):
9298

9399
args = parser.parse_args()
94100

95-
asyncio.run(main(args.transport, args.endpoint, args.block))
101+
asyncio.run(main(args.transport, args.endpoint, args.version, args.block))

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)