File tree 11 files changed +103
-7
lines changed
extensions/test-extension 11 files changed +103
-7
lines changed Original file line number Diff line number Diff line change @@ -3,20 +3,30 @@ set -euo pipefail
3
3
4
4
main () {
5
5
cd " $( dirname " $0 " ) /../.."
6
+ source ./ci/lib.sh
6
7
7
- echo " Installing code-server test dependencies..."
8
+ pushd test
9
+ echo " Installing dependencies for $PWD "
10
+ yarn install
11
+ popd
8
12
9
13
local args=(install)
10
14
if [[ ${CI-} ]]; then
11
15
args+=(--frozen-lockfile)
12
16
fi
13
17
14
- cd test
18
+ pushd test
19
+ echo " Installing dependencies for $PWD "
15
20
yarn " ${args[@]} "
16
- cd ..
21
+ popd
17
22
18
- cd vendor
19
- echo " Installing vendor dependencies..."
23
+ pushd test/e2e/extensions/test-extension
24
+ echo " Installing dependencies for $PWD "
25
+ yarn " ${args[@]} "
26
+ popd
27
+
28
+ pushd vendor
29
+ echo " Installing dependencies for $PWD "
20
30
21
31
# We install in 'modules' instead of 'node_modules' because VS Code's
22
32
# extensions use a webpack config which cannot differentiate between its own
@@ -33,6 +43,8 @@ main() {
33
43
34
44
# Finally, run the vendor `postinstall`
35
45
yarn run postinstall
46
+
47
+ popd
36
48
}
37
49
38
50
main " $@ "
Original file line number Diff line number Diff line change @@ -13,6 +13,11 @@ main() {
13
13
14
14
source ./ci/lib.sh
15
15
16
+ pushd test/e2e/extensions/test-extension
17
+ echo " Building test extension"
18
+ yarn build
19
+ popd
20
+
16
21
local dir=" $PWD "
17
22
if [[ ! ${CODE_SERVER_TEST_ENTRY-} ]]; then
18
23
echo " Set CODE_SERVER_TEST_ENTRY to test another build of code-server"
Original file line number Diff line number Diff line change 6
6
7
7
source ./ci/lib.sh
8
8
9
+ echo " Building test plugin"
9
10
pushd test/unit/node/test-plugin
10
11
make -s out/index.js
11
12
popd
Original file line number Diff line number Diff line change
1
+ import { describe , test } from "./baseFixture"
2
+
3
+ describe ( "Extensions" , true , ( ) => {
4
+ // This will only work if the test extension is loaded into code-server.
5
+ test ( "should have access to VSCODE_PROXY_URI" , async ( { codeServerPage } ) => {
6
+ const address = await codeServerPage . address ( )
7
+
8
+ await codeServerPage . executeCommandViaMenus ( "code-server: Get proxy URI" )
9
+
10
+ await codeServerPage . page . waitForSelector ( `text=${ address } /proxy/{{port}}` )
11
+ } )
12
+ } )
Original file line number Diff line number Diff line change
1
+ /extension.js
Original file line number Diff line number Diff line change
1
+ import * as vscode from "vscode"
2
+
3
+ export function activate ( context : vscode . ExtensionContext ) {
4
+ context . subscriptions . push (
5
+ vscode . commands . registerCommand ( "codeServerTest.proxyUri" , ( ) => {
6
+ if ( process . env . VSCODE_PROXY_URI ) {
7
+ vscode . window . showInformationMessage ( process . env . VSCODE_PROXY_URI )
8
+ } else {
9
+ vscode . window . showErrorMessage ( "No proxy URI was set" )
10
+ }
11
+ } ) ,
12
+ )
13
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " code-server-extension" ,
3
+ "description" : " code-server test extension" ,
4
+ "version" : " 0.0.1" ,
5
+ "publisher" : " cdr" ,
6
+ "activationEvents" : [
7
+ " onCommand:codeServerTest.proxyUri"
8
+ ],
9
+ "engines" : {
10
+ "vscode" : " ^1.56.0"
11
+ },
12
+ "main" : " ./extension.js" ,
13
+ "contributes" : {
14
+ "commands" : [
15
+ {
16
+ "command" : " codeServerTest.proxyUri" ,
17
+ "title" : " Get proxy URI" ,
18
+ "category" : " code-server"
19
+ }
20
+ ]
21
+ },
22
+ "devDependencies" : {
23
+ "@types/vscode" : " ^1.56.0" ,
24
+ "typescript" : " ^4.0.5"
25
+ },
26
+ "scripts" : {
27
+ "build" : " tsc extension.ts"
28
+ }
29
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "compilerOptions" : {
3
+ "target" : " es2020" ,
4
+ "module" : " commonjs" ,
5
+ "outDir" : " ." ,
6
+ "strict" : true ,
7
+ "baseUrl" : " ./"
8
+ },
9
+ "include" : [" ./extension.ts" ]
10
+ }
Original file line number Diff line number Diff line change
1
+ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+ # yarn lockfile v1
3
+
4
+
5
+ " @types/vscode@^1.56.0 " :
6
+ version "1.57.0"
7
+ resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.57.0.tgz#cc648e0573b92f725cd1baf2621f8da9f8bc689f"
8
+ integrity sha512-FeznBFtIDCWRluojTsi9c3LLcCHOXP5etQfBK42+ixo1CoEAchkw39tuui9zomjZuKfUVL33KZUDIwHZ/xvOkQ==
9
+
10
+ typescript@^4.0.5 :
11
+ version "4.3.2"
12
+ resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.2.tgz#399ab18aac45802d6f2498de5054fcbbe716a805"
13
+ integrity sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw==
Original file line number Diff line number Diff line change @@ -88,6 +88,8 @@ export class CodeServer {
88
88
path . join ( dir , "config.yaml" ) ,
89
89
"--user-data-dir" ,
90
90
dir ,
91
+ "--extensions-dir" ,
92
+ path . join ( __dirname , "../extensions" ) ,
91
93
// The last argument is the workspace to open.
92
94
dir ,
93
95
] ,
Original file line number Diff line number Diff line change @@ -25,12 +25,10 @@ const config: PlaywrightTestConfig = {
25
25
name : "Chromium" ,
26
26
use : { browserName : "chromium" } ,
27
27
} ,
28
-
29
28
{
30
29
name : "Firefox" ,
31
30
use : { browserName : "firefox" } ,
32
31
} ,
33
-
34
32
{
35
33
name : "WebKit" ,
36
34
use : { browserName : "webkit" } ,
You can’t perform that action at this time.
0 commit comments