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
Boxiang Sun
gitlab-ce
Commits
88cc49fa
Commit
88cc49fa
authored
Jan 04, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for restoring associations with import/export
parent
b1e1990e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
2 deletions
+36
-2
spec/lib/gitlab/import_export/project.json
spec/lib/gitlab/import_export/project.json
+24
-2
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
+12
-0
No files found.
spec/lib/gitlab/import_export/project.json
View file @
88cc49fa
...
@@ -6465,6 +6465,26 @@
...
@@ -6465,6 +6465,26 @@
}
}
}
}
],
],
"stages"
:
[
{
"id"
:
11
,
"project_id"
:
5
,
"pipeline_id"
:
36
,
"name"
:
"test"
,
"status"
:
1
,
"created_at"
:
"2016-03-22T15:44:44.772Z"
,
"updated_at"
:
"2016-03-29T06:44:44.634Z"
},
{
"id"
:
12
,
"project_id"
:
5
,
"pipeline_id"
:
36
,
"name"
:
"deploy"
,
"status"
:
2
,
"created_at"
:
"2016-03-22T15:45:45.772Z"
,
"updated_at"
:
"2016-03-29T06:45:45.634Z"
}
],
"statuses"
:
[
"statuses"
:
[
{
{
"id"
:
71
,
"id"
:
71
,
...
@@ -6487,6 +6507,7 @@
...
@@ -6487,6 +6507,7 @@
"stage"
:
"test"
,
"stage"
:
"test"
,
"trigger_request_id"
:
null
,
"trigger_request_id"
:
null
,
"stage_idx"
:
1
,
"stage_idx"
:
1
,
"stage_id"
:
11
,
"tag"
:
null
,
"tag"
:
null
,
"ref"
:
"master"
,
"ref"
:
"master"
,
"user_id"
:
null
,
"user_id"
:
null
,
...
@@ -6515,15 +6536,16 @@
...
@@ -6515,15 +6536,16 @@
"runner_id"
:
null
,
"runner_id"
:
null
,
"coverage"
:
null
,
"coverage"
:
null
,
"commit_id"
:
36
,
"commit_id"
:
36
,
"commands"
:
"$
build
command"
,
"commands"
:
"$
deploy
command"
,
"job_id"
:
null
,
"job_id"
:
null
,
"name"
:
"test build 2"
,
"name"
:
"test build 2"
,
"deploy"
:
false
,
"deploy"
:
false
,
"options"
:
null
,
"options"
:
null
,
"allow_failure"
:
false
,
"allow_failure"
:
false
,
"stage"
:
"
test
"
,
"stage"
:
"
deploy
"
,
"trigger_request_id"
:
null
,
"trigger_request_id"
:
null
,
"stage_idx"
:
1
,
"stage_idx"
:
1
,
"stage_id"
:
12
,
"tag"
:
null
,
"tag"
:
null
,
"ref"
:
"master"
,
"ref"
:
"master"
,
"user_id"
:
null
,
"user_id"
:
null
,
...
...
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
View file @
88cc49fa
...
@@ -179,6 +179,18 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
...
@@ -179,6 +179,18 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
end
end
end
end
end
end
context
'when restoring hierarchy of pipeline, stages and jobs'
do
let
(
:pipeline
)
{
Ci
::
Pipeline
.
first
}
it
'restores pipeline stages'
do
expect
(
pipeline
.
stages
.
count
).
to
be
2
end
it
'correctly restores association between a stage and a job'
do
expect
(
pipeline
.
statuses
).
to
all
(
have_attributes
(
stage_id:
a_value
>
10
))
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