Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
2eca739b
Commit
2eca739b
authored
Feb 28, 2020
by
Henrik Christian Grove
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename verify_restore to verify_backup_version
parent
8c4e1c7e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
lib/backup/manager.rb
lib/backup/manager.rb
+1
-1
spec/lib/backup/manager_spec.rb
spec/lib/backup/manager_spec.rb
+5
-5
No files found.
lib/backup/manager.rb
View file @
2eca739b
...
...
@@ -107,7 +107,7 @@ module Backup
end
end
def
verify_
restore
def
verify_
backup_version
Dir
.
chdir
(
backup_path
)
do
ENV
[
"VERSION"
]
=
"
#{
settings
[
:db_version
]
}
"
if
settings
[
:db_version
].
to_i
>
0
# restoring mismatching backups can lead to unexpected problems
...
...
spec/lib/backup/manager_spec.rb
View file @
2eca739b
...
...
@@ -214,26 +214,26 @@ describe Backup::Manager do
end
end
describe
'verify_
restore
'
do
context
'on
V
ersion mismatch'
do
describe
'verify_
backup_version
'
do
context
'on
v
ersion mismatch'
do
let
(
:gitlab_version
)
{
Gitlab
::
VERSION
}
it
'stops the process'
do
allow
(
YAML
).
to
receive
(
:load_file
)
.
and_return
({
gitlab_version:
"not
#{
gitlab_version
}
"
})
expect
{
subject
.
verify_
restore
}.
to
raise_error
SystemExit
expect
{
subject
.
verify_
backup_version
}.
to
raise_error
SystemExit
end
end
context
'on
V
ersion match'
do
context
'on
v
ersion match'
do
let
(
:gitlab_version
)
{
Gitlab
::
VERSION
}
it
'does nothing'
do
allow
(
YAML
).
to
receive
(
:load_file
)
.
and_return
({
gitlab_version:
"
#{
gitlab_version
}
"
})
expect
{
subject
.
verify_
restore
}.
not_to
raise_error
expect
{
subject
.
verify_
backup_version
}.
not_to
raise_error
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment