Skip to content

Add TaskGroup testing example for basic_task_group agent#1148

Open
kath0la wants to merge 2 commits intomainfrom
kat/add-test-for-basic-task-group
Open

Add TaskGroup testing example for basic_task_group agent#1148
kath0la wants to merge 2 commits intomainfrom
kat/add-test-for-basic-task-group

Conversation

@kath0la
Copy link
Contributor

@kath0la kath0la commented Mar 18, 2026

Description

Add a reference test file demonstrating how to test TaskGroup-based
agents using FakeLLM and the testing best practices from the docs (there
is a docs PR adding some guidelines for writing tests for task groups
and I'd like to link to an example test.)

Tests cover:

  • Each task (CollectNameTask, CollectEmailTask) in isolation
  • Sequential TaskGroup flow with onTaskCompleted callbacks
  • summarizeChatCtx producing a history summary
  • Single, repeated, and cross-task regressions via out_of_scope

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

Testing

pnpm install
pnpm build
pnpm test examples/src/testing/*

There is a docs PR adding some guidelines for writing tests for
task groups and I'd like to link to an example test.
@changeset-bot
Copy link

changeset-bot bot commented Mar 18, 2026

⚠️ No Changeset found

Latest commit: a1c4d58

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@kath0la kath0la requested a review from toubatbrian March 18, 2026 22:56
@kath0la
Copy link
Contributor Author

kath0la commented Mar 18, 2026

@toubatbrian If there's another test I can refer to or update, let me know. I wanted to link to a test for an agent that we can also link to as an example usage of TaskGroup.

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

Copy link
Contributor

@toubatbrian toubatbrian left a comment

Choose a reason for hiding this comment

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

lg!

@toubatbrian
Copy link
Contributor

@toubatbrian If there's another test I can refer to or update, let me know. I wanted to link to a test for an agent that we can also link to as an example usage of TaskGroup.

I think this one is pretty good tho, what specific format are you expecting to have?

@kath0la
Copy link
Contributor Author

kath0la commented Mar 19, 2026

@toubatbrian If there's another test I can refer to or update, let me know. I wanted to link to a test for an agent that we can also link to as an example usage of TaskGroup.

I think this one is pretty good tho, what specific format are you expecting to have?

@toubatbrian If you think this is good, then I'll just merge it! I wanted an example that was well documented in code, and that demonstrated the best practices mentioned in the docs. Thank you!

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