Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
6ec806c6
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6ec806c6
编写于
4月 11, 2018
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
💄
上级
6a47ecce
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
0 addition
and
130 deletion
+0
-130
test/smoke/src/application.ts
test/smoke/src/application.ts
+0
-130
未找到文件。
test/smoke/src/application.ts
浏览文件 @
6ec806c6
...
...
@@ -3,7 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
test
as
testPort
}
from
'
portastic
'
;
import
{
API
}
from
'
./api
'
;
import
{
ScreenCapturer
}
from
'
./helpers/screenshot
'
;
import
{
Workbench
}
from
'
./areas/workbench/workbench
'
;
...
...
@@ -12,19 +11,6 @@ import * as cp from 'child_process';
import
{
CodeDriver
}
from
'
./driver
'
;
import
{
Code
,
spawn
,
SpawnOptions
}
from
'
./vscode/code
'
;
// Just hope random helps us here, cross your fingers!
export
async
function
findFreePort
():
Promise
<
number
>
{
for
(
let
i
=
0
;
i
<
10
;
i
++
)
{
const
port
=
10000
+
Math
.
round
(
Math
.
random
()
*
10000
);
if
(
await
testPort
(
port
))
{
return
port
;
}
}
throw
new
Error
(
'
Could not find free port!
'
);
}
export
enum
Quality
{
Dev
,
Insiders
,
...
...
@@ -141,85 +127,6 @@ export class SpectronApplication {
}
private
async
startApplication
(
workspaceOrFolder
:
string
,
extraArgs
:
string
[]
=
[]):
Promise
<
any
>
{
// let args: string[] = [];
// let chromeDriverArgs: string[] = [];
// if (process.env.VSCODE_REPOSITORY) {
// args.push(process.env.VSCODE_REPOSITORY as string);
// }
// args.push(workspaceOrFolder);
// // Prevent 'Getting Started' web page from opening on clean user-data-dir
// args.push('--skip-getting-started');
// // Prevent 'Getting Started' web page from opening on clean user-data-dir
// args.push('--skip-release-notes');
// // Prevent Quick Open from closing when focus is stolen, this allows concurrent smoketest suite running
// args.push('--sticky-quickopen');
// // Disable telemetry
// args.push('--disable-telemetry');
// // Disable updates
// args.push('--disable-updates');
// // Disable crash reporter
// // This seems to be the fix for the strange hangups in which Code stays unresponsive
// // and tests finish badly with timeouts, leaving Code running in the background forever
// args.push('--disable-crash-reporter');
// // Ensure that running over custom extensions directory, rather than picking up the one that was used by a tester previously
// args.push(`--extensions-dir=${this.options.extensionsPath}`);
// args.push(...extraArgs);
// chromeDriverArgs.push(`--user-data-dir=${this.options.userDataDir}`);
// Spectron always uses the same port number for the chrome driver
// and it handles gracefully when two instances use the same port number
// This works, but when one of the instances quits, it takes down
// chrome driver with it, leaving the other instance in DISPAIR!!! :(
// const port = await findFreePort();
// We must get a different port for debugging the smoketest express app
// otherwise concurrent test runs will clash on those ports
// const env = { PORT: String(await findFreePort()), ...process.env };
// const opts = {
// path: this.options.electronPath,
// port,
// args,
// env,
// chromeDriverArgs,
// startTimeout: 10000,
// requireName: 'nodeRequire'
// };
// const runName = String(SpectronApplication.count++);
// let testsuiteRootPath: string | undefined = undefined;
// let screenshotsDirPath: string | undefined = undefined;
// if (this.options.artifactsPath) {
// testsuiteRootPath = path.join(this.options.artifactsPath, sanitize(runName));
// mkdirp.sync(testsuiteRootPath);
// // Collect screenshots
// screenshotsDirPath = path.join(testsuiteRootPath, 'screenshots');
// mkdirp.sync(screenshotsDirPath);
// // Collect chromedriver logs
// const chromedriverLogPath = path.join(testsuiteRootPath, 'chromedriver.log');
// opts.chromeDriverLogPath = chromedriverLogPath;
// // Collect webdriver logs
// const webdriverLogsPath = path.join(testsuiteRootPath, 'webdriver');
// mkdirp.sync(webdriverLogsPath);
// opts.webdriverLogPath = webdriverLogsPath;
// }
this
.
codeInstance
=
await
spawn
({
codePath
:
this
.
options
.
codePath
,
workspacePath
:
workspaceOrFolder
,
...
...
@@ -228,43 +135,6 @@ export class SpectronApplication {
verbose
:
this
.
options
.
verbose
});
// if (testsuiteRootPath) {
// // Collect logs
// const mainProcessLogPath = path.join(testsuiteRootPath, 'main.log');
// const rendererProcessLogPath = path.join(testsuiteRootPath, 'renderer.log');
// const flush = async () => {
// if (!this.spectron) {
// return;
// }
// const mainLogs = await this.spectron.client.getMainProcessLogs();
// await new Promise((c, e) => fs.appendFile(mainProcessLogPath, mainLogs.join('\n'), { encoding: 'utf8' }, err => err ? e(err) : c()));
// const rendererLogs = (await this.spectron.client.getRenderProcessLogs()).map(m => `${m.timestamp} - ${m.level} - ${m.message}`);
// await new Promise((c, e) => fs.appendFile(rendererProcessLogPath, rendererLogs.join('\n'), { encoding: 'utf8' }, err => err ? e(err) : c()));
// };
// let running = true;
// const loopFlush = async () => {
// while (true) {
// await flush();
// if (!running) {
// return;
// }
// await new Promise(c => setTimeout(c, 1000));
// }
// };
// const loopPromise = loopFlush();
// this.stopLogCollection = () => {
// running = false;
// return loopPromise;
// };
// }
this
.
_screenCapturer
=
new
ScreenCapturer
(
null
as
any
,
this
.
_suiteName
,
''
);
const
driver
=
new
CodeDriver
(
this
.
codeInstance
.
driver
,
this
.
options
.
verbose
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录