Skip to content

test(fixtures): add self-contained openai-default test system YAML - #36

Open
Karn2898 wants to merge 3 commits into
extra-org:mainfrom
Karn2898:docs/provider-summary
Open

test(fixtures): add self-contained openai-default test system YAML#36
Karn2898 wants to merge 3 commits into
extra-org:mainfrom
Karn2898:docs/provider-summary

Conversation

@Karn2898

Copy link
Copy Markdown

Summary

Add a minimal, validating agent system under tests/fixtures/ for exercising the platform without the flagship example.

  • tests/fixtures/test_system.yaml: root orchestrator routing to greeting_agent and echo_agent, with a shared resolver and an echo_tool.
  • Defaults to the openai provider so it runs without an Anthropic key; any of anthropic/openai/gemini/bedrock is selectable via provider:.
  • A comment in the YAML makes explicit that the matching API key is supplied via the environment (OPENAI_API_KEY, etc.), never in the YAML. agentctl validate needs no key; agentctl run/serve need a key for the chosen provider.
  • Prompts, resolver stubs, and the echo_tool stub are implemented so agentctl validate passes fully offline.

Verification

agentctl validate tests/fixtures/test_system.yaml
# => validation passed

Add a minimal, validating agent system under tests/fixtures/ for exercising
the platform without the flagship example.

- test_system.yaml defaults to the openai provider so it runs without an
  Anthropic key; any of anthropic/openai/gemini/bedrock is selectable via
  provider:. A comment makes explicit that the key is supplied via the
  environment, never in YAML.
- Prompts, resolver stubs, and the echo_tool stub are implemented so
  agentctl validate passes fully offline (no LLM key required).
@AmitAvital1

Copy link
Copy Markdown
Collaborator

This is look greate example. but can you elaborate more how we running this test as system tests? how its should work? what makes you did it? (really helpfull question also for us to understand how to improve)

Thanks

@Asaf-prog Asaf-prog assigned Asaf-prog and Karn2898 and unassigned Asaf-prog Jul 21, 2026
@Karn2898

Copy link
Copy Markdown
Author

This is look greate example. but can you elaborate more how we running this test as system tests? how its should work? what makes you did it? (really helpfull question also for us to understand how to improve)

Thanks

honestly this PR only adds the fixture , i doesn't include the test yet .
this fixture gives us everything a system test would need, but there is no pytest that actually runs the full flow against it. the good news is that the engine already supports this kind of system test.tests/engine/test_engine_flow.py already follows the pattern, it injects a fake model_factory into LangGraohEngine which returns a FakeChatModel. This fake model simulates a tool call and a final response so there is no API key or network dependency.

this fixture would be pretty straight forwrd: load tests/fixtures/test_system.yaml and build the engine with fake model_factory, then send hello and verify it routes root router to greeting agent . send echo test and verify it routes root router to echo agent .
I left that test out of this PR intentionally. My goal here was to validate the fixture first and the engine test also touches multiple internals, so I felt it deserved its own focused PR.If you are happy with the approach I can add it next.

@AmitAvital1

Copy link
Copy Markdown
Collaborator

This is look greate example. but can you elaborate more how we running this test as system tests? how its should work? what makes you did it? (really helpfull question also for us to understand how to improve)
Thanks

honestly this PR only adds the fixture , i doesn't include the test yet . this fixture gives us everything a system test would need, but there is no pytest that actually runs the full flow against it. the good news is that the engine already supports this kind of system test.tests/engine/test_engine_flow.py already follows the pattern, it injects a fake model_factory into LangGraohEngine which returns a FakeChatModel. This fake model simulates a tool call and a final response so there is no API key or network dependency.

this fixture would be pretty straight forwrd: load tests/fixtures/test_system.yaml and build the engine with fake model_factory, then send hello and verify it routes root router to greeting agent . send echo test and verify it routes root router to echo agent . I left that test out of this PR intentionally. My goal here was to validate the fixture first and the engine test also touches multiple internals, so I felt it deserved its own focused PR.If you are happy with the approach I can add it next.

Very good plan! We really need this benefit. we already have issue #24 and this is great improvment.
How sound make this PR as infra for this issue? with couple infra test, and infra so any commit can be extended? and maybe next PR you can do more e2e tests cases

@Karn2898

Copy link
Copy Markdown
Author

This is look greate example. but can you elaborate more how we running this test as system tests? how its should work? what makes you did it? (really helpfull question also for us to understand how to improve)
Thanks

honestly this PR only adds the fixture , i doesn't include the test yet . this fixture gives us everything a system test would need, but there is no pytest that actually runs the full flow against it. the good news is that the engine already supports this kind of system test.tests/engine/test_engine_flow.py already follows the pattern, it injects a fake model_factory into LangGraohEngine which returns a FakeChatModel. This fake model simulates a tool call and a final response so there is no API key or network dependency.
this fixture would be pretty straight forwrd: load tests/fixtures/test_system.yaml and build the engine with fake model_factory, then send hello and verify it routes root router to greeting agent . send echo test and verify it routes root router to echo agent . I left that test out of this PR intentionally. My goal here was to validate the fixture first and the engine test also touches multiple internals, so I felt it deserved its own focused PR.If you are happy with the approach I can add it next.

Very good plan! We really need this benefit. we already have issue #24 and this is great improvment. How sound make this PR as infra for this issue? with couple infra test, and infra so any commit can be extended? and maybe next PR you can do more e2e tests cases

apologies for the late reply , Want me to draft the infra patch now ? I'm working on that already btw

@AmitAvital1

Copy link
Copy Markdown
Collaborator

This is look greate example. but can you elaborate more how we running this test as system tests? how its should work? what makes you did it? (really helpfull question also for us to understand how to improve)
Thanks

honestly this PR only adds the fixture , i doesn't include the test yet . this fixture gives us everything a system test would need, but there is no pytest that actually runs the full flow against it. the good news is that the engine already supports this kind of system test.tests/engine/test_engine_flow.py already follows the pattern, it injects a fake model_factory into LangGraohEngine which returns a FakeChatModel. This fake model simulates a tool call and a final response so there is no API key or network dependency.
this fixture would be pretty straight forwrd: load tests/fixtures/test_system.yaml and build the engine with fake model_factory, then send hello and verify it routes root router to greeting agent . send echo test and verify it routes root router to echo agent . I left that test out of this PR intentionally. My goal here was to validate the fixture first and the engine test also touches multiple internals, so I felt it deserved its own focused PR.If you are happy with the approach I can add it next.

Very good plan! We really need this benefit. we already have issue #24 and this is great improvment. How sound make this PR as infra for this issue? with couple infra test, and infra so any commit can be extended? and maybe next PR you can do more e2e tests cases

apologies for the late reply , Want me to draft the infra patch now ? I'm working on that already btw

Yea when ever you ready for review, push it inside this PR i would love to see it ! 🥇

@Karn2898

Karn2898 commented Jul 26, 2026 via email

Copy link
Copy Markdown
Author

Comment thread tests/fixtures/utils.py
@@ -0,0 +1,111 @@
from __future__ import annotations

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

maybe lets call this file utils?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

sure

Comment thread tests/fixtures/utils.py


FIXTURE_DIR = Path(__file__).resolve().parent
FIXTURE_SPEC = FIXTURE_DIR / "test_system.yaml"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

maybe lets do it injectable? think about we will added more yamls for tests in your infra

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

That's a good point . I have made changes ,just need to push

temperature: 0.0

execution:
max_iterations: 10

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

what about test for all of this configurations?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I added test_fixture_execution_policy_parsed_from_yaml which loads the spec from YAML and asserts all five fields (max_iterations, max_tool_calls, max_tool_calls_per_agent, max_child_agent_calls, allow_duplicate_tool_calls) match what's in the file. This guards against silent parser/schema changes dropping or misparsing those values. Not testing runtime enforcement here because tests/engine/test_execution_limits.py already covers that with inline specs; this fixture test just guarantees the YAML wiring is correct.

@AmitAvital1 AmitAvital1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice work. can we also test generate?

@AmitAvital1

Copy link
Copy Markdown
Collaborator

I see it that infra and support.py will be the infra, and test_yaml with generated files will be in dedicated folder that run this tests infra, and then we will add more folder with more yaml.. that extensabily more!

- test_system.yaml: small openai-default fixture with auto:true on tool-using agent
- prompts/ + plugins/: implemented stubs so agentctl validate passes offline
- utils.py: shared FakeChatModel, fake_model_factory, load_test_system, FakeEngine
- test_infra.py: 5 core tests covering validation, build, routing, tools, resolvers
- test_engine_flow.py: dedup FakeChatModel into tests.fixtures.utils

Closes the shared-module import collision with an autouse cleanup fixture.
@Karn2898

Copy link
Copy Markdown
Author

I see it that infra and support.py will be the infra, and test_yaml with generated files will be in dedicated folder that run this tests infra, and then we will add more folder with more yaml.. that extensabily more!

yep ,that's definetly a better structure , I have applied these changes

@AmitAvital1

Copy link
Copy Markdown
Collaborator

I see it that infra and support.py will be the infra, and test_yaml with generated files will be in dedicated folder that run this tests infra, and then we will add more folder with more yaml.. that extensabily more!

yep ,that's definetly a better structure , I have applied these changes

i added more comments please see :)

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.

3 participants