Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
db0fce32
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
db0fce32
编写于
7月 24, 2015
作者:
J
Jacob Vosmaer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Create more backups during backup tests
I hope this makes the backup tests more reliable.
上级
810ffab4
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
11 addition
and
13 deletion
+11
-13
spec/tasks/gitlab/backup_rake_spec.rb
spec/tasks/gitlab/backup_rake_spec.rb
+11
-13
未找到文件。
spec/tasks/gitlab/backup_rake_spec.rb
浏览文件 @
db0fce32
...
...
@@ -15,6 +15,12 @@ describe 'gitlab:app namespace rake task' do
Rake
.
application
.
invoke_task
task_name
end
def
reenable_backup_sub_tasks
%w{db repo uploads}
.
each
do
|
subtask
|
Rake
::
Task
[
"gitlab:backup:
#{
subtask
}
:create"
].
reenable
end
end
describe
'backup_restore'
do
before
do
# avoid writing task output to spec progress
...
...
@@ -67,23 +73,19 @@ describe 'gitlab:app namespace rake task' do
# Redirect STDOUT and run the rake task
orig_stdout
=
$stdout
$stdout
=
StringIO
.
new
reenable_backup_sub_tasks
run_rake_task
(
'gitlab:backup:create'
)
reenable_backup_sub_tasks
$stdout
=
orig_stdout
@backup_tar
=
(
tars_glob
-
existing_tars
).
first
end
def
reenable_backup_sub_tasks
%w{db repo uploads}
.
each
do
|
subtask
|
Rake
::
Task
[
"gitlab:backup:
#{
subtask
}
:create"
].
reenable
end
end
before
:all
do
before
do
create_backup
end
after
:all
do
after
do
FileUtils
.
rm
(
@backup_tar
)
end
...
...
@@ -99,9 +101,7 @@ describe 'gitlab:app namespace rake task' do
# We created a backup in a before(:all) so it got the default permissions.
# We now need to do some work to create a _new_ backup file using our stub.
FileUtils
.
rm
(
@backup_tar
)
reenable_backup_sub_tasks
create_backup
reenable_backup_sub_tasks
end
it
'uses the custom permissions'
do
...
...
@@ -138,9 +138,7 @@ describe 'gitlab:app namespace rake task' do
before
:all
do
@origin_cd
=
Dir
.
pwd
Rake
::
Task
[
"gitlab:backup:db:create"
].
reenable
Rake
::
Task
[
"gitlab:backup:repo:create"
].
reenable
Rake
::
Task
[
"gitlab:backup:uploads:create"
].
reenable
reenable_backup_sub_tasks
# Record the existing backup tars so we don't touch them
existing_tars
=
tars_glob
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录