Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
44123675
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,发现更多精彩内容 >>
提交
44123675
编写于
3月 15, 2019
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix #70017
上级
ea7c31d7
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
79 addition
and
90 deletion
+79
-90
test/smoke/README.md
test/smoke/README.md
+2
-2
test/smoke/src/application.ts
test/smoke/src/application.ts
+5
-2
test/smoke/src/areas/workbench/data-migration.test.ts
test/smoke/src/areas/workbench/data-migration.test.ts
+61
-77
test/smoke/src/main.ts
test/smoke/src/main.ts
+11
-9
未找到文件。
test/smoke/README.md
浏览文件 @
44123675
...
...
@@ -9,7 +9,7 @@ Make sure you are on **Node v10.x**.
yarn smoketest
# Build
yarn smoketest
--build
PATH_TO_BUILD
yarn smoketest
--build
PATH_TO_BUILD
--stable-build
PATH_TO_STABLE_BUILD
```
### Run for a release
...
...
@@ -19,7 +19,7 @@ You must always run the smoketest version which matches the release you are test
```
bash
git checkout release/1.22
yarn
yarn smoketest
--build
PATH_TO_RELEASE_BUILD
yarn smoketest
--build
PATH_TO_RELEASE_BUILD
--stable-build
PATH_TO_STABLE_BUILD
```
### Debug
...
...
test/smoke/src/application.ts
浏览文件 @
44123675
...
...
@@ -60,10 +60,13 @@ export class Application {
return
this
.
options
.
userDataDir
;
}
async
start
():
Promise
<
any
>
{
async
start
(
expectWalkthroughPart
=
true
):
Promise
<
any
>
{
await
this
.
_start
();
await
this
.
code
.
waitForElement
(
'
.explorer-folders-view
'
);
await
this
.
code
.
waitForActiveElement
(
`.editor-instance[id="workbench.editor.walkThroughPart"] > div > div[tabIndex="0"]`
);
if
(
expectWalkthroughPart
)
{
await
this
.
code
.
waitForActiveElement
(
`.editor-instance[id="workbench.editor.walkThroughPart"] > div > div[tabIndex="0"]`
);
}
}
async
restart
(
options
:
{
workspaceOrFolder
?:
string
,
extraArgs
?:
string
[]
}):
Promise
<
any
>
{
...
...
test/smoke/src/areas/workbench/data-migration.test.ts
浏览文件 @
44123675
...
...
@@ -3,109 +3,93 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
Application
,
Quality
}
from
'
../../application
'
;
import
*
as
rimraf
from
'
rimraf
'
;
import
{
Application
,
ApplicationOptions
}
from
'
../../application
'
;
import
{
join
}
from
'
path
'
;
export
interface
ICreateAppFn
{
(
quality
:
Quality
):
Application
;
}
export
function
setup
(
stableCodePath
:
string
,
testDataPath
:
string
)
{
export
function
setup
(
userDataDir
:
string
,
createApp
:
ICreateAppFn
)
{
describe
(
'
Data Migration
'
,
()
=>
{
describe
(
'
Data Migration: This test MUST run before releasing by providing the --stable-build command line argument
'
,
()
=>
{
it
(
`verifies opened editors are restored`
,
async
function
()
{
if
(
!
stableCodePath
)
{
this
.
skip
();
}
afterEach
(
async
function
()
{
await
new
Promise
((
c
,
e
)
=>
rimraf
(
userDataDir
,
{
maxBusyTries
:
10
},
err
=>
err
?
e
(
err
)
:
c
()));
});
// it('checks if the Untitled file is restored migrating from stable to latest', async function () {
// const stableApp = createApp(Quality.Stable);
// if (!stableApp) {
// this.skip();
// return;
// }
// await stableApp.start();
// const textToType = 'Very dirty file';
const
userDataDir
=
join
(
testDataPath
,
'
d2
'
);
// different data dir from the other tests
// await stableApp.workbench.editors.newUntitledFile();
// await stableApp.workbench.editor.waitForTypeInEditor('Untitled-1', textToType);
const
stableOptions
:
ApplicationOptions
=
Object
.
assign
({},
this
.
defaultOptions
);
stableOptions
.
codePath
=
stableCodePath
;
stableOptions
.
userDataDir
=
userDataDir
;
// await stableApp.stop(
);
// await new Promise(c => setTimeout(c, 500)); // wait until all resources are released (e.g. locked local storage)
const
stableApp
=
new
Application
(
stableOptions
);
await
stableApp
!
.
start
();
// // Checking latest version for the restored state
// const app = createApp(Quality.Insiders);
// Open 3 editors and pin 2 of them
await
stableApp
.
workbench
.
quickopen
.
openFile
(
'
www
'
);
await
stableApp
.
workbench
.
quickopen
.
runCommand
(
'
View: Keep Editor
'
);
// await app.start(false);
await
stableApp
.
workbench
.
quickopen
.
openFile
(
'
app.js
'
);
await
stableApp
.
workbench
.
quickopen
.
runCommand
(
'
View: Keep Editor
'
);
// await app.workbench.editors.waitForActiveTab('Untitled-1', true);
// await app.workbench.editor.waitForEditorContents('Untitled-1', c => c.indexOf(textToType) > -1);
await
stableApp
.
workbench
.
editors
.
newUntitledFile
();
// await app.stop();
// });
await
stableApp
.
stop
();
// it('checks if the newly created dirty file is restored migrating from stable to latest', async function () {
// const stableApp = createApp(Quality.Stable)
;
const
insiderOptions
:
ApplicationOptions
=
Object
.
assign
({},
this
.
defaultOptions
);
insiderOptions
.
userDataDir
=
userDataDir
;
// if (!stableApp) {
// this.skip();
// return;
// }
const
insidersApp
=
new
Application
(
insiderOptions
);
await
insidersApp
!
.
start
(
false
/* not expecting walkthrough parth */
);
// await stableApp.start();
// Verify 3 editors are open
await
insidersApp
.
workbench
.
editors
.
waitForEditorFocus
(
'
Untitled-1
'
);
await
insidersApp
.
workbench
.
editors
.
selectTab
(
'
app.js
'
);
await
insidersApp
.
workbench
.
editors
.
selectTab
(
'
www
'
);
// const fileName = 'app.js';
// const textPart = 'This is going to be an unsaved file';
// await stableApp.workbench.quickopen.openFile(fileName);
// await stableApp.workbench.editor.waitForTypeInEditor(fileName, textPart);
// await stableApp.stop();
// await new Promise(c => setTimeout(c, 500)); // wait until all resources are released (e.g. locked local storage)
await
insidersApp
.
stop
();
});
// // Checking latest version for the restored state
// const app = createApp(Quality.Insiders);
it
(
`verifies that 'hot exit' works for dirty files`
,
async
function
()
{
if
(
!
stableCodePath
)
{
this
.
skip
();
}
// await app.start(false);
const
userDataDir
=
join
(
testDataPath
,
'
d3
'
);
// different data dir from the other tests
// await app.workbench.editors.waitForActiveTab(fileName);
// await app.workbench.editor.waitForEditorContents(fileName, c => c.indexOf(textPart) > -1);
const
stableOptions
:
ApplicationOptions
=
Object
.
assign
({},
this
.
defaultOptions
);
stableOptions
.
codePath
=
stableCodePath
;
stableOptions
.
userDataDir
=
userDataDir
;
// await app.stop(
);
// }
);
const
stableApp
=
new
Application
(
stableOptions
);
await
stableApp
!
.
start
(
);
// it('checks if opened tabs are restored migrating from stable to latest', async function () {
// const stableApp = createApp(Quality.Stable);
await
stableApp
.
workbench
.
editors
.
newUntitledFile
();
// if (!stableApp) {
// this.skip();
// return;
// }
const
untitled
=
'
Untitled-1
'
;
const
textToTypeInUntitled
=
'
Hello, Unitled Code
'
;
await
stableApp
.
workbench
.
editor
.
waitForTypeInEditor
(
untitled
,
textToTypeInUntitled
);
// await stableApp.start();
const
readmeMd
=
'
readme.md
'
;
const
textToType
=
'
Hello, Code
'
;
await
stableApp
.
workbench
.
quickopen
.
openFile
(
readmeMd
);
await
stableApp
.
workbench
.
editor
.
waitForTypeInEditor
(
readmeMd
,
textToType
);
// const fileName1 = 'app.js', fileName2 = 'jsconfig.json', fileName3 = 'readme.md'
;
await
stableApp
.
stop
()
;
// await stableApp.workbench.quickopen.openFile(fileName1);
// await stableApp.workbench.runCommand('View: Keep Editor');
// await stableApp.workbench.quickopen.openFile(fileName2);
// await stableApp.workbench.runCommand('View: Keep Editor');
// await stableApp.workbench.quickopen.openFile(fileName3);
// await stableApp.stop();
const
insiderOptions
:
ApplicationOptions
=
Object
.
assign
({},
this
.
defaultOptions
);
insiderOptions
.
userDataDir
=
userDataDir
;
// const app = createApp(Quality.Insiders);
const
insidersApp
=
new
Application
(
insiderOptions
);
await
insidersApp
!
.
start
(
false
/* not expecting walkthrough parth */
);
// await app.start(false);
await
insidersApp
.
workbench
.
editors
.
waitForActiveTab
(
readmeMd
,
true
);
await
insidersApp
.
workbench
.
editor
.
waitForEditorContents
(
readmeMd
,
c
=>
c
.
indexOf
(
textToType
)
>
-
1
);
// await app.workbench.editors.waitForTab(fileName1
);
// await app.workbench.editors.waitForTab(fileName2
);
// await app.workbench.editors.waitForTab(fileName3
);
await
insidersApp
.
workbench
.
editors
.
waitForTab
(
untitled
,
true
);
await
insidersApp
.
workbench
.
editors
.
selectTab
(
untitled
,
true
);
await
insidersApp
.
workbench
.
editor
.
waitForEditorContents
(
untitled
,
c
=>
c
.
indexOf
(
textToTypeInUntitled
)
>
-
1
);
// await a
pp.stop();
//
});
await
insidersA
pp
.
stop
();
});
});
}
\ No newline at end of file
test/smoke/src/main.ts
浏览文件 @
44123675
...
...
@@ -13,7 +13,7 @@ import * as mkdirp from 'mkdirp';
import
{
ncp
}
from
'
ncp
'
;
import
{
Application
,
Quality
,
ApplicationOptions
}
from
'
./application
'
;
//
import { setup as setupDataMigrationTests } from './areas/workbench/data-migration.test';
import
{
setup
as
setupDataMigrationTests
}
from
'
./areas/workbench/data-migration.test
'
;
import
{
setup
as
setupDataLossTests
}
from
'
./areas/workbench/data-loss.test
'
;
import
{
setup
as
setupDataExplorerTests
}
from
'
./areas/explorer/explorer.test
'
;
import
{
setup
as
setupDataPreferencesTests
}
from
'
./areas/preferences/preferences.test
'
;
...
...
@@ -113,16 +113,16 @@ function getBuildElectronPath(root: string): string {
}
let
testCodePath
=
opts
.
build
;
//
let stableCodePath = opts['stable-build'];
let
stableCodePath
=
opts
[
'
stable-build
'
];
let
electronPath
:
string
;
// let stablePath: string
;
let
stablePath
:
string
|
undefined
=
undefined
;
if
(
testCodePath
)
{
electronPath
=
getBuildElectronPath
(
testCodePath
);
//
if (stableCodePath) {
//
stablePath = getBuildElectronPath(stableCodePath);
//
}
if
(
stableCodePath
)
{
stablePath
=
getBuildElectronPath
(
stableCodePath
);
}
}
else
{
testCodePath
=
getDevElectronPath
();
electronPath
=
testCodePath
;
...
...
@@ -135,6 +135,10 @@ if (!fs.existsSync(electronPath || '')) {
fail
(
`Can't find Code at
${
electronPath
}
.`
);
}
if
(
typeof
stablePath
===
'
string
'
&&
!
fs
.
existsSync
(
stablePath
))
{
fail
(
`Can't find Stable Code at
${
stablePath
}
.`
);
}
const
userDataDir
=
path
.
join
(
testDataPath
,
'
d
'
);
let
quality
:
Quality
;
...
...
@@ -223,9 +227,7 @@ after(async function () {
await
new
Promise
((
c
,
e
)
=>
rimraf
(
testDataPath
,
{
maxBusyTries
:
10
},
err
=>
err
?
e
(
err
)
:
c
()));
});
// describe('Data Migration', () => {
// setupDataMigrationTests(userDataDir, createApp);
// });
setupDataMigrationTests
(
stableCodePath
,
testDataPath
);
describe
(
'
Running Code
'
,
()
=>
{
before
(
async
function
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录