Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
4be3cc88
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
4be3cc88
编写于
2月 07, 2020
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test - convert web integration to TS
上级
ca514436
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
241 addition
and
34 deletion
+241
-34
.eslintrc.json
.eslintrc.json
+7
-0
build/npm/postinstall.js
build/npm/postinstall.js
+1
-0
test/integration/browser/.gitignore
test/integration/browser/.gitignore
+5
-0
test/integration/browser/README.md
test/integration/browser/README.md
+13
-0
test/integration/browser/package.json
test/integration/browser/package.json
+17
-0
test/integration/browser/src/index.ts
test/integration/browser/src/index.ts
+33
-33
test/integration/browser/tsconfig.json
test/integration/browser/tsconfig.json
+21
-0
test/integration/browser/yarn.lock
test/integration/browser/yarn.lock
+143
-0
test/smoke/README.md
test/smoke/README.md
+1
-1
未找到文件。
.eslintrc.json
浏览文件 @
4be3cc88
...
...
@@ -614,6 +614,13 @@
"*"
]
},
{
"target"
:
"**/test/integration/**"
,
"restrictions"
:
[
"**/test/integration/**"
,
"*"
]
},
{
"target"
:
"{**/api/**.test.ts,}"
,
"restrictions"
:
"{**/vs/**,assert,sinon,crypto,vscode}"
...
...
build/npm/postinstall.js
浏览文件 @
4be3cc88
...
...
@@ -72,4 +72,5 @@ runtime "${runtime}"`;
yarnInstall
(
`build`
);
// node modules required for build
yarnInstall
(
'
test/automation
'
);
// node modules required for smoketest
yarnInstall
(
'
test/smoke
'
);
// node modules required for smoketest
yarnInstall
(
'
test/integration/browser
'
);
// node modules required for integration
yarnInstallBuildDependencies
();
// node modules for watching, specific to host node version, not electron
test/integration/browser/.gitignore
0 → 100644
浏览文件 @
4be3cc88
.DS_Store
npm-debug.log
Thumbs.db
node_modules/
out/
test/integration/browser/README.md
0 → 100644
浏览文件 @
4be3cc88
# VS Code Integration test
### Run
```
bash
# Dev (Electron)
scripts/test-integration.sh
# Dev (Web)
node
test
/integration/browser/out/index.js
```
test/integration/browser/package.json
0 → 100644
浏览文件 @
4be3cc88
{
"name"
:
"code-oss-dev-integration-test"
,
"version"
:
"0.1.0"
,
"main"
:
"./index.js"
,
"scripts"
:
{
"postinstall"
:
"npm run compile"
,
"compile"
:
"yarn tsc"
},
"devDependencies"
:
{
"@types/mkdirp"
:
"0.5.1"
,
"@types/node"
:
"^12.11.7"
,
"@types/rimraf"
:
"2.0.2"
,
"rimraf"
:
"^2.6.1"
,
"tmp"
:
"0.0.33"
,
"typescript"
:
"3.7.5"
}
}
test/integration/browser/
index.j
s
→
test/integration/browser/
src/index.t
s
浏览文件 @
4be3cc88
...
...
@@ -3,23 +3,19 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
//@ts-check
import
*
as
path
from
'
path
'
;
import
*
as
cp
from
'
child_process
'
;
import
*
as
playwright
from
'
playwright
'
;
import
*
as
url
from
'
url
'
;
import
*
as
tmp
from
'
tmp
'
;
import
*
as
rimraf
from
'
rimraf
'
;
const
path
=
require
(
'
path
'
);
const
cp
=
require
(
'
child_process
'
);
const
playwright
=
require
(
'
playwright
'
);
const
url
=
require
(
'
url
'
);
// opts
const
optimist
=
require
(
'
optimist
'
)
.
describe
(
'
debug
'
,
'
do not run browsers headless
'
).
boolean
(
'
debug
'
)
.
describe
(
'
browser
'
,
'
browser in which integration tests should run
'
).
string
(
'
browser
'
).
default
(
'
browser
'
,
'
chromium
'
)
.
describe
(
'
help
'
,
'
show the help
'
).
alias
(
'
help
'
,
'
h
'
);
// logic
const
argv
=
optimist
.
argv
;
let
serverProcess
;
let
serverProcess
:
cp
.
ChildProcess
|
undefined
=
undefined
;
function
teardownServer
()
{
if
(
serverProcess
)
{
...
...
@@ -28,18 +24,17 @@ function teardownServer() {
}
}
/**
* @param {string} browserType
* @param {string} endpoint
*/
async
function
runTestsInBrowser
(
browserType
,
endpoint
)
{
const
browser
=
await
playwright
[
browserType
].
launch
({
headless
:
!
Boolean
(
argv
.
debug
)
});
async
function
runTestsInBrowser
(
browserType
:
string
,
endpoint
:
string
):
Promise
<
void
>
{
const
browser
=
await
playwright
[
browserType
].
launch
({
headless
:
!
Boolean
(
optimist
.
argv
.
debug
)
});
const
page
=
(
await
browser
.
defaultContext
().
pages
())[
0
];
const
integrationTestsPath
=
path
.
join
(
__dirname
,
'
..
'
,
'
..
'
,
'
..
'
,
'
extensions
'
,
'
vscode-api-tests
'
);
const
testWorkspaceUri
=
url
.
format
({
pathname
:
path
.
join
(
integrationTestsPath
,
'
testWorkspace
'
),
protocol
:
'
vscode-remote:
'
,
slashes
:
true
,
host
:
'
localhost:9888
'
});
const
testExtensionUri
=
url
.
format
({
pathname
:
path
.
join
(
integrationTestsPath
),
protocol
:
'
vscode-remote:
'
,
slashes
:
true
,
host
:
'
localhost:9888
'
});
const
testFilesUri
=
url
.
format
({
pathname
:
path
.
join
(
integrationTestsPath
,
'
out
'
,
'
singlefolder-tests
'
),
protocol
:
'
vscode-remote:
'
,
slashes
:
true
,
host
:
'
localhost:9888
'
});
const
host
=
url
.
parse
(
endpoint
).
host
;
const
protocol
=
'
vscode-remote
'
;
const
integrationTestsPath
=
path
.
join
(
__dirname
,
'
..
'
,
'
..
'
,
'
..
'
,
'
..
'
,
'
extensions
'
,
'
vscode-api-tests
'
);
const
testWorkspaceUri
=
url
.
format
({
pathname
:
path
.
join
(
integrationTestsPath
,
'
testWorkspace
'
),
protocol
,
host
,
slashes
:
true
});
const
testExtensionUri
=
url
.
format
({
pathname
:
path
.
join
(
integrationTestsPath
),
protocol
,
host
,
slashes
:
true
});
const
testFilesUri
=
url
.
format
({
pathname
:
path
.
join
(
integrationTestsPath
,
'
out
'
,
'
singlefolder-tests
'
),
protocol
,
host
,
slashes
:
true
});
const
folderParam
=
testWorkspaceUri
;
const
payloadParam
=
`[["extensionDevelopmentPath","
${
testExtensionUri
}
"],["extensionTestsPath","
${
testFilesUri
}
"]]`
;
...
...
@@ -51,7 +46,7 @@ async function runTestsInBrowser(browserType, endpoint) {
// emitter.emit(type, data1, data2)
// });
page
.
on
(
'
console
'
,
async
msg
=>
{
page
.
on
(
'
console
'
,
async
(
msg
:
playwright
.
ConsoleMessage
)
=>
{
const
msgText
=
msg
.
text
();
console
[
msg
.
type
()](
msgText
,
await
Promise
.
all
(
msg
.
args
().
map
(
async
arg
=>
await
arg
.
jsonValue
())));
...
...
@@ -63,12 +58,15 @@ async function runTestsInBrowser(browserType, endpoint) {
});
}
async
function
launch
()
{
// workspacePath = _workspacePath;
// const agentFolder = userDataDir;
// await promisify(mkdir)(agentFolder);
async
function
launchServer
():
Promise
<
string
>
{
const
tmpDir
=
tmp
.
dirSync
({
prefix
:
'
t
'
});
const
testDataPath
=
tmpDir
.
name
;
process
.
once
(
'
exit
'
,
()
=>
rimraf
.
sync
(
testDataPath
));
const
userDataDir
=
path
.
join
(
testDataPath
,
'
d
'
);
const
env
=
{
// VSCODE_AGENT_FOLDER: agentFolde
r,
VSCODE_AGENT_FOLDER
:
userDataDi
r
,
...
process
.
env
};
...
...
@@ -76,7 +74,9 @@ async function launch() {
if
(
process
.
env
.
VSCODE_REMOTE_SERVER_PATH
)
{
serverLocation
=
path
.
join
(
process
.
env
.
VSCODE_REMOTE_SERVER_PATH
,
`server.
${
process
.
platform
===
'
win32
'
?
'
cmd
'
:
'
sh
'
}
`
);
}
else
{
serverLocation
=
path
.
join
(
__dirname
,
'
..
'
,
'
..
'
,
'
..
'
,
`resources/server/web.
${
process
.
platform
===
'
win32
'
?
'
bat
'
:
'
sh
'
}
`
);
serverLocation
=
path
.
join
(
__dirname
,
'
..
'
,
'
..
'
,
'
..
'
,
'
..
'
,
`resources/server/web.
${
process
.
platform
===
'
win32
'
?
'
bat
'
:
'
sh
'
}
`
);
process
.
env
.
VSCODE_DEV
=
'
1
'
;
}
serverProcess
=
cp
.
spawn
(
...
...
@@ -85,15 +85,15 @@ async function launch() {
{
env
}
);
serverProcess
.
stderr
.
on
(
'
data
'
,
e
=>
console
.
log
(
'
Server stderr:
'
+
e
));
serverProcess
.
stdout
.
on
(
'
data
'
,
e
=>
console
.
log
(
'
Server stdout:
'
+
e
));
serverProcess
?.
stderr
?.
on
(
'
data
'
,
e
=>
console
.
log
(
`Server stderr:
${
e
}
`
));
serverProcess
?.
stdout
?.
on
(
'
data
'
,
e
=>
console
.
log
(
`Server stdout:
${
e
}
`
));
process
.
on
(
'
exit
'
,
teardownServer
);
process
.
on
(
'
SIGINT
'
,
teardownServer
);
process
.
on
(
'
SIGTERM
'
,
teardownServer
);
return
new
Promise
(
r
=>
{
serverProcess
.
stdout
.
on
(
'
data
'
,
d
=>
{
serverProcess
?.
stdout
?
.
on
(
'
data
'
,
d
=>
{
const
matches
=
d
.
toString
(
'
ascii
'
).
match
(
/Web UI available at
(
.+
)
/
);
if
(
matches
!==
null
)
{
r
(
matches
[
1
]);
...
...
@@ -102,6 +102,6 @@ async function launch() {
});
}
launch
().
then
(
async
endpoint
=>
{
return
runTestsInBrowser
(
argv
.
browser
,
endpoint
);
launch
Server
().
then
(
async
endpoint
=>
{
return
runTestsInBrowser
(
optimist
.
argv
.
browser
,
endpoint
);
},
console
.
error
);
test/integration/browser/tsconfig.json
0 → 100644
浏览文件 @
4be3cc88
{
"compilerOptions"
:
{
"module"
:
"commonjs"
,
"noImplicitAny"
:
false
,
"removeComments"
:
false
,
"preserveConstEnums"
:
true
,
"target"
:
"es2017"
,
"strictNullChecks"
:
true
,
"noUnusedParameters"
:
false
,
"noUnusedLocals"
:
true
,
"outDir"
:
"out"
,
"sourceMap"
:
true
,
"lib"
:
[
"es2016"
,
"dom"
]
},
"exclude"
:
[
"node_modules"
]
}
test/integration/browser/yarn.lock
0 → 100644
浏览文件 @
4be3cc88
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@types/events@*":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7"
integrity sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==
"@types/glob@*":
version "7.1.1"
resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.1.tgz#aa59a1c6e3fbc421e07ccd31a944c30eba521575"
integrity sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==
dependencies:
"@types/events" "*"
"@types/minimatch" "*"
"@types/node" "*"
"@types/minimatch@*":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==
"@types/mkdirp@0.5.1":
version "0.5.1"
resolved "https://registry.yarnpkg.com/@types/mkdirp/-/mkdirp-0.5.1.tgz#ea887cd024f691c1ca67cce20b7606b053e43b0f"
integrity sha512-XA4vNO6GCBz8Smq0hqSRo4yRWMqr4FPQrWjhJt6nKskzly4/p87SfuJMFYGRyYb6jo2WNIQU2FDBsY5r1BibUA==
dependencies:
"@types/node" "*"
"@types/node@*":
version "13.7.0"
resolved "https://registry.yarnpkg.com/@types/node/-/node-13.7.0.tgz#b417deda18cf8400f278733499ad5547ed1abec4"
integrity sha512-GnZbirvmqZUzMgkFn70c74OQpTTUcCzlhQliTzYjQMqg+hVKcDnxdL19Ne3UdYzdMA/+W3eb646FWn/ZaT1NfQ==
"@types/node@^12.11.7":
version "12.12.26"
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.26.tgz#213e153babac0ed169d44a6d919501e68f59dea9"
integrity sha512-UmUm94/QZvU5xLcUlNR8hA7Ac+fGpO1EG/a8bcWVz0P0LqtxFmun9Y2bbtuckwGboWJIT70DoWq1r3hb56n3DA==
"@types/rimraf@2.0.2":
version "2.0.2"
resolved "https://registry.yarnpkg.com/@types/rimraf/-/rimraf-2.0.2.tgz#7f0fc3cf0ff0ad2a99bb723ae1764f30acaf8b6e"
integrity sha512-Hm/bnWq0TCy7jmjeN5bKYij9vw5GrDFWME4IuxV08278NtU/VdGbzsBohcCUJ7+QMqmUq5hpRKB39HeQWJjztQ==
dependencies:
"@types/glob" "*"
"@types/node" "*"
balanced-match@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=
brace-expansion@^1.1.7:
version "1.1.11"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
dependencies:
balanced-match "^1.0.0"
concat-map "0.0.1"
concat-map@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
glob@^7.1.3:
version "7.1.6"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6"
integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
minimatch "^3.0.4"
once "^1.3.0"
path-is-absolute "^1.0.0"
inflight@^1.0.4:
version "1.0.6"
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=
dependencies:
once "^1.3.0"
wrappy "1"
inherits@2:
version "2.0.4"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
minimatch@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
dependencies:
brace-expansion "^1.1.7"
once@^1.3.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
dependencies:
wrappy "1"
os-tmpdir@~1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=
path-is-absolute@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
rimraf@^2.6.1:
version "2.7.1"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec"
integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==
dependencies:
glob "^7.1.3"
tmp@0.0.33:
version "0.0.33"
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==
dependencies:
os-tmpdir "~1.0.2"
typescript@3.7.5:
version "3.7.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.5.tgz#0692e21f65fd4108b9330238aac11dd2e177a1ae"
integrity sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==
wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
test/smoke/README.md
浏览文件 @
4be3cc88
# VS Code Smoke Test
Make sure you are on
**Node v1
0
.x**
.
Make sure you are on
**Node v1
2
.x**
.
### Run
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录