Repository navigation
feat(e2e): add support running behind proxy - #5348
Conversation
|
✨ code-server docs for PR #5348 is ready! It will be updated on every commit.
|
Codecov Report
@@ Coverage Diff @@
## main #5348 +/- ##
=======================================
Coverage 72.42% 72.42%
=======================================
Files 30 30
Lines 1672 1672
Branches 366 366
=======================================
Hits 1211 1211
Misses 398 398
Partials 63 63 Continue to review full report at Codecov.
|
|
Need to figure out Caddyfile issues. Opened forum post here: https://caddy.community/t/automatically-forward-subpath-to-port-on-localhost/16629 Oddly enough: {
admin localhost:4444
}
:8000/*/ide/* {
handle {
respond "hello world" 200
}
}Doesn't work with http://localhost:8000/8080/ide/hi so something is up |
We don't need the submodules for the e2e job. This will speed up the checkout step.
This adds a new job to CI to run our tests behind Caddy and simulate code-server running against a reverse-proxy.
This refactors the e2e test in a couple ways: - remove setting cookie in localStorage (instead we pass --auth none) - refactor address() method to account for reverse proxy logic
a223de2 to
070a328
Compare
code-asher
left a comment
There was a problem hiding this comment.
May reverse proxies never break again! 🥂
| */ | ||
| export async function getMaybeProxiedCodeServer(codeServer: CodeServerPage | CodeServer): Promise<string> { | ||
| let address = await codeServer.address() | ||
| if (process.env.USE_PROXY && process.env.USE_PROXY === "1") { |
There was a problem hiding this comment.
nit: we could do with just the latter check
| if (process.env.USE_PROXY && process.env.USE_PROXY === "1") { | |
| if (process.env.USE_PROXY === "1") { |
There was a problem hiding this comment.
Ooops sorry my suggestion removed the indent, I keep forgetting copy does not copy the indent and I have to add it back in manually.
There was a problem hiding this comment.
😂 i'll fix locally, no worries. i didn't realize that either
Co-authored-by: Asher <ash@coder.com>
Co-authored-by: Asher <ash@coder.com>
Co-authored-by: Asher <ash@coder.com>
Description
This PR adds a new job to run our end-to-end tests behind a reverse-proxy (with Caddy) to simulate how code-server runs in coder/coder and in many community-member deployments.
Changes
Caddyfileaddress()method in e2e model to work with reverse-proxyUSE_PROXYenv var used in e2e tests and scriptsFixes #5337