Skip to content

update agent doc to cover more on tests + include it in review CI scope #14197

Merged
yiyixuxu merged 5 commits into
mainfrom
agent-docs-test-mocks
Jul 16, 2026
Merged

update agent doc to cover more on tests + include it in review CI scope #14197
yiyixuxu merged 5 commits into
mainfrom
agent-docs-test-mocks

Conversation

@yiyixuxu

@yiyixuxu yiyixuxu commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

(1) adding a note on create dummy components for test, since this is second time seeing these patterns https://github.com/huggingface/diffusers/pull/14181/changes#r3589666970

(2) I just realized our review agent (both the self-review skill and claude CI) are prompted not to review test files, so I updated the scope to include tests

(3) I noticed agents does not know how to run single modular block correctly -> they tends to create a state and pass it to block directly; so I added a notes on that too, a single block should also be turn into a pipeline with init_piepline and then it can be run directly with input etc

…s, not mocks

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@yiyixuxu yiyixuxu requested review from dg845 and sayakpaul July 15, 2026 18:17
@github-actions github-actions Bot added the size/S PR with diff < 50 LOC label Jul 15, 2026
…ule to skill only

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@yiyixuxu yiyixuxu changed the title Add agent-doc gotcha: build pipeline test components from real classe… update agent doc to cover more on tests Jul 15, 2026
…ew scope

Move the Testing section out of the model-integration skill into a
standalone .ai/testing.md so it loads in both the authoring and review
flows, add it to review-rules' reading list and the reference guides,
extend the mock rule to call-level doubles (monkeypatched component
methods), and widen the @claude CI reviewer's review scope to tests/
(edit/commit scope unchanged).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions github-actions Bot added CI size/M PR with diff < 200 LOC and removed size/S PR with diff < 50 LOC labels Jul 15, 2026
@yiyixuxu yiyixuxu changed the title update agent doc to cover more on tests update agent doc to cover more on tests + include it in review CI scope Jul 15, 2026
- modular.md: new 'Running a modular pipeline' section — init_pipeline()/
  load_components()/output= usage, from_blocks_dict composition,
  update_components() for config values, and the anti-pattern of calling
  blocks directly with a hand-built PipelineState
- testing.md: modular block tests run through the pipeline API and assert
  on outputs; tiny repos must mirror the real checkpoint's shape (per-variant
  repos when configs differ); bespoke tests live on the tester class
- pipelines.md: callback_kwargs must be built with a loop — locals() inside
  a dict comprehension sees the comprehension's scope and always KeyErrors

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread .ai/modular.md Outdated
Comment thread .ai/testing.md Outdated
Comment thread .ai/testing.md Outdated
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
@yiyixuxu yiyixuxu merged commit 4856109 into main Jul 16, 2026
15 of 16 checks passed
@yiyixuxu yiyixuxu deleted the agent-docs-test-mocks branch July 16, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI size/M PR with diff < 200 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants