add: .cody/ignore integration tests in agent#2963
Conversation
| // Ignore all non-file URIs | ||
| // Remote context (e.g. unified, multi-repo) are filtered during sync time, | ||
| // and not ignored by clients. | ||
| if (uri.scheme === 'https') { |
There was a problem hiding this comment.
Without this, the 'chat/submitMessage (addEnhancedContext: true, multi-repo test)' test would fail as we will remove ALL context returned from the remote host. Thanks olaf for spotting this!
|
@abeatrix This will be great to get tests in place for. Currently this is validating that the ignore worked by asserting on the outputs, however what we are trying to protect against is adding ignored content to the input. This snippet shows how you can get access to the requests that were sent. Adding assertions to the content sent to the llm would provide a much higher level of confidence with this feature. |
Thanks for pointing me in the right direction to test this feature reliably! I will work on adding assertions to check the content sent in network requests. @chwarwick should I keep what I have here now for asserting on the output, or do you think it'd be unnecessary? |
I think they good to leave since it covers the expectations of what the output will be including the post processing steps. For example if running autocomplete in an ignored file started returning errors instead of empty responses that would be visible. |
| // Join all the string from each groupedMsgs[] together into | ||
| // one block of text, and then check if it contains the ignored file name | ||
| // to confirm context from the ignored file was not sent to the server. | ||
| const groupedText = groupedMsgs.flat().join(' ') |
There was a problem hiding this comment.
Sure, if we find something better in the future we can update it. As long as we know it catches the failure condition I think it's a positive.
DanTup
left a comment
There was a problem hiding this comment.
It looks reasonable to me, but I'm not too familiar with the code or the agent tests so I'll defer to others for this :)
Part of https://github.com/sourcegraph/cody/issues/2920
Summary:
check/isCodyIgnoredFilerequest handler to check if a file path is being ignored by CodyThis PR adds integration tests for the following features to agent:
Local context source covered in the test:
Also updated to allow remote context which should be filtered during sync time (https://github.com/sourcegraph/sourcegraph/pull/59836) to allow support for multi-repo context in clients.
Follow-Up Works
Test plan
Green bots means 👍