Commit Graph

449 Commits

Author SHA1 Message Date
Joe Previte
6e1455da88
feat: add custom codecov 2021-06-28 11:41:48 -07:00
Joe Previte
b597519ab5
feat(test): add tests for src/browser/login 2021-06-28 11:41:48 -07:00
Joe Previte
02b9489489
refactor: add func getNlsConfiguration & tests
This PR refactors part of vscode.ts and adds a function to get the NLS
Configuration.

This makes the code more readable and easier to test.

And it adds multiple tests for this part of the codebase.
2021-06-23 13:42:06 -07:00
Max Schmitt
dbb34ad710 chore: upgrade to Playwright 1.12 with its new test-runner 2021-06-10 15:09:38 +02:00
Joe Previte
1e55a648a5
feat: check for empty str in isHashMatch 2021-06-08 15:10:59 -07:00
Joe Previte
3b50bfc17d
fix: sanitize password and cookie key 2021-06-08 14:33:17 -07:00
Joe Previte
8c2bb61af9
refactor: parse options with multiple = in cli
There was a case with the hashed-password which had multiple equal signs in the
value and it wasn't being parsed correctly. This uses a new function and adds a
few tests.
2021-06-08 14:33:17 -07:00
Joe Previte
531b7c0c25
feat: add splitOnFirstEquals function 2021-06-08 14:33:16 -07:00
Joe Previte
517aaf71c5
docs: update FAQ with new hashing instructions 2021-06-08 14:33:16 -07:00
Joe Previte
6020480b30
feat: add isCookieValid function and tests 2021-06-08 14:33:16 -07:00
Joe Previte
a14ea39c4a
feat: add handlePasswordValidation + tests 2021-06-08 14:33:15 -07:00
Joe Previte
7ff4117531
feat: add getPasswordMethod & test for it 2021-06-08 14:33:15 -07:00
Joe Previte
ffa5c16e51
feat: update cli and test for hashed-password 2021-06-08 14:33:15 -07:00
Joe Previte
788b958e20
refactor: update hash fn in test config 2021-06-08 14:33:14 -07:00
Joe Previte
fd3cb6cfa0
refactor: update unit tests for hash fns
Since the hash and isHashMatch are now async, I had to update the tests
accordingly. Now everything is working.
2021-06-08 14:33:13 -07:00
Joe Previte
51f8341959
chore: update to argon2 in test 2021-06-08 14:33:13 -07:00
Joe Previte
fc3326f1f2
feat: add tests using real hashes 2021-06-08 14:33:12 -07:00
Joe Previte
aaf044728f
refactor: add functions to check hash password 2021-06-08 14:33:12 -07:00
Joe Previte
f35120c0a3
feat: add unit test for hash function 2021-06-08 14:33:12 -07:00
Joe Previte
17be8c5cd3
refactor: use bcrypt in e2e setup 2021-06-08 14:33:12 -07:00
dependabot[bot]
0832df1a3f
chore(deps): bump ws from 7.4.2 to 7.4.6 in /test (#3510)
Bumps [ws](https://github.com/websockets/ws) from 7.4.2 to 7.4.6.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.4.2...7.4.6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-31 20:12:53 +05:30
dependabot[bot]
20874c1833
chore(deps): bump browserslist from 4.16.4 to 4.16.6 in /test
Bumps [browserslist](https://github.com/browserslist/browserslist) from 4.16.4 to 4.16.6.
- [Release notes](https://github.com/browserslist/browserslist/releases)
- [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/browserslist/browserslist/compare/4.16.4...4.16.6)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-24 21:28:37 +00:00
Joe Previte
46fe77d464
chore: update CHANGELOG 2021-05-13 12:10:22 -07:00
Joe Previte
2a657ab930
feat: add tests for getEnvPaths 2021-05-13 12:10:21 -07:00
Akash Satheesan
adc9b57080
chore: reformat with new prettier 2021-05-12 01:14:04 +05:30
dependabot[bot]
65c2510faa
chore(deps): bump hosted-git-info from 2.8.8 to 2.8.9 in /test (#3312)
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-08 00:04:25 +05:30
Asher
4f320ad3e0
Merge pull request #3297 from code-asher/test-static 2021-05-06 18:24:44 -05:00
Asher
e8443e2602
Fix helpers not working in e2e tests
It errors that jest is not defined so put it behind a function instead
of immediately creating the mock (this is probably a better pattern
anyway).

The constant tests had to be reworked a little. Since the logger mock is
hoisted it runs before createLoggerMock is imported. I moved it into a
beforeAll which means the require call also needed to be moved
there (since we need to mock the logger before requiring the constants
or it'll pull the non-mocked logger).

This means getPackageJson needs to be a let and assigned afterward. To
avoid having to define a type for getPackageJson I just added a let var
set to the type of the imported constants file and modified the other
areas to use the same paradigm.

I also replaced some hardcoded strings with the mocked package.json
object.
2021-05-06 15:01:35 -05:00
dependabot[bot]
14dbd16a7a
chore(deps): bump lodash from 4.17.20 to 4.17.21 in /test (#3300)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.20...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-07 01:30:47 +05:30
Asher
ad4a70c684
Use warn log level for integration tests
Just to limit all the noise from code-server's startup output.
2021-05-06 14:27:16 -05:00
Asher
4925e97080
Add static route tests 2021-05-06 14:27:11 -05:00
Asher
1789cd1bcb
Move temp test dirs under a tests sub-directory
This is to match the other tests that create temp directories. It also
lets you clean up test temp directories all at once separately from
other non-test temporary directories.
2021-05-06 14:25:51 -05:00
Asher
52cf2fcf29
Move tmpdir test helper to test helpers file 2021-05-06 14:25:50 -05:00
Asher
0e4672f6b9
Move health route tests to routes directory 2021-05-06 14:25:49 -05:00
Joe Previte
cb5ab48d48
fix: coveragePathIgnorePatterns to /out
We were accidentally ignoring `node/routes` because we had "out"
instead of "/out" in `coveragePathIgnorePatterns` which caused
us to not collect coverage for those files. Now we do.
2021-05-06 11:53:17 -07:00
Joe Previte
027106a5e1
feat(testing): add test for constants "version" and commit 2021-05-05 15:34:48 -07:00
Asher
a882be5748
Refactor integration tests to use main entry point 2021-05-05 12:24:41 -05:00
Asher
083400b50a
Add flag to enable permessage-deflate 2021-05-05 12:24:34 -05:00
Asher
8b2c78c4a4
Re-enable update tests 2021-05-04 13:29:42 -05:00
Asher
10babb4a0c
Replace console with logger in sw register 2021-05-04 13:29:41 -05:00
Asher
a48ac5080b
Share common util code with VS Code
This lets us re-use the normalized base path so when we expire/clear the
cookie we use the same base path.
2021-05-04 13:29:40 -05:00
Joe Previte
8e6c10e7ff
Merge pull request #3263 from cdr/jsjoeio/fix-e2e-test
fix(testing): reduce flakiness of terminal.test.ts and use 1 worker for e2e tests
2021-04-30 15:38:32 -07:00
Joe Previte
cde30579c4
refactor: change to reloadUntilEditorIsReady 2021-04-30 13:44:16 -07:00
Joe Previte
2cb499385a
feat: add isConnected method to CodeServer model 2021-04-30 13:36:46 -07:00
Joe Previte
7309ea9d10
fix(e2e): use one worker to reduce flakiness 2021-04-29 16:27:19 -07:00
Joe Previte
17f4c4c330
fix(e2e): remove quotes from terminal type command 2021-04-29 16:22:21 -07:00
Joe Previte
d07317ad01
docs: add maintaining.md with workflow 2021-04-28 11:25:25 -07:00
Joe Previte
449c6da77c
refactor: add timeout to terminal.test.ts 2021-04-27 14:35:31 -07:00
Joe Previte
8c727d96d6
refactor: make CodeServer methods more stable 2021-04-27 14:35:09 -07:00
Joe Previte
07d682392e
Merge pull request #3169 from cdr/jsjoeio/add-terminal-e2e-test
feat(testing): add e2e tests for code-server and terminal
2021-04-26 15:16:06 -07:00
Joe Previte
83746c8a1f
refactor: remove null check in register.ts options.base
Inside registerServiceWorker, we were originally using the nullash coalescing
operator to check if options.base was null or undefined. However, I realized
this check is not necessary.

If you look at getOptions' return value, we return an object with a key "base"
which is of type "string". We get that value by calling resolveBase which always
returns a string.

As a result, we didn't need to check if options.base was null or undefined
because it never can be.
2021-04-23 17:09:03 -07:00
Joe Previte
7bfdd13cb3
refactor: tmpdir and add to test utils 2021-04-23 16:40:39 -07:00
Joe Previte
6f2709bcaa
feat: add tests for registerServiceWorker 2021-04-23 16:31:56 -07:00
Joe Previte
b0ecff338f
refactor: globalSetup to use CodeServer model 2021-04-23 14:35:33 -07:00
Joe Previte
cb65590b98
refactor: move tmpdir into src/node/constants 2021-04-23 14:35:32 -07:00
Joe Previte
cc99fddf24
feat: add test for terminal echo to file 2021-04-23 14:35:32 -07:00
Joe Previte
2bf0a0e76e
refactor: fix tests to check visibility correctly 2021-04-23 14:35:31 -07:00
Joe Previte
2665a4f61b
feat: add CodeServer page object for e2e tests 2021-04-23 14:35:31 -07:00
Joe Previte
f80d5c3764
refactor: rateLimiter.canTry logic to check >= 1 2021-04-19 13:14:19 -07:00
Joe Previte
958f01262b
refactor: check errorMessage in login e2e test 2021-04-19 11:11:52 -07:00
Joe Previte
a3f18d6158
refactor: change limiter.Try() to .removeToken() 2021-04-19 10:57:50 -07:00
Joe Previte
7928dc2bff
feat: add test for limiter.canTry() 2021-04-19 10:41:00 -07:00
Joe Previte
a8719e1f79
refactor: change config to save all e2e videos 2021-04-19 10:40:59 -07:00
Joe Previte
1e6f4f2a14
feat(testing): add test for rate limiter 2021-04-19 10:40:59 -07:00
Joe Previte
83cfbf82cf
feat: increase timeout for playwright tests 2021-04-19 10:40:59 -07:00
Joe Previte
faaa0a9e60
feat(testing): add e2e tests for password 2021-04-19 10:40:59 -07:00
Joe Previte
ebbabc6e04
refactor(testing): combine loginPage with login 2021-04-19 10:40:58 -07:00
Joe Previte
58e17c5e50
feat(testing): add tests for RateLimiter 2021-04-19 10:40:58 -07:00
Joe Previte
450fcd5ba7
refactor: pass all args to test-e2e script 2021-04-15 11:46:45 -07:00
Joe Previte
d6f0725399
fix: update path for e2e videos 2021-04-15 11:46:45 -07:00
Joe Previte
c9fa931a0b
fix: add retry 2 for failing e2e tests 2021-04-15 11:46:44 -07:00
Joe Previte
92b7c1e9a8
refactor: test-e2e.sh script 2021-04-15 11:46:44 -07:00
Joe Previte
6c3bb101cd
chore(deps): add resolution for newest playwright 2021-04-15 11:46:44 -07:00
Joe Previte
7ea6d22b3e
refactor: add login to config.js for e2e tests 2021-04-15 11:46:44 -07:00
Joe Previte
52586706c4
refactor: use playwright-test syntax for e2e tests 2021-04-15 11:46:43 -07:00
Joe Previte
08cd2d8191
refactor: add new e2e config 2021-04-15 11:46:43 -07:00
Joe Previte
0a090bf12b
chore(deps): add @playwright/test 2021-04-15 11:46:43 -07:00
Joe Previte
ad0f12e664
refactor: check for editor consistently in tests 2021-04-06 15:46:58 -07:00
Joe Previte
dd80eed5b0
feat: add logger to tests 2021-04-06 15:46:57 -07:00
Joe Previte
fd69f2db88
refactor: logout test 2021-04-06 15:46:57 -07:00
Joe Previte
c666b47668
refactor: globalSetup and create cookie manually 2021-04-06 15:46:56 -07:00
Joe Previte
51010e73cb
feat: add test for globalSetup 2021-04-06 15:46:56 -07:00
Joe Previte
4b703cbd4d
refactor: e2e tests based on jest-playwright 2021-04-06 15:46:56 -07:00
Joe Previte
1782f2a239
refactor: rename e2e test to loginPage 2021-04-06 15:46:56 -07:00
Joe Previte
bd55cb94be
refactor: move test dir to jest e2e config 2021-04-06 15:46:56 -07:00
Joe Previte
6b3db06c7a
feat: add new e2e test to test browser 2021-04-06 15:46:56 -07:00
Joe Previte
3db19843e2
chore: add eslint plugin for jest-playwright 2021-04-06 15:46:55 -07:00
Joe Previte
b4193b8c68
feat: add jest-playwright and packages 2021-04-06 15:46:55 -07:00
Joe Previte
9eff1f0702
fix: add timeout to logout test 2021-03-23 12:14:42 -07:00
Joe Previte
090687d057
feat: add e2e test for logout 2021-03-23 10:02:03 -07:00
Joe Previte
071c8e15fc
Merge branch 'main' into jsjoeio/upgrade-vscode-1.54 2021-03-17 13:51:27 -07:00
Joe Previte
36714da613
fixup: move openHelpAbout 2021-03-17 11:25:33 -07:00
Joe Previte
d3df963d39
Merge branch 'main' into jsjoeio/upgrade-vscode-1.54 2021-03-16 14:42:51 -07:00
Joe Previte
481dd1f1d6
fixup: rename test 2021-03-16 14:36:31 -07:00
Joe Previte
608871eba1
wip: change name back to goHome 2021-03-16 14:26:04 -07:00
Joe Previte
3d9d2e592d
refactor: add helpAbout test instead of goHome 2021-03-16 14:25:28 -07:00
Joe Previte
bcdca86539
refactor: change goHome test to helpAbout 2021-03-16 14:25:28 -07:00
Joe Previte
0c2708302d
refactor: remove --home flag/feature
We are removing this because it was removed upstream in PR~115599.
2021-03-16 14:25:28 -07:00
Asher
964ebe8d0a
Replace fs-extra with fs.promises
Remove the Mac directory copy instead of refactoring it since we've had
this for a long time now and I think it's safe to assume that users
running code-server on Mac don't have the old directory anymore.
2021-03-16 12:51:08 -05:00
Asher
f33402c503
Remove extra awaits from tests 2021-03-15 15:34:44 -05:00
Joe Previte
7e23575978
chore: update code-server path in tsconfig 2021-03-12 12:00:57 -07:00
Joe Previte
9ee2556dd1
chore: update gitignore with test dirs 2021-03-12 12:00:57 -07:00
Joe Previte
6fd30d91ea
feat: add jest e2e config 2021-03-12 12:00:57 -07:00
Joe Previte
d10da3f7c3
refactor: move test-plugin 2021-03-12 12:00:56 -07:00
Joe Previte
cf6fdb90eb
refactor: create test/utils 2021-03-12 12:00:56 -07:00
Joe Previte
b468597872
refactor: move e2e tests to test/e2e 2021-03-12 12:00:56 -07:00
Joe Previte
3f7104bb4e
refactor: move unit tests to test/unit 2021-03-12 12:00:56 -07:00
Joe Previte
925073db31
Merge pull request #2773 from cdr/upgrade-vscode-1.53
feat(vscode): update to version 1.53.2
2021-03-05 14:03:10 -07:00
Joe Previte
e47eabf375
fix: goHome test after location change 2021-03-05 11:58:17 -07:00
Joe Previte
8c14799797
refactor: add custom mock for serviceWorker test 2021-02-26 16:05:35 -07:00
Joe Previte
6b56e6572d
feat(testing): add serviceWorker tests 2021-02-26 16:00:18 -07:00
Joe Previte
46226ea26b
chore(testing): add service-worker-mock 2021-02-26 11:58:29 -07:00
Joe Previte
80a180079e
feat: add test for catching errors in Emitter 2021-02-26 11:58:29 -07:00
Joe Previte
b232dcbd4a
feat(register): add test when navigator undefined 2021-02-26 11:58:28 -07:00
Joe Previte
e6a324b484
refactor: update mocking logger in register test 2021-02-26 11:58:28 -07:00
Joe Previte
cb4185b360
refactor: use loggerModule in util 2021-02-26 11:58:28 -07:00
Joe Previte
1c737f1f93
refactor: hoist jest.mock in constants 2021-02-26 11:55:17 -07:00
Joe Previte
1470ff203a
refactor: dont use actual logger in helper 2021-02-26 11:55:17 -07:00
Joe Previte
711abd8d84
refactor: move loggerModule into helpers 2021-02-26 11:55:00 -07:00
Joe Previte
027e8e5adf
refactor: use LogModule from Asher in tests 2021-02-26 11:51:52 -07:00
Joe Previte
a44a51462c
refactor: use same syntax as logger spy 2021-02-26 11:51:52 -07:00
Joe Previte
7ef630f7a4
refactor(register): use logError instead of logger 2021-02-26 11:51:52 -07:00
Joe Previte
38891de0d9
feat(test): add test handleRegisterServiceWorker 2021-02-26 11:51:52 -07:00
Joe Previte
44b9874fbe
feat: test failure to register service worker 2021-02-26 11:51:52 -07:00
Joe Previte
06aeca0a83
feat(testing): add register test 2021-02-26 11:51:51 -07:00
Joe Previte
28b440a4ba
feat: add cssStub to jest 2021-02-26 11:51:51 -07:00
Joe Previte
4f1f2c7171
fix: clean up comment in util.test.ts 2021-02-26 11:50:27 -07:00
Joe Previte
7dbb72a9c1
Merge pull request #2648 from cdr/e2e-test-go-home
feat(testing): add e2e test for 'Go Home' button
2021-02-25 11:21:43 -07:00
Joe Previte
325a1d8181
feat: add test for catching errors in Emitter 2021-02-22 13:44:43 -07:00
Joe Previte
e0acb08d94
feat: add basic test for emitter 2021-02-22 13:44:43 -07:00
Asher
47a05c998a
Gate wtfnode behind WTF_NODE env var
After thinking about it some more it's probably mostly only useful to
see the output when the tests are hanging. Otherwise there's a lot of
noise about Jest child processes and pipes.
2021-02-22 13:41:12 -07:00
Asher
6685b3a4ff
Move wtfnode setup to global setup
I think Jest provides separate console methods for each test so when the
socket tests finish Jest complains that a test keeps trying to output.
2021-02-22 13:41:11 -07:00
Asher
ef7e7271b6
Fix unreadable wtfnode output 2021-02-22 13:41:11 -07:00
Asher
6d4f814f84
Close context before browser
This seems to resolve a warning about a process being forcefully exited.
2021-02-22 13:41:11 -07:00
Joe Previte
d61bbc4c4f
refactor(goHome): check url, remove timeout 2021-02-22 13:41:11 -07:00
Joe Previte
b0fd55463b
refactor: add constants.ts with PASSWORD, etc 2021-02-22 13:41:11 -07:00
Joe Previte
5857b25079
chore: add todo regarding storage and cookies e2e 2021-02-22 13:41:10 -07:00
Joe Previte
3fa460c244
refactor: create helpers.ts & add Cookie 2021-02-22 13:41:10 -07:00
Joe Previte
38d7718feb
refactor: use promises for goHome test 2021-02-22 13:41:10 -07:00
Joe Previte
06af8b3202
refactor: update goHome location in test 2021-02-22 13:41:10 -07:00
Joe Previte
d0eece3d8f
refactor: add note to test.sh about --home 2021-02-22 13:41:10 -07:00
Joe Previte
2dc56ad4d7
refactor: manually add cookie goHome 2021-02-22 13:41:10 -07:00
Joe Previte
b02d2fb3cc
feat: add cookie utils for e2e tests 2021-02-22 13:41:10 -07:00
Joe Previte
ffdbf3a730
feat: add test/videos & /screenshots to gitignore 2021-02-22 13:41:09 -07:00
Joe Previte
236717ee98
fix: update modulePathIgnorePatterns for jest 2021-02-22 13:41:09 -07:00
Joe Previte
34c6ec4c07
feat: add globalSetup for testing 2021-02-22 13:41:09 -07:00
Joe Previte
3033c8f9a2
feat: add test to visit go home in app menu 2021-02-22 13:41:08 -07:00
Joe Previte
c2f1a2dace
feat: add test for login page 2021-02-22 13:41:08 -07:00
Asher
2d8b785fb8
Fix health socket not getting client messages
Forgot to resume. Went ahead and did the same for the test plugin
although it only sends messages and doesn't receive any.
2021-02-16 15:01:46 -06:00
Asher
7f80d152d3
Add healthz tests 2021-02-16 15:01:45 -06:00
Asher
59ba78c028
Force shutdown sockets during tests 2021-02-16 15:01:45 -06:00
Asher
de11753569
Fill req.args for tests 2021-02-12 16:05:15 -06:00
Asher
8344e2062a
Merge pull request #2622 from cdr/plugin-additions 2021-02-10 16:45:00 -06:00
Asher
de9491d5a6
Mark code-server as a virtual module 2021-02-10 13:13:23 -06:00
Asher
4f16087a94
Resolve code-server from the root
This fixes the lint script but unfortunately breaks my editor.
2021-02-09 16:36:26 -06:00
Asher
e098df0766
Fix code-server module not being provided in Jest 2021-02-09 15:23:08 -06:00
Joe Previte
c7c851dd01
feat: add tests for src/common/http 2021-02-09 13:13:19 -07:00
Asher
9647d65e52
Add code-server alias to eslint 2021-02-09 13:33:31 -06:00
Asher
c78f56b334
Expose HttpError to plugins
This will let them throw and show nice errors more easily.
2021-02-09 13:09:38 -06:00
Asher
5505959f7e
Expose websocket server to plugins
Same reasoning used when exposing Express.
2021-02-09 13:09:34 -06:00
Asher
055e0ef9ec
Provide WsRouter to plugins 2021-02-09 13:09:27 -06:00
Asher
fb37473e72
Load only test plugin during tests
The other plugins in my path were causing the tests to fail.
2021-02-09 12:20:30 -06:00
Asher
a8e928798b
Re-export express for plugins 2021-02-09 12:19:38 -06:00
Asher
5f1fab7d27
Re-export logger field for plugins 2021-02-09 12:19:36 -06:00
Joe Previte
a2a6122252
feat: add tests for constants 2021-02-08 16:21:37 -07:00
Joe Previte
164d11e027
chore: clean up comment in util.test 2021-02-08 16:20:43 -07:00
Joe Previte
7f629c3675
Merge pull request #2671 from cdr/add-unit-tests
feat(testing): add unit tests for common/util
2021-02-08 11:32:55 -07:00
Anmol Sethi
c08e3bb06d
Add /absproxy to remove --proxy-path-passthrough
See https://github.com/cdr/code-server/issues/2222#issuecomment-765235938

Makes way more sense.
2021-02-05 11:44:34 -05:00
Joe Previte
4f6efced68
feat: add tests for getOptions 2021-02-04 15:18:44 -07:00
Joe Previte
323339d15a
feat: add jsdom for browser-ish tests 2021-02-04 15:18:43 -07:00
Joe Previte
3cebfcd447
feat: add tests for logError 2021-02-04 15:18:43 -07:00
Joe Previte
71cf459ece
feat: add tests for common/util 2021-02-04 15:18:43 -07:00
Joe Previte
6685a3e364
feat: update workflow 2021-02-01 15:11:45 -07:00
Joe Previte
66fe663e33
feat: add playwright 2021-02-01 15:11:28 -07:00
Anmol Sethi
966e9cc238
Merge pull request #2609 from cdr/proxy-res-d629
Fix body proxying, redirect proxying and add tests
2021-02-01 11:39:44 -05:00
Anmol Sethi
a60f61f9b3
proxy.test.ts: Add POST body test and redirection tests
Closes #2377
2021-02-01 11:16:52 -05:00
Anmol Sethi
d7f06975a6
test: Switch from leaked-handles to wtfnode (#2604)
See my comments at
https://github.com/cdr/code-server/pull/2563#issuecomment-763394741
2021-02-01 11:06:49 -05:00
Joe Previte
102f51ce1f
fix: surpress console log in cli test 2021-01-25 16:34:43 -07:00
Joe Previte
3044224729
feat: add support for code coverage shield 2021-01-25 16:21:07 -07:00
Joe Previte
05beccf671
refactor: move jest around and add code coverage 2021-01-22 14:18:45 -07:00
Joe Previte
883dd13850
refactor: move jest and add package.json to /test 2021-01-21 14:06:49 -07:00
Joe Previte
850c7e1a91
fix: add void for resolve in socket test 2021-01-21 10:11:10 -07:00
Joe Previte
0a07d67c8d
fix: prevent mocha/jest types conlict
Modify the tsconfig.json in lib/vscode/src/build.

This adds the flag skipLibCheck: true to tell TypeScript
to not type-check the declaration files at build time.

We need to add this because otherwise it checks the declaration
files and reports an error of duplicate type definitions
because we use Jest for our tests and they use Mocha and they
both use the global namespace "test" in their .d.ts files.
2021-01-21 10:11:09 -07:00
Joe Previte
de7d0394ae
refactor: tests from mocha to jest 2021-01-21 10:10:32 -07:00
Joe Previte
cef7d42652
feat: setup jest 2021-01-21 10:10:32 -07:00
Anmol Sethi
c32d8b155f
heart.ts: Fix leak when server closes
This had me very confused for quite a while until I did a binary search
inspection on route/index.ts. Only with the heart.beat line commented
out did my tests pass without leaking.

They weren't leaking fds but just this heartbeat timer and node of
course prints just fds that are active when it detects some sort of leak
I guess and that made the whole thing very confusing. These fds are not
leaked and will close when node's event loop detects there are no more
callbacks to run.

no of handles 3

tcp stream {
  fd: 20,
  readable: false,
  writable: true,
  address: {},
  serverAddr: null
}

tcp stream {
  fd: 22,
  readable: false,
  writable: true,
  address: {},
  serverAddr: null
}

tcp stream {
  fd: 23,
  readable: true,
  writable: false,
  address: {},
  serverAddr: null
}

It kept printing the above text again and again for 60s and then the
test binary times out I think. I'm not sure if it was node printing the
stuff above or if it was a mocha thing. But it was really confusing...

cc @code-asher for thoughts on what was going on.

edit: It was the leaked-handles import in socket.test.ts!!!
Not sure if we should keep it, this was really confusing and misleading.
2021-01-20 02:06:44 -05:00
Anmol Sethi
5c06646f58
Formatting and linting fixes 2021-01-20 02:06:44 -05:00
Anmol Sethi
60233d0974
test/proxy.test.ts: Implement 2021-01-20 02:06:44 -05:00
Anmol Sethi
240c8e266e
test: Implement integration.ts for near full stack integration testing 2021-01-20 02:06:44 -05:00
Anmol Sethi
64e915de4a
test: Rename testutil.ts to httpserver.ts 2021-01-20 02:06:44 -05:00
Anmol Sethi
d3074278ca
app.ts: Fix createApp to log all http server errors
cc @code-asher
2021-01-20 02:06:43 -05:00
Anmol Sethi
8acb2aec11
plugin.test.ts: Switch to testutil.HttpServer 2021-01-20 02:06:43 -05:00
Anmol Sethi
ea1949e440
test: Add testutil.HttpServer
The goal is to remove supertest as it does not support typescript well
and there's really no good reason for the dependency. Also no websocket
testing support.
2021-01-20 02:06:43 -05:00
Anmol Sethi
60c270aef5
cli: hashedPassword -> hashed-password (#2454)
Capital letters in the CLI are evil.

cc @code-asher
2020-12-18 12:20:38 -05:00
Joe Previte
b1282b9707
refactor: fix bug in --home test 2020-12-14 16:23:35 -07:00
Joe Previte
8daba6ca80
feat: add home as a cli option 2020-12-14 16:23:35 -07:00
SPGoding
1dd7e4b4e1
Add hashedPassword config (#2409)
Resolve #2225.
2020-12-08 14:54:17 -06:00
Anmol Sethi
9917da068a
v3.7.0 2020-11-16 11:11:50 -05:00
Asher
96995b78d1
Update cert flag test 2020-11-12 12:29:41 -06:00
Asher
e1702a1d21
Merge branch master into code-asher/ch1385 2020-11-12 11:52:02 -06:00
Anmol Sethi
fe399ff0fe
Fix formatting 2020-11-06 14:47:08 -05:00
Anmol Sethi
9d39c53c99
plugin: Give test-plugin some html to test overlay 2020-11-06 14:47:08 -05:00
Anmol Sethi
197a09f0c1
plugin: Test endpoints via supertest
Unfortunately we can't use node-mocks-http to test a express.Router
that has async routes. See https://github.com/howardabrams/node-mocks-http/issues/225

router will just return undefined if the executing handler is async and
so the test will have no way to wait for it to complete. Thus, we have
to use supertest which starts an actual HTTP server in the background
and uses a HTTP client to send requests.
2020-11-06 10:13:01 -05:00
Anmol Sethi
14f408a837
plugin: Plugin modules now export a single top level identifier
Makes typing much easier. Addresse's Will's last comment.
2020-11-06 10:13:01 -05:00
Anmol Sethi
2a13d003d3
plugin.ts: Add homepageURL to plugin and application 2020-11-06 10:12:47 -05:00
Anmol Sethi
687094802e
plugin.ts: Make application endpoint paths absolute 2020-11-06 10:12:46 -05:00
Anmol Sethi
139a28e0ea
plugin.ts: Describe private counterpart functions
Addresses Will's comments.
2020-11-06 10:12:46 -05:00
Anmol Sethi
afff86ae9c
plugin.ts: Adjust to implement pluginapi.d.ts correctly 2020-11-06 10:12:46 -05:00
Anmol Sethi
fed545e67d
plugin.d.ts -> pluginapi.d.ts
More clear.
2020-11-06 10:12:46 -05:00
Anmol Sethi
75e52a3774
plugin.ts: Fixes for @code-asher 2020-11-06 10:12:46 -05:00
Anmol Sethi
ef971009d9
plugin.test.ts: Make it clear iconPath is a path 2020-11-06 10:12:46 -05:00
Anmol Sethi
30d2962e21
src/node/plugin.ts: Warn on duplicate plugin and only load first 2020-11-06 10:12:46 -05:00
Anmol Sethi
82e8a00a0d
Fix CI 2020-11-06 10:12:46 -05:00
Anmol Sethi
bea185b8b2
plugin: Add basic loading test
Will work on testing overlay next.
2020-11-06 10:12:46 -05:00
Anmol Sethi
bae28727bd
src/node/cli.ts: Add --cert-host to configure generated certificate hostname 2020-10-30 13:36:53 -04:00
Asher
112eda4605
Convert routes to Express 2020-10-26 17:56:13 -05:00
Asher
9f25cc6d5d
Move providers from app to routes 2020-10-20 16:18:27 -05:00
Asher
2928d362fa
Move heart and AuthType out of http
This file is going to get blasted in favor of Express.
2020-10-20 16:18:24 -05:00
Asher
dcb303a437
Move argument defaults into setDefaults 2020-10-20 16:15:13 -05:00
Asher
fe19391c03
Read most recent socket path from file 2020-10-09 16:57:43 -05:00
Asher
021c084e43
Move log level defaults into setDefaults
This will allow cliArgs to be only the actual arguments the user passed
which will be used for some logic around opening in existing instances.
2020-10-09 16:57:42 -05:00
Anmol Sethi
7991e09bbc
Skip update tests (#2059)
We don't use auto updating anymore and the tests are randomly failing
so just disabling for now.
2020-09-04 06:30:15 -04:00
Asher
d8568ebaa9
Enforce import order 2020-08-13 17:11:35 -05:00
Asher
f7790c9719
Remove unused deep merge code 2020-08-13 17:11:34 -05:00
Asher
554b6d6fcf
Remove apply portion of update endpoint
It can still be used to check for updates but will not apply them.

For now also remove the update check loop in VS Code since it's
currently unused (update check is hardcoded off right now) and won't
work anyway since it also applies the update which now won't work. In
the future we should integrate the check into the browser update
service.
2020-07-29 18:48:02 -05:00
Asher
e8f6d30055
Make providers endpoint-agnostic
A provider can now be registered on multiple endpoints (or potentially
moved if needed).
2020-07-27 12:00:48 -05:00
Anmol Sethi
c00f931500
Remove zip library dependency 2020-06-03 18:24:59 -04:00
Anmol Sethi
8053ec6872
Allow user-data-dir and extension-dir in config.yaml
Closes #1676
2020-05-19 00:41:27 -04:00
Anmol Sethi
5651201643
Copy old macOS data directory if applicable 2020-05-14 06:12:33 -04:00
Anmol Sethi
00d164b67f
Add default config file and improve config/data directory detection 2020-05-12 19:59:54 -04:00
Asher
a2b69c8f3f
Fix inconsistencies in log flags and env var
- Fix priority to match the commented behavior.
- Ignore bogus LOG_LEVEL values.
2020-04-28 17:57:55 -05:00
Anmol Sethi
af28885ea6
Deprecate --host and --port in favour of --bind-addr 2020-04-28 14:19:24 -04:00
Anmol Sethi
d0d5461a67
Remove SSH server
Closes #1502
2020-04-27 09:27:45 -04:00
Asher
5aded14b87
Merge pull request #1453 from cdr/proxy
HTTP proxy
2020-04-08 12:44:29 -05:00
Asher
d1445a8135
Back up code-server directory when updating 2020-04-02 16:21:48 -05:00
Asher
13534fa0c0
Add proxy-domain flag
This will be used for proxying ports.
2020-04-02 13:40:14 -05:00
Asher
0a5687bacf
Fix crash when unable to request an update 2020-03-25 15:00:35 -05:00
Asher
308a84e6ec
Fix centos image for arm64 2020-03-04 13:12:03 -06:00
Asher
ccd01c49b9
Integrate update notifications into VS Code 2020-03-02 15:01:24 -06:00
Asher
c870398c86
Switch to loose files
For #1306.
2020-02-25 18:23:35 -06:00
Asher
e44ac0a30e
Use last positional argument as working directory
Instead of the first.
2020-02-20 18:48:17 -06:00
Asher
319cd3f7ab
Make updating work for both binary and loose releases 2020-02-20 18:48:16 -06:00
Asher
0e2eaa9b34
Add valid values for --log 2020-02-19 11:11:29 -06:00
Asher
0263188431
Handle --long=value format in the cli parser 2020-02-19 10:54:23 -06:00
Asher
46d6e17508
Prepare for release
- Add VS Code icon
- Trim dashboard to just display dedicated VS Code section
- Version was getting unset during build
- Add back nbin shim which I temporarily took out earlier
- Update tests for log level env var changes
2020-02-18 17:31:23 -06:00
Anmol Sethi
4aa15401c3
Format and lint 2020-02-14 20:00:19 -05:00
Asher
256419004d
Implement cli parser 2020-02-07 14:43:08 -06:00
Asher
8cc11d1688
Improve routing 2020-02-05 13:07:07 -06:00
Asher
b29346ecdf
Implement new structure 2020-02-04 14:31:44 -06:00