Skip to content

Commit d3df963

Browse files
committed
Merge branch 'main' into jsjoeio/upgrade-vscode-1.54
2 parents 481dd1f + d271265 commit d3df963

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+884
-713
lines changed

.github/dependabot.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
time: "11:00"
8+
assignees:
9+
- "jawnsy"
10+
reviewers:
11+
- "jawnsy"
12+
ignore:
13+
# GitHub always delivers the latest versions for each major
14+
# release tag, so handle updates manually
15+
- dependency-name: "actions/*"
16+
17+
- package-ecosystem: "npm"
18+
directory: "/"
19+
schedule:
20+
interval: "daily"
21+
time: "11:00"
22+
assignees:
23+
- "jawnsy"
24+
reviewers:
25+
- "jawnsy"

.github/workflows/ci.yaml

+31-15
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
name: ci
22

3-
on: [push]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
410

511
jobs:
612
fmt:
713
runs-on: ubuntu-latest
814
steps:
9-
- uses: actions/checkout@v1
15+
- uses: actions/checkout@v2
1016
- name: Run ./ci/steps/fmt.sh
1117
uses: ./ci/images/debian10
1218
with:
@@ -15,20 +21,28 @@ jobs:
1521
lint:
1622
runs-on: ubuntu-latest
1723
steps:
18-
- uses: actions/checkout@v1
24+
- uses: actions/checkout@v2
1925
- name: Run ./ci/steps/lint.sh
2026
uses: ./ci/images/debian10
2127
with:
2228
args: ./ci/steps/lint.sh
2329

24-
test:
30+
test-unit:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v1
34+
- name: Run unit tests
35+
uses: ./ci/images/debian10
36+
with:
37+
args: ./ci/steps/test-unit.sh
38+
test-e2e:
2539
needs: linux-amd64
2640
runs-on: ubuntu-latest
2741
env:
2842
PASSWORD: e45432jklfdsab
2943
CODE_SERVER_ADDRESS: http://localhost:8080
3044
steps:
31-
- uses: actions/checkout@v1
45+
- uses: actions/checkout@v2
3246
- name: Download release packages
3347
uses: actions/download-artifact@v2
3448
with:
@@ -38,24 +52,24 @@ jobs:
3852
run: |
3953
cd release-packages && tar -xzf code-server*-linux-amd64.tar.gz
4054
- uses: microsoft/playwright-github-action@v1
41-
- name: Install dependencies and run tests
55+
- name: Install dependencies and run end-to-end tests
4256
run: |
4357
./release-packages/code-server*-linux-amd64/bin/code-server &
4458
yarn --frozen-lockfile
45-
yarn test
59+
yarn test:e2e
4660
- name: Upload test artifacts
4761
if: always()
4862
uses: actions/upload-artifact@v2
4963
with:
5064
name: test-videos
51-
path: ./test/videos
65+
path: ./test/e2e/videos
5266
- name: Remove release packages and test artifacts
53-
run: rm -rf ./release-packages ./test/videos
67+
run: rm -rf ./release-packages ./test/e2e/videos
5468

5569
release:
5670
runs-on: ubuntu-latest
5771
steps:
58-
- uses: actions/checkout@v1
72+
- uses: actions/checkout@v2
5973
- name: Run ./ci/steps/release.sh
6074
uses: ./ci/images/debian10
6175
with:
@@ -70,7 +84,7 @@ jobs:
7084
needs: release
7185
runs-on: ubuntu-latest
7286
steps:
73-
- uses: actions/checkout@v1
87+
- uses: actions/checkout@v2
7488
- name: Download npm package
7589
uses: actions/download-artifact@v2
7690
with:
@@ -90,7 +104,7 @@ jobs:
90104
needs: release
91105
runs-on: ubuntu-arm64-latest
92106
steps:
93-
- uses: actions/checkout@v1
107+
- uses: actions/checkout@v2
94108
- name: Download npm package
95109
uses: actions/download-artifact@v2
96110
with:
@@ -111,8 +125,10 @@ jobs:
111125
macos-amd64:
112126
needs: release
113127
runs-on: macos-latest
128+
# This job requires secrets, so can only run on the default branch
129+
if: github.ref == 'refs/heads/main'
114130
steps:
115-
- uses: actions/checkout@v1
131+
- uses: actions/checkout@v2
116132
- name: Download npm package
117133
uses: actions/download-artifact@v2
118134
with:
@@ -133,7 +149,7 @@ jobs:
133149
runs-on: ubuntu-latest
134150
needs: linux-amd64
135151
steps:
136-
- uses: actions/checkout@v1
152+
- uses: actions/checkout@v2
137153
- name: Download release package
138154
uses: actions/download-artifact@v2
139155
with:
@@ -153,7 +169,7 @@ jobs:
153169
runs-on: ubuntu-arm64-latest
154170
needs: linux-arm64
155171
steps:
156-
- uses: actions/checkout@v1
172+
- uses: actions/checkout@v2
157173
- name: Download release package
158174
uses: actions/download-artifact@v2
159175
with:

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ node-*
1616
.home
1717
coverage
1818
**/.DS_Store
19-
test/videos
20-
test/screenshots
19+
test/e2e/videos
20+
test/e2e/screenshots

ci/README.md

+11-7
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Make sure you have `$GITHUB_TOKEN` set and [hub](https://github.com/github/hub)
5252

5353
Currently, we run a command to manually generate the code coverage shield. Follow these steps:
5454

55-
1. Run `yarn test` and make sure all the tests are passing
55+
1. Run `yarn test:unit` and make sure all the tests are passing
5656
2. Run `yarn badges`
5757
3. Go into the README and change the color from `red` to `green` in this line:
5858

@@ -72,8 +72,10 @@ This directory contains scripts used for the development of code-server.
7272
- Runs formatters.
7373
- [./ci/dev/lint.sh](./dev/lint.sh) (`yarn lint`)
7474
- Runs linters.
75-
- [./ci/dev/test.sh](./dev/test.sh) (`yarn test`)
76-
- Runs tests.
75+
- [./ci/dev/test-unit.sh](./dev/test-unit.sh) (`yarn test:unit`)
76+
- Runs unit tests.
77+
- [./ci/dev/test-e2e.sh](./dev/test-e2e.sh) (`yarn test:e2e`)
78+
- Runs end-to-end tests.
7779
- [./ci/dev/ci.sh](./dev/ci.sh) (`yarn ci`)
7880
- Runs `yarn fmt`, `yarn lint` and `yarn test`.
7981
- [./ci/dev/watch.ts](./dev/watch.ts) (`yarn watch`)
@@ -142,11 +144,13 @@ This directory contains the scripts used in CI.
142144
Helps avoid clobbering the CI configuration.
143145

144146
- [./steps/fmt.sh](./steps/fmt.sh)
145-
- Runs `yarn fmt` after ensuring VS Code is patched.
147+
- Runs `yarn fmt`.
146148
- [./steps/lint.sh](./steps/lint.sh)
147-
- Runs `yarn lint` after ensuring VS Code is patched.
148-
- [./steps/test.sh](./steps/test.sh)
149-
- Runs `yarn test` after ensuring VS Code is patched.
149+
- Runs `yarn lint`.
150+
- [./steps/test-unit.sh](./steps/test-unit.sh)
151+
- Runs `yarn test:unit`.
152+
- [./steps/test-e2e.sh](./steps/test-e2e.sh)
153+
- Runs `yarn test:e2e`.
150154
- [./steps/release.sh](./steps/release.sh)
151155
- Runs the release process.
152156
- Generates the npm package at `./release`.

ci/dev/ci.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ main() {
66

77
yarn fmt
88
yarn lint
9-
yarn test
9+
yarn test:unit
1010
}
1111

1212
main "$@"

ci/dev/test.sh renamed to ci/dev/test-e2e.sh

+1-4
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@ set -euo pipefail
33

44
main() {
55
cd "$(dirname "$0")/../.."
6-
cd test/test-plugin
7-
make -s out/index.js
86
# We must keep jest in a sub-directory. See ../../test/package.json for more
97
# information. We must also run it from the root otherwise coverage will not
108
# include our source files.
11-
cd "$OLDPWD"
129
if [[ -z ${PASSWORD-} ]] || [[ -z ${CODE_SERVER_ADDRESS-} ]]; then
1310
echo "The end-to-end testing suites rely on your local environment"
1411
echo -e "\n"
@@ -18,7 +15,7 @@ main() {
1815
echo -e "\n"
1916
exit 1
2017
fi
21-
CS_DISABLE_PLUGINS=true ./test/node_modules/.bin/jest "$@"
18+
CS_DISABLE_PLUGINS=true ./test/node_modules/.bin/jest "$@" --config ./test/jest.e2e.config.ts
2219
}
2320

2421
main "$@"

ci/dev/test-unit.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
main() {
5+
cd "$(dirname "$0")/../.."
6+
cd test/unit/test-plugin
7+
make -s out/index.js
8+
# We must keep jest in a sub-directory. See ../../test/package.json for more
9+
# information. We must also run it from the root otherwise coverage will not
10+
# include our source files.
11+
cd "$OLDPWD"
12+
CS_DISABLE_PLUGINS=true ./test/node_modules/.bin/jest "$@"
13+
}
14+
15+
main "$@"

ci/steps/test-e2e.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
main() {
5+
cd "$(dirname "$0")/../.."
6+
7+
"./release-packages/code-server*-linux-amd64/bin/code-server" --home "$CODE_SERVER_ADDRESS"/healthz &
8+
yarn --frozen-lockfile
9+
yarn test:e2e
10+
}
11+
12+
main "$@"

ci/steps/test.sh renamed to ci/steps/test-unit.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ main() {
66

77
yarn --frozen-lockfile
88

9-
yarn test
9+
yarn test:unit
1010
}
1111

1212
main "$@"

lib/vscode/yarn.lock

+5-5
Original file line numberDiff line numberDiff line change
@@ -3999,7 +3999,7 @@ fsevents@~2.3.1:
39993999
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.1.tgz#b209ab14c61012636c8863507edf7fb68cc54e9f"
40004000
integrity sha512-YR47Eg4hChJGAB1O3yEAOkGO+rlzutoICGqGo9EZ4lKWokzZRSyIW1QmTzqjtw8MJdj9srP869CuWw/hyzSiBw==
40014001

4002-
fstream@^1.0.2:
4002+
fstream@^1.0.12:
40034003
version "1.0.12"
40044004
resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.12.tgz#4e8ba8ee2d48be4f7d0de505455548eae5932045"
40054005
integrity sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==
@@ -9290,12 +9290,12 @@ tar-stream@^2.1.4:
92909290
readable-stream "^3.1.1"
92919291

92929292
tar@^2.2.1:
9293-
version "2.2.1"
9294-
resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1"
9295-
integrity sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=
9293+
version "2.2.2"
9294+
resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.2.tgz#0ca8848562c7299b8b446ff6a4d60cdbb23edc40"
9295+
integrity sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==
92969296
dependencies:
92979297
block-stream "*"
9298-
fstream "^1.0.2"
9298+
fstream "^1.0.12"
92999299
inherits "2"
93009300

93019301
tar@^6.0.2:

package.json

+8-6
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
"release:standalone": "./ci/build/build-standalone-release.sh",
1717
"release:github-draft": "./ci/build/release-github-draft.sh",
1818
"release:github-assets": "./ci/build/release-github-assets.sh",
19+
"test:e2e": "./ci/dev/test-e2e.sh",
1920
"test:standalone-release": "./ci/build/test-standalone-release.sh",
21+
"test:unit": "./ci/dev/test-unit.sh",
2022
"package": "./ci/build/build-packages.sh",
2123
"postinstall": "./ci/dev/postinstall.sh",
2224
"update:vscode": "./ci/dev/update-vscode.sh",
@@ -52,7 +54,7 @@
5254
"@types/wtfnode": "^0.7.0",
5355
"@typescript-eslint/eslint-plugin": "^4.7.0",
5456
"@typescript-eslint/parser": "^4.7.0",
55-
"doctoc": "^1.4.0",
57+
"doctoc": "^2.0.0",
5658
"eslint": "^7.7.0",
5759
"eslint-config-prettier": "^6.0.0",
5860
"eslint-import-resolver-alias": "^1.1.2",
@@ -71,7 +73,8 @@
7173
"resolutions": {
7274
"@types/node": "^12.12.7",
7375
"safe-buffer": "^5.1.1",
74-
"vfile-message": "^2.0.2"
76+
"vfile-message": "^2.0.2",
77+
"node-forge": "^0.10.0"
7578
},
7679
"dependencies": {
7780
"@coder/logger": "1.1.16",
@@ -123,7 +126,8 @@
123126
"testPathIgnorePatterns": [
124127
"/node_modules/",
125128
"/lib/",
126-
"/out/"
129+
"/out/",
130+
"test/e2e"
127131
],
128132
"collectCoverage": true,
129133
"collectCoverageFrom": [
@@ -143,8 +147,6 @@
143147
"lines": 40
144148
}
145149
},
146-
"testTimeout": 30000,
147-
"globalSetup": "<rootDir>/test/globalSetup.ts",
148150
"modulePathIgnorePatterns": [
149151
"<rootDir>/lib/vscode",
150152
"<rootDir>/release-packages",
@@ -155,7 +157,7 @@
155157
"<rootDir>/release-images"
156158
],
157159
"moduleNameMapper": {
158-
"^.+\\.(css|less)$": "<rootDir>/test/cssStub.ts"
160+
"^.+\\.(css|less)$": "<rootDir>/test/utils/cssStub.ts"
159161
}
160162
}
161163
}

test/e2e.test.ts renamed to test/e2e/e2e.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { chromium, Page, Browser } from "playwright"
2-
import { CODE_SERVER_ADDRESS } from "./constants"
2+
import { CODE_SERVER_ADDRESS } from "../utils/constants"
33

44
let browser: Browser
55
let page: Page

test/login.test.ts renamed to test/e2e/login.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { chromium, Page, Browser, BrowserContext } from "playwright"
2-
import { CODE_SERVER_ADDRESS, PASSWORD } from "./constants"
2+
import { CODE_SERVER_ADDRESS, PASSWORD } from "../utils/constants"
33

44
describe("login", () => {
55
let browser: Browser

test/jest.e2e.config.ts

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// jest.config.ts
2+
import type { Config } from "@jest/types"
3+
4+
const config: Config.InitialOptions = {
5+
transform: {
6+
"^.+\\.ts$": "<rootDir>/node_modules/ts-jest",
7+
},
8+
globalSetup: "<rootDir>/utils/globalSetup.ts",
9+
testEnvironment: "node",
10+
testPathIgnorePatterns: ["node_modules", "lib", "out", "test/unit"],
11+
testTimeout: 30000,
12+
modulePathIgnorePatterns: [
13+
"<rootDir>/../lib/vscode",
14+
"<rootDir>/../release-packages",
15+
"<rootDir>/../release",
16+
"<rootDir>/../release-standalone",
17+
"<rootDir>/../release-npm-package",
18+
"<rootDir>/../release-gcp",
19+
"<rootDir>/../release-images",
20+
],
21+
}
22+
export default config

0 commit comments

Comments
 (0)