Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enterprise Cody Ignore: E2E test #4090

Merged
merged 10 commits into from May 15, 2024
Merged

Conversation

philipp-spiess
Copy link
Member

@philipp-spiess philipp-spiess commented May 8, 2024

This PR adds E2E tests for the cody ignore logic.

It currently does not test @-mention related behavior as well as the repo picker but since I’m focusing on the latecy issues, I thought it's better to get this test merged into main rather than waiting for the rest.

Test plan

  • CI green

@philipp-spiess
Copy link
Member Author

@dominiccooney This PR is still missing some stuff and I wasn’t able to wrap it up but if you can get to it before I’m back, feel free to commandeer.

  • I’m currently investigating why alt+\\ doesn’t trigger a manual completion (it works in “headed” mode of course)
  • We still need the chat related tests: @-mention and context-picker

@philipp-spiess
Copy link
Member Author

and cc @valerybugakov in case you have availability

@philipp-spiess
Copy link
Member Author

@valerybugakov @dominiccooney Took a quick look as to why the tests are failing. Turns out during the E2E test, we don't run in test or dev mode of the extension and thus the command we use to overwrite cody ignore doesn't seem to be working. I wonder if instead of using the overwrite command we shouldn't just mock the CodyIgnore API instead. Will try this out!

@philipp-spiess philipp-spiess requested a review from a team May 13, 2024 11:48
@philipp-spiess philipp-spiess marked this pull request as ready for review May 13, 2024 11:48
@philipp-spiess
Copy link
Member Author

@dominiccooney @valerybugakov Can I give you a friendly nudge to take a look at this? 🙂

Copy link
Contributor

@dominiccooney dominiccooney left a comment

Choose a reason for hiding this comment

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

Awesome, thank you for circling back to finish this! 🎉

lib/shared/src/sourcegraph-api/graphql/client.ts Outdated Show resolved Hide resolved
return INCLUDE_EVERYTHING_CONTEXT_FILTERS
}

const response =
await this.fetchSourcegraphAPI<APIResponse<ContextFiltersResponse | null>>(
CONTEXT_FILTERS_QUERY
)
console.log({ response })
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems nice to log this with a bit more detail, since it only happens hourly.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we're already logging the result of this in the context filter provider (so whenever we update the policy we'll see it in the debug logs). This was just me doing console.log debugging while figuring out how to mock these in the E2E test 😫

Co-authored-by: Dominic Cooney <dominic.cooney@sourcegraph.com>
@philipp-spiess philipp-spiess merged commit cf2f91b into main May 15, 2024
19 checks passed
@philipp-spiess philipp-spiess deleted the ps/cody-ignore-enterprise-e2e branch May 15, 2024 15:57
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.

None yet

2 participants