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
def2ad97
Commit
def2ad97
authored
Jun 25, 2020
by
Andreas Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove failing database backup spec
Relates to
https://gitlab.com/gitlab-org/gitlab/-/issues/224536
parent
9c688654
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
67 deletions
+0
-67
spec/lib/backup/database_spec.rb
spec/lib/backup/database_spec.rb
+0
-67
No files found.
spec/lib/backup/database_spec.rb
deleted
100644 → 0
View file @
9c688654
# frozen_string_literal: true
require
'spec_helper'
describe
Backup
::
Database
do
let
(
:progress
)
{
double
(
'progress'
,
print:
nil
,
puts:
nil
)
}
describe
'#dump'
do
subject
{
described_class
.
new
(
progress
).
dump
}
let
(
:pg_schema
)
{
nil
}
let
(
:backup_config
)
{
double
(
'config'
,
pg_schema:
pg_schema
,
path:
File
.
join
(
Rails
.
root
,
'tmp'
))
}
before
do
allow
(
Settings
).
to
receive
(
:backup
).
and_return
(
backup_config
)
allow
(
Process
).
to
receive
(
:waitpid
)
end
it
'does not limit pg_dump to any specific schema'
do
expect
(
Process
).
to
receive
(
:spawn
)
do
|*
cmd
,
_
|
expect
(
cmd
.
join
(
' '
)).
not_to
include
(
'-n'
)
end
subject
end
it
'includes option to drop objects before restoration'
do
expect
(
Process
).
to
receive
(
:spawn
)
do
|*
cmd
,
_
|
expect
(
cmd
.
join
(
' '
)).
to
include
(
'--clean'
)
end
subject
end
context
'with pg_schema configured explicitly'
do
let
(
:pg_schema
)
{
'some_schema'
}
it
'calls pg_dump'
do
expect
(
Process
).
to
receive
(
:spawn
)
do
|*
cmd
,
_
|
expect
(
cmd
.
join
(
' '
)).
to
start_with
(
'pg_dump'
)
end
subject
end
it
'limits the psql dump to the specified schema'
do
expect
(
Process
).
to
receive
(
:spawn
)
do
|*
cmd
,
_
|
expect
(
cmd
.
join
(
' '
)).
to
include
(
"-n
#{
pg_schema
}
"
)
end
subject
end
context
'extra schemas'
do
Gitlab
::
Database
::
EXTRA_SCHEMAS
.
each
do
|
schema
|
it
"includes the extra schema
#{
schema
}
"
do
expect
(
Process
).
to
receive
(
:spawn
)
do
|*
cmd
,
_
|
expect
(
cmd
.
join
(
' '
)).
to
include
(
"-n
#{
schema
}
"
)
end
subject
end
end
end
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