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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
adc9e13d
Commit
adc9e13d
authored
Jan 05, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix import/export project tree saver specs
parent
bf8c5643
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
7 deletions
+19
-7
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
+9
-5
spec/lib/gitlab/import_export/project_tree_saver_spec.rb
spec/lib/gitlab/import_export/project_tree_saver_spec.rb
+10
-2
No files found.
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
View file @
adc9e13d
...
...
@@ -181,19 +181,23 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
end
context
'when restoring hierarchy of pipeline, stages and jobs'
do
it
'restores statuses'
do
expect
(
CommitStatus
.
all
.
count
).
to
be
10
end
it
'restores pipeline stages'
do
expect
(
Ci
::
Stage
.
all
.
count
).
to
be
6
end
it
'correctly restores association between stage and a pipeline'
do
expect
(
Ci
::
Stage
.
all
).
to
all
(
have_attributes
(
pipeline_id:
a_value
>
0
))
end
it
'restores statuses'
do
expect
(
CommitStatus
.
all
.
count
).
to
be
10
end
it
'correctly restores association between a stage and a job'
do
expect
(
CommitStatus
.
all
).
to
all
(
have_attributes
(
stage_id:
a_value
>
0
))
end
it
'correctly restores association between a
stage and a pipeline
'
do
it
'correctly restores association between a
pipeline and a job
'
do
expect
(
CommitStatus
.
all
).
to
all
(
have_attributes
(
pipeline_id:
a_value
>
0
))
end
end
...
...
spec/lib/gitlab/import_export/project_tree_saver_spec.rb
View file @
adc9e13d
...
...
@@ -109,12 +109,20 @@ describe Gitlab::ImportExport::ProjectTreeSaver do
expect
(
saved_project_json
[
'merge_requests'
].
first
[
'notes'
].
first
[
'author'
]).
not_to
be_empty
end
it
'has pipeline stages'
do
expect
(
saved_project_json
.
dig
(
'pipelines'
,
0
,
'stages'
)).
not_to
be_empty
end
it
'has pipeline statuses'
do
expect
(
saved_project_json
[
'pipelines'
].
first
[
'statuses'
]
).
not_to
be_empty
expect
(
saved_project_json
.
dig
(
'pipelines'
,
0
,
'stages'
,
0
,
'statuses'
)
).
not_to
be_empty
end
it
'has pipeline builds'
do
expect
(
saved_project_json
[
'pipelines'
].
first
[
'statuses'
].
count
{
|
hash
|
hash
[
'type'
]
==
'Ci::Build'
}).
to
eq
(
1
)
builds_count
=
saved_project_json
.
dig
(
'pipelines'
,
0
,
'stages'
,
0
,
'statuses'
)
.
count
{
|
hash
|
hash
[
'type'
]
==
'Ci::Build'
}
expect
(
builds_count
).
to
eq
(
1
)
end
it
'has no when YML attributes but only the DB column'
do
...
...
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