sourcegraph/dev/authtest
Sander Ginn 841bd670a5
executors: refactor queue router to explicit test endpoint (#49721)
- Closes https://github.com/sourcegraph/sourcegraph/issues/49718

This PR refactors the base test router of the executor queue handler to
an explicit `/test` endpoint, and adds a path `/auth` for testing
authorization.

It updates `code_intel_test.go` to make use of this new endpoint.

## Test plan
- [x] Existing and child PRs tests pass
- [x] Tested on scaletesting
   ```shell
root@sginn-sourcegraph-executor-x1z5:/usr/local/bin# echo
$EXECUTOR_FRONTEND_PASSWORD
   <REDACTED>
root@sginn-sourcegraph-executor-x1z5:/usr/local/bin# echo
$EXECUTOR_FRONTEND_URL
   https://scaletesting.sgdev.org
root@sginn-sourcegraph-executor-x1z5:/usr/local/bin# executor validate
   All checks passed!
   
root@sginn-sourcegraph-executor-x1z5:/usr/local/bin# export
EXECUTOR_FRONTEND_PASSWORD=denied
root@sginn-sourcegraph-executor-x1z5:/usr/local/bin# executor validate
t=2023-03-24T17:42:57+0000 lvl=eror msg="apiclient got unexpected status
code" code=401 body=
failed to authorize with frontend, is executors.accessToken set
correctly in the site-config?
   
root@sginn-sourcegraph-executor-x1z5:/usr/local/bin# export
EXECUTOR_FRONTEND_URL=scaletesting.sgdev.org
root@sginn-sourcegraph-executor-x1z5:/usr/local/bin# executor validate
EXECUTOR_FRONTEND_URL must be in the format scheme://host (and
optionally :port)
   ```

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->

---------

Co-authored-by: Daniel Dides <8784265+danieldides@users.noreply.github.com>
2023-03-24 18:11:13 +00:00
..
BUILD.bazel bazel: fix buf files (#49444) 2023-03-15 20:21:38 +00:00
code_intel_test.go executors: refactor queue router to explicit test endpoint (#49721) 2023-03-24 18:11:13 +00:00
CODENOTIFY authtest: add tests for site admin endpoints (#20266) 2021-04-26 13:14:57 +00:00
main_test.go all: use any instead of interface{} (#35102) 2022-05-09 10:59:39 +02:00
organization_test.go [Org Members] Add pagination (#46067) 2023-01-17 12:25:22 +01:00
README.md authtest: wait longer for site config to be updated (#28119) 2021-11-29 22:26:45 +08:00
repository_test.go graphqlbackend: support async deletion of external service (#35293) 2022-05-12 12:54:12 +04:00
site_admin_test.go codeintel: Update auth test to target new (preferred) resolver (#49524) 2023-03-16 10:31:11 -05:00

While this test suite focuses on authentication and authorization related tests, you may still refer to dev/gqltest's README for background and how to run it both locally and in CI.