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
c62ac183
Commit
c62ac183
authored
Mar 14, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
e0eb461d
f2379a4a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
32 deletions
+36
-32
spec/migrations/add_head_pipeline_for_each_merge_request_spec.rb
...grations/add_head_pipeline_for_each_merge_request_spec.rb
+11
-13
spec/migrations/migrate_old_artifacts_spec.rb
spec/migrations/migrate_old_artifacts_spec.rb
+19
-13
spec/migrations/migrate_user_activities_to_users_last_activity_on_spec.rb
...migrate_user_activities_to_users_last_activity_on_spec.rb
+3
-3
spec/migrations/migrate_user_project_view_spec.rb
spec/migrations/migrate_user_project_view_spec.rb
+3
-3
No files found.
spec/migrations/add_head_pipeline_for_each_merge_request_spec.rb
View file @
c62ac183
require
'spec_helper'
require
Rails
.
root
.
join
(
'db'
,
'post_migrate'
,
'20170508170547_add_head_pipeline_for_each_merge_request.rb'
)
describe
AddHeadPipelineForEachMergeRequest
,
:delete
do
include
ProjectForksHelper
describe
AddHeadPipelineForEachMergeRequest
,
:migration
do
let
(
:migration
)
{
described_class
.
new
}
let!
(
:project
)
{
create
(
:project
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let!
(
:other_project
)
{
fork_project
(
project
)
}
let!
(
:project
)
{
table
(
:projects
).
create!
}
let!
(
:other_project
)
{
table
(
:projects
).
create!
}
let!
(
:pipeline_1
)
{
create
(
:ci_pipeline
,
project:
project
,
ref:
"branch_1"
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let!
(
:pipeline_2
)
{
create
(
:ci_pipeline
,
project:
other_project
,
ref:
"branch_1"
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let!
(
:pipeline_3
)
{
create
(
:ci_pipeline
,
project:
other_project
,
ref:
"branch_1"
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let!
(
:pipeline_4
)
{
create
(
:ci_pipeline
,
project:
project
,
ref:
"branch_2"
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let!
(
:pipeline_1
)
{
table
(
:ci_pipelines
).
create!
(
project_id:
project
.
id
,
ref:
"branch_1"
)
}
let!
(
:pipeline_2
)
{
table
(
:ci_pipelines
).
create!
(
project_id:
other_project
.
id
,
ref:
"branch_1"
)
}
let!
(
:pipeline_3
)
{
table
(
:ci_pipelines
).
create!
(
project_id:
other_project
.
id
,
ref:
"branch_1"
)
}
let!
(
:pipeline_4
)
{
table
(
:ci_pipelines
).
create!
(
project_id:
project
.
id
,
ref:
"branch_2"
)
}
let!
(
:mr_1
)
{
create
(
:merge_request
,
source_project:
project
,
target_project:
project
,
source_branch:
"branch_1"
,
target_branch:
"target_1"
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let!
(
:mr_2
)
{
create
(
:merge_request
,
source_project:
other_project
,
target_project:
project
,
source_branch:
"branch_1"
,
target_branch:
"target_2"
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let!
(
:mr_3
)
{
create
(
:merge_request
,
source_project:
project
,
target_project:
project
,
source_branch:
"branch_2"
,
target_branch:
"master"
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let!
(
:mr_4
)
{
create
(
:merge_request
,
source_project:
project
,
target_project:
project
,
source_branch:
"branch_3"
,
target_branch:
"master"
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let!
(
:mr_1
)
{
table
(
:merge_requests
).
create!
(
source_project_id:
project
.
id
,
target_project_id:
project
.
id
,
source_branch:
"branch_1"
,
target_branch:
"target_1"
)
}
let!
(
:mr_2
)
{
table
(
:merge_requests
).
create!
(
source_project_id:
other_project
.
id
,
target_project_id:
project
.
id
,
source_branch:
"branch_1"
,
target_branch:
"target_2"
)
}
let!
(
:mr_3
)
{
table
(
:merge_requests
).
create!
(
source_project_id:
project
.
id
,
target_project_id:
project
.
id
,
source_branch:
"branch_2"
,
target_branch:
"master"
)
}
let!
(
:mr_4
)
{
table
(
:merge_requests
).
create!
(
source_project_id:
project
.
id
,
target_project_id:
project
.
id
,
source_branch:
"branch_3"
,
target_branch:
"master"
)
}
context
"#up"
do
context
"when source_project and source_branch of pipeline are the same of merge request"
do
...
...
spec/migrations/migrate_old_artifacts_spec.rb
View file @
c62ac183
...
...
@@ -3,7 +3,9 @@
require
'spec_helper'
require
Rails
.
root
.
join
(
'db'
,
'post_migrate'
,
'20170523083112_migrate_old_artifacts.rb'
)
describe
MigrateOldArtifacts
do
# Adding the ci_job_artifacts table (from the 20170918072948 schema)
# makes the use of model code below easier.
describe
MigrateOldArtifacts
,
:migration
,
schema:
20170918072948
do
let
(
:migration
)
{
described_class
.
new
}
let!
(
:directory
)
{
Dir
.
mktmpdir
}
...
...
@@ -16,18 +18,22 @@ describe MigrateOldArtifacts do
end
context
'with migratable data'
do
set
(
:project1
)
{
create
(
:project
,
ci_id:
2
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
set
(
:project2
)
{
create
(
:project
,
ci_id:
3
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
set
(
:project3
)
{
create
(
:project
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
set
(
:pipeline1
)
{
create
(
:ci_empty_pipeline
,
project:
project1
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
set
(
:pipeline2
)
{
create
(
:ci_empty_pipeline
,
project:
project2
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
set
(
:pipeline3
)
{
create
(
:ci_empty_pipeline
,
project:
project3
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let!
(
:build_with_legacy_artifacts
)
{
create
(
:ci_build
,
pipeline:
pipeline1
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let!
(
:build_without_artifacts
)
{
create
(
:ci_build
,
pipeline:
pipeline1
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let!
(
:build2
)
{
create
(
:ci_build
,
pipeline:
pipeline2
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let!
(
:build3
)
{
create
(
:ci_build
,
pipeline:
pipeline3
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let
(
:projects
)
{
table
(
:projects
)
}
let
(
:ci_pipelines
)
{
table
(
:ci_pipelines
)
}
let
(
:ci_builds
)
{
table
(
:ci_builds
)
}
let!
(
:project1
)
{
projects
.
create!
(
ci_id:
2
)
}
let!
(
:project2
)
{
projects
.
create!
(
ci_id:
3
)
}
let!
(
:project3
)
{
projects
.
create!
}
let!
(
:pipeline1
)
{
ci_pipelines
.
create!
(
project_id:
project1
.
id
)
}
let!
(
:pipeline2
)
{
ci_pipelines
.
create!
(
project_id:
project2
.
id
)
}
let!
(
:pipeline3
)
{
ci_pipelines
.
create!
(
project_id:
project3
.
id
)
}
let!
(
:build_with_legacy_artifacts
)
{
ci_builds
.
create!
(
commit_id:
pipeline1
.
id
,
project_id:
project1
.
id
,
type:
'Ci::Build'
).
becomes
(
Ci
::
Build
)
}
let!
(
:build_without_artifacts
)
{
ci_builds
.
create!
(
commit_id:
pipeline1
.
id
,
project_id:
project1
.
id
,
type:
'Ci::Build'
).
becomes
(
Ci
::
Build
)
}
let!
(
:build2
)
{
ci_builds
.
create!
(
commit_id:
pipeline2
.
id
,
project_id:
project2
.
id
,
type:
'Ci::Build'
).
becomes
(
Ci
::
Build
)
}
let!
(
:build3
)
{
ci_builds
.
create!
(
commit_id:
pipeline3
.
id
,
project_id:
project3
.
id
,
type:
'Ci::Build'
).
becomes
(
Ci
::
Build
)
}
before
do
setup_builds
(
build2
,
build3
)
...
...
spec/migrations/migrate_user_activities_to_users_last_activity_on_spec.rb
View file @
c62ac183
...
...
@@ -3,10 +3,10 @@
require
'spec_helper'
require
Rails
.
root
.
join
(
'db'
,
'post_migrate'
,
'20170324160416_migrate_user_activities_to_users_last_activity_on.rb'
)
describe
MigrateUserActivitiesToUsersLastActivityOn
,
:clean_gitlab_redis_shared_state
,
:
delete
do
describe
MigrateUserActivitiesToUsersLastActivityOn
,
:clean_gitlab_redis_shared_state
,
:
migration
do
let
(
:migration
)
{
described_class
.
new
}
let!
(
:user_active_1
)
{
create
(
:user
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let!
(
:user_active_2
)
{
create
(
:user
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let!
(
:user_active_1
)
{
table
(
:users
).
create!
(
email:
'test1'
,
username:
'test1'
)
}
let!
(
:user_active_2
)
{
table
(
:users
).
create!
(
email:
'test2'
,
username:
'test2'
)
}
def
record_activity
(
user
,
time
)
Gitlab
::
Redis
::
SharedState
.
with
do
|
redis
|
...
...
spec/migrations/migrate_user_project_view_spec.rb
View file @
c62ac183
...
...
@@ -3,15 +3,15 @@
require
'spec_helper'
require
Rails
.
root
.
join
(
'db'
,
'post_migrate'
,
'20170406142253_migrate_user_project_view.rb'
)
describe
MigrateUserProjectView
,
:
delete
do
describe
MigrateUserProjectView
,
:
migration
do
let
(
:migration
)
{
described_class
.
new
}
let!
(
:user
)
{
create
(
:user
,
project_view:
'readme'
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let!
(
:user
)
{
table
(
:users
).
create!
(
project_view:
User
.
project_views
[
'readme'
])
}
describe
'#up'
do
it
'updates project view setting with new value'
do
migration
.
up
expect
(
user
.
reload
.
project_view
).
to
eq
(
'files'
)
expect
(
user
.
reload
.
project_view
).
to
eq
(
User
.
project_views
[
'files'
]
)
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