sourcegraph / cody

AI that knows your entire codebase
https://cody.dev
Apache License 2.0
2.24k stars 213 forks source link

Provide a template for local e2e tests for local development purposes. #4643

Open jhchabran opened 1 week ago

jhchabran commented 1 week ago

See the README.md for more details about why this exists. See DINF-37.

Fixes CODY-2029

We added a new sg db subcommand to provide a default site-admin so we go around dealing with obtaining an access token. Instead, we can assume that everyone has that default one in their local setup.

Need sister PR (https://github.com/sourcegraph/sourcegraph/pull/63548) to land, as it depends on a new commandset (i.e. sg start cody-e2e-tests)

💭 For the CodyGW settings, @vdavid could you take a look? All of this works on my side, but I might be missing some side-effects with regards to the configuration, and you might also have suggestions to make on the "advice" side in the README.md

⚠️ Reviewers: I'm not very familiar with TS, if you see something really not idiomatic, it might be faster to push a commit than spending time telling me what's wrong in the comments (though I'm okay otherwise).

Example of the output this provides, when for example it detects incorrect settings in the site-config of the locally running Sourcegraph instance.

image

TODO:

Thanks to @Strum355 for pairing with me to debug various nasty local env issues.

Test plan

Tested locally in various scenarios.