Add AGENTS.md with AssertJ/JUnit5 test migration guidelines - #3728
Conversation
d65df74 to
d7b53b7
Compare
|
I'm glad to see an AGENTS.md file added, this is great. This is a LOT of context about writing unit tests, which is also great. But it might be too much context for the agent to always have, even when doing things not related to unit tests. A pattern I've found very useful is to create some agent-specific documentation in a separate file and add a pointer to that in AGENTS.md. Then the agent always has the context of where to find the information when it needs it. Something like that |
divjotarora
left a comment
There was a problem hiding this comment.
Thanks for working on this @nastra!
There was a problem hiding this comment.
I agree with @dossett that this is likely too much testing-specific info in a top-level AGENTS.md. The suggestion to move it to a separate file that can lazy loaded only when writing tests sounds reasonable. Additionally, we're mixing a lot of information about writing new tests vs. migrating existing ones. Perhaps it would make sense to separate these? Even if all of this info goes into a TESTING_GUIDELINES.md file or something but in separate sections, it would be more readable.
Lastly, there's a few "MUST" rules in here (e.g. every assertThatThrownBy must contain an isInstanceOf chain + msg check). Do we have linter rules for these rather than just putting them in agent guidelines?
Rationale for this change
This adds guidelines that I've been defining/using for Claude when migrating the entire codebase from JUnit4 to JUnit5 + AssertJ
What changes are included in this PR?
An AGENTS.md file that contains migration guidelines
Are these changes tested?
Are there any user-facing changes?