-
Notifications
You must be signed in to change notification settings - Fork 6k
feat(e2e): add support running behind proxy #5348
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
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May reverse proxies never break again! 🥂
test/utils/helpers.ts
Outdated
*/ | ||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😂 i'll fix locally, no worries. i didn't realize that either
Co-authored-by: Asher <[email protected]>
Co-authored-by: Asher <[email protected]>
Co-authored-by: Asher <[email protected]>
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
Caddyfile
address()
method in e2e model to work with reverse-proxyUSE_PROXY
env var used in e2e tests and scriptsFixes #5337