Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
凌波微步_大先生
dashboard
提交
2bbc85c6
D
dashboard
项目概览
凌波微步_大先生
/
dashboard
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dashboard
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2bbc85c6
编写于
11月 05, 2015
作者:
P
Piotr Bryk
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #33 from kubernetes/fix-unit-and-integration-tests
Fix unit tests and prevent protractor from hanging
上级
f2631764
8f7d0c3b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
36 addition
and
10 deletion
+36
-10
build/serve.js
build/serve.js
+24
-4
build/style.js
build/style.js
+2
-2
build/test.js
build/test.js
+9
-3
src/test/frontend/.eslintrc
src/test/frontend/.eslintrc
+1
-1
未找到文件。
build/serve.js
浏览文件 @
2bbc85c6
...
@@ -24,6 +24,12 @@ import path from 'path';
...
@@ -24,6 +24,12 @@ import path from 'path';
import
conf
from
'
./conf
'
;
import
conf
from
'
./conf
'
;
/**
* Browser sync instance that serves the application.
*/
export
const
browserSyncInstance
=
browserSync
.
create
();
/**
/**
* Currently running backend process object. Null if the backend is not running.
* Currently running backend process object. Null if the backend is not running.
*
*
...
@@ -39,11 +45,11 @@ let runningBackendProcess = null;
...
@@ -39,11 +45,11 @@ let runningBackendProcess = null;
*/
*/
function
browserSyncInit
(
baseDir
)
{
function
browserSyncInit
(
baseDir
)
{
// Enable custom support for Angular apps, e.g., history management.
// Enable custom support for Angular apps, e.g., history management.
browserSync
.
use
(
browserSyncSpa
({
browserSync
Instance
.
use
(
browserSyncSpa
({
selector
:
'
[ng-app]
'
,
selector
:
'
[ng-app]
'
,
}));
}));
browserSync
.
instance
=
browserSync
.
init
({
browserSync
Instance
.
init
({
// TODO(bryk): Add proxy to the backend here.
// TODO(bryk): Add proxy to the backend here.
startPath
:
'
/
'
,
startPath
:
'
/
'
,
server
:
{
server
:
{
...
@@ -57,14 +63,27 @@ function browserSyncInit(baseDir) {
...
@@ -57,14 +63,27 @@ function browserSyncInit(baseDir) {
/**
/**
* Serves the application in development mode.
* Serves the application in development mode.
*/
*/
gulp
.
task
(
'
serve
'
,
[
'
spawn-backend
'
,
'
watch
'
],
function
()
{
function
serveDevelopmentMode
()
{
browserSyncInit
([
browserSyncInit
([
conf
.
paths
.
serve
,
conf
.
paths
.
serve
,
conf
.
paths
.
frontendSrc
,
// For angular templates to work.
conf
.
paths
.
frontendSrc
,
// For angular templates to work.
conf
.
paths
.
app
,
// For assets to work.
conf
.
paths
.
app
,
// For assets to work.
conf
.
paths
.
base
,
// For bower dependencies to work.
conf
.
paths
.
base
,
// For bower dependencies to work.
]);
]);
});
}
/**
* Serves the application in development mode. Watches for changes in the source files to rebuild
* development artifacts.
*/
gulp
.
task
(
'
serve:watch
'
,
[
'
watch
'
],
serveDevelopmentMode
);
/**
* Serves the application in development mode.
*/
gulp
.
task
(
'
serve
'
,
[
'
index
'
],
serveDevelopmentMode
);
/**
/**
...
@@ -136,3 +155,4 @@ gulp.task('watch', ['index'], function () {
...
@@ -136,3 +155,4 @@ gulp.task('watch', ['index'], function () {
gulp
.
watch
(
path
.
join
(
conf
.
paths
.
frontendSrc
,
'
**/*.js
'
),
[
'
scripts
'
]);
gulp
.
watch
(
path
.
join
(
conf
.
paths
.
frontendSrc
,
'
**/*.js
'
),
[
'
scripts
'
]);
gulp
.
watch
(
path
.
join
(
conf
.
paths
.
backendSrc
,
'
**/*.go
'
),
[
'
spawn-backend
'
]);
gulp
.
watch
(
path
.
join
(
conf
.
paths
.
backendSrc
,
'
**/*.go
'
),
[
'
spawn-backend
'
]);
});
});
build/style.js
浏览文件 @
2bbc85c6
...
@@ -15,7 +15,6 @@
...
@@ -15,7 +15,6 @@
/**
/**
* @fileoverview Gulp tasks for processing stylesheets.
* @fileoverview Gulp tasks for processing stylesheets.
*/
*/
import
browserSync
from
'
browser-sync
'
;
import
gulp
from
'
gulp
'
;
import
gulp
from
'
gulp
'
;
import
gulpAutoprefixer
from
'
gulp-autoprefixer
'
;
import
gulpAutoprefixer
from
'
gulp-autoprefixer
'
;
import
gulpMinifyCss
from
'
gulp-minify-css
'
;
import
gulpMinifyCss
from
'
gulp-minify-css
'
;
...
@@ -24,6 +23,7 @@ import gulpSass from 'gulp-sass';
...
@@ -24,6 +23,7 @@ import gulpSass from 'gulp-sass';
import
path
from
'
path
'
;
import
path
from
'
path
'
;
import
gulpConcat
from
'
gulp-concat
'
;
import
gulpConcat
from
'
gulp-concat
'
;
import
{
browserSyncInstance
}
from
'
./serve
'
;
import
conf
from
'
./conf
'
;
import
conf
from
'
./conf
'
;
...
@@ -42,7 +42,7 @@ gulp.task('styles', function () {
...
@@ -42,7 +42,7 @@ gulp.task('styles', function () {
.
pipe
(
gulpSourcemaps
.
write
(
"
.
"
))
.
pipe
(
gulpSourcemaps
.
write
(
"
.
"
))
.
pipe
(
gulp
.
dest
(
conf
.
paths
.
serve
))
.
pipe
(
gulp
.
dest
(
conf
.
paths
.
serve
))
// If BrowserSync is running, inform it that styles have changed.
// If BrowserSync is running, inform it that styles have changed.
.
pipe
(
browserSync
.
stream
());
.
pipe
(
browserSync
Instance
.
stream
());
});
});
...
...
build/test.js
浏览文件 @
2bbc85c6
...
@@ -15,12 +15,12 @@
...
@@ -15,12 +15,12 @@
/**
/**
* @fileoverview Gulp tasks for unit and integration tests.
* @fileoverview Gulp tasks for unit and integration tests.
*/
*/
import
browserSync
from
'
browser-sync
'
;
import
gulp
from
'
gulp
'
;
import
gulp
from
'
gulp
'
;
import
gulpProtractor
from
'
gulp-protractor
'
;
import
gulpProtractor
from
'
gulp-protractor
'
;
import
karma
from
'
karma
'
;
import
karma
from
'
karma
'
;
import
path
from
'
path
'
;
import
path
from
'
path
'
;
import
{
browserSyncInstance
}
from
'
./serve
'
;
import
conf
from
'
./conf
'
;
import
conf
from
'
./conf
'
;
...
@@ -51,11 +51,17 @@ function runProtractorTests(doneFn) {
...
@@ -51,11 +51,17 @@ function runProtractorTests(doneFn) {
configFile
:
conf
.
paths
.
protractorConf
,
configFile
:
conf
.
paths
.
protractorConf
,
}))
}))
.
on
(
'
error
'
,
function
(
err
)
{
.
on
(
'
error
'
,
function
(
err
)
{
// Close browser sync server to prevent the process from hanging.
browserSyncInstance
.
exit
();
// Kill backend server, if running.
gulp
.
start
(
'
kill-backend
'
);
doneFn
(
err
);
doneFn
(
err
);
})
})
.
on
(
'
end
'
,
function
()
{
.
on
(
'
end
'
,
function
()
{
// Close browser sync server.
// Close browser sync server to prevent the process from hanging.
browserSync
.
exit
();
browserSyncInstance
.
exit
();
// Kill backend server, if running.
gulp
.
start
(
'
kill-backend
'
);
doneFn
();
doneFn
();
});
});
}
}
...
...
src/test/frontend/.eslintrc
浏览文件 @
2bbc85c6
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
"env": {
"env": {
"jasmine": true,
"jasmine": true,
},
},
// Define missing global Angular testing environment variables.
"globals": {
"globals": {
// Define missing global Angular variables.
"inject": true,
"inject": true,
"module": true,
"module": true,
},
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录