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
8367e91f
Commit
8367e91f
authored
Jun 06, 2017
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests
parent
9e5be685
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
29 deletions
+29
-29
db/migrate/20170525174158_add_ci_pipeline_source_pipeline_indexes.rb
...20170525174158_add_ci_pipeline_source_pipeline_indexes.rb
+5
-5
db/migrate/20170525174159_add_ci_pipeline_source_pipeline_foreign_key.rb
...0525174159_add_ci_pipeline_source_pipeline_foreign_key.rb
+5
-5
db/schema.rb
db/schema.rb
+16
-16
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+1
-1
spec/serializers/pipeline_serializer_spec.rb
spec/serializers/pipeline_serializer_spec.rb
+1
-1
spec/services/ci/retry_build_service_spec.rb
spec/services/ci/retry_build_service_spec.rb
+1
-1
No files found.
db/migrate/20170525174158_add_ci_pipeline_source_pipeline_indexes.rb
View file @
8367e91f
...
...
@@ -15,11 +15,11 @@ class AddCiPipelineSourcePipelineIndexes < ActiveRecord::Migration
end
def
down
remove_concurrent_index
:ci_sources_pipelines
,
:project_id
remove_concurrent_index
:ci_sources_pipelines
,
:pipeline_id
remove_concurrent_index
:ci_sources_pipelines
,
:project_id
if
index_exists?
:ci_sources_pipelines
,
:project_id
remove_concurrent_index
:ci_sources_pipelines
,
:pipeline_id
if
index_exists?
:ci_sources_pipelines
,
:pipeline_id
remove_concurrent_index
:ci_sources_pipelines
,
:source_project_id
remove_concurrent_index
:ci_sources_pipelines
,
:source_job_id
remove_concurrent_index
:ci_sources_pipelines
,
:source_pipeline_id
remove_concurrent_index
:ci_sources_pipelines
,
:source_project_id
if
index_exists?
:ci_sources_pipelines
,
:source_project_id
remove_concurrent_index
:ci_sources_pipelines
,
:source_job_id
if
index_exists?
:ci_sources_pipelines
,
:source_job_id
remove_concurrent_index
:ci_sources_pipelines
,
:source_pipeline_id
if
index_exists?
:ci_sources_pipelines
,
:source_pipeline_id
end
end
db/migrate/20170525174159_add_ci_pipeline_source_pipeline_foreign_key.rb
View file @
8367e91f
...
...
@@ -15,11 +15,11 @@ class AddCiPipelineSourcePipelineForeignKey < ActiveRecord::Migration
end
def
down
remove_foreign_key
:ci_sources_pipelines
,
:projects
,
column: :project_id
remove_foreign_key
:ci_sources_pipelines
,
:ci_pipelines
,
column: :pipeline_id
remove_foreign_key
:ci_sources_pipelines
,
column: :project_id
remove_foreign_key
:ci_sources_pipelines
,
column: :pipeline_id
remove_foreign_key
:ci_sources_pipelines
,
:projects
,
column: :source_project_id
remove_foreign_key
:ci_sources_pipelines
,
:ci_builds
,
column: :source_job_id
remove_foreign_key
:ci_sources_pipelines
,
:ci_pipelines
,
column: :source_pipeline_id
remove_foreign_key
:ci_sources_pipelines
,
column: :source_project_id
remove_foreign_key
:ci_sources_pipelines
,
column: :source_job_id
remove_foreign_key
:ci_sources_pipelines
,
column: :source_pipeline_id
end
end
db/schema.rb
View file @
8367e91f
...
...
@@ -316,20 +316,6 @@ ActiveRecord::Schema.define(version: 20170602003304) do
add_index
"ci_pipeline_schedules"
,
[
"next_run_at"
,
"active"
],
name:
"index_ci_pipeline_schedules_on_next_run_at_and_active"
,
using: :btree
add_index
"ci_pipeline_schedules"
,
[
"project_id"
],
name:
"index_ci_pipeline_schedules_on_project_id"
,
using: :btree
create_table
"ci_sources_pipelines"
,
force: :cascade
do
|
t
|
t
.
integer
"project_id"
t
.
integer
"pipeline_id"
t
.
integer
"source_project_id"
t
.
integer
"source_job_id"
t
.
integer
"source_pipeline_id"
end
add_index
"ci_sources_pipelines"
,
[
"pipeline_id"
],
name:
"index_ci_pipeline_source_pipelines_on_pipeline_id"
,
using: :btree
add_index
"ci_sources_pipelines"
,
[
"project_id"
],
name:
"index_ci_pipeline_source_pipelines_on_project_id"
,
using: :btree
add_index
"ci_sources_pipelines"
,
[
"source_job_id"
],
name:
"index_ci_pipeline_source_pipelines_on_source_job_id"
,
using: :btree
add_index
"ci_sources_pipelines"
,
[
"source_pipeline_id"
],
name:
"index_ci_pipeline_source_pipelines_on_source_pipeline_id"
,
using: :btree
add_index
"ci_sources_pipelines"
,
[
"source_project_id"
],
name:
"index_ci_pipeline_source_pipelines_on_source_project_id"
,
using: :btree
create_table
"ci_pipelines"
,
force: :cascade
do
|
t
|
t
.
string
"ref"
t
.
string
"sha"
...
...
@@ -391,6 +377,20 @@ ActiveRecord::Schema.define(version: 20170602003304) do
add_index
"ci_runners"
,
[
"locked"
],
name:
"index_ci_runners_on_locked"
,
using: :btree
add_index
"ci_runners"
,
[
"token"
],
name:
"index_ci_runners_on_token"
,
using: :btree
create_table
"ci_sources_pipelines"
,
force: :cascade
do
|
t
|
t
.
integer
"project_id"
t
.
integer
"pipeline_id"
t
.
integer
"source_project_id"
t
.
integer
"source_job_id"
t
.
integer
"source_pipeline_id"
end
add_index
"ci_sources_pipelines"
,
[
"pipeline_id"
],
name:
"index_ci_pipeline_source_pipelines_on_pipeline_id"
,
using: :btree
add_index
"ci_sources_pipelines"
,
[
"project_id"
],
name:
"index_ci_pipeline_source_pipelines_on_project_id"
,
using: :btree
add_index
"ci_sources_pipelines"
,
[
"source_job_id"
],
name:
"index_ci_pipeline_source_pipelines_on_source_job_id"
,
using: :btree
add_index
"ci_sources_pipelines"
,
[
"source_pipeline_id"
],
name:
"index_ci_pipeline_source_pipelines_on_source_pipeline_id"
,
using: :btree
add_index
"ci_sources_pipelines"
,
[
"source_project_id"
],
name:
"index_ci_pipeline_source_pipelines_on_source_project_id"
,
using: :btree
create_table
"ci_trigger_requests"
,
force: :cascade
do
|
t
|
t
.
integer
"trigger_id"
,
null:
false
t
.
text
"variables"
...
...
@@ -1695,13 +1695,13 @@ ActiveRecord::Schema.define(version: 20170602003304) do
add_foreign_key
"ci_builds"
,
"ci_pipelines"
,
column:
"auto_canceled_by_id"
,
name:
"fk_a2141b1522"
,
on_delete: :nullify
add_foreign_key
"ci_pipeline_schedules"
,
"projects"
,
name:
"fk_8ead60fcc4"
,
on_delete: :cascade
add_foreign_key
"ci_pipeline_schedules"
,
"users"
,
column:
"owner_id"
,
name:
"fk_9ea99f58d2"
,
on_delete: :nullify
add_foreign_key
"ci_pipelines"
,
"ci_pipeline_schedules"
,
column:
"pipeline_schedule_id"
,
name:
"fk_3d34ab2e06"
,
on_delete: :nullify
add_foreign_key
"ci_pipelines"
,
"ci_pipelines"
,
column:
"auto_canceled_by_id"
,
name:
"fk_262d4c2d19"
,
on_delete: :nullify
add_foreign_key
"ci_sources_pipelines"
,
"ci_builds"
,
column:
"source_job_id"
,
name:
"fk_3f0c88d7dc"
,
on_delete: :cascade
add_foreign_key
"ci_sources_pipelines"
,
"ci_pipelines"
,
column:
"pipeline_id"
,
name:
"fk_b8c0fac459"
,
on_delete: :cascade
add_foreign_key
"ci_sources_pipelines"
,
"ci_pipelines"
,
column:
"source_pipeline_id"
,
name:
"fk_3a3e3cb83a"
,
on_delete: :cascade
add_foreign_key
"ci_sources_pipelines"
,
"projects"
,
column:
"source_project_id"
,
name:
"fk_8868d0f3e4"
,
on_delete: :cascade
add_foreign_key
"ci_sources_pipelines"
,
"projects"
,
name:
"fk_83b4346e48"
,
on_delete: :cascade
add_foreign_key
"ci_pipelines"
,
"ci_pipeline_schedules"
,
column:
"pipeline_schedule_id"
,
name:
"fk_3d34ab2e06"
,
on_delete: :nullify
add_foreign_key
"ci_pipelines"
,
"ci_pipelines"
,
column:
"auto_canceled_by_id"
,
name:
"fk_262d4c2d19"
,
on_delete: :nullify
add_foreign_key
"ci_trigger_requests"
,
"ci_triggers"
,
column:
"trigger_id"
,
name:
"fk_b8ec8b7245"
,
on_delete: :cascade
add_foreign_key
"ci_triggers"
,
"users"
,
column:
"owner_id"
,
name:
"fk_e8e10d1964"
,
on_delete: :cascade
add_foreign_key
"ci_variables"
,
"projects"
,
name:
"fk_ada5eb64b3"
,
on_delete: :cascade
...
...
spec/models/ci/pipeline_spec.rb
View file @
8367e91f
...
...
@@ -22,7 +22,7 @@ describe Ci::Pipeline, models: true do
it
{
is_expected
.
to
have_many
(
:auto_canceled_jobs
)
}
it
{
is_expected
.
to
have_one
(
:source_pipeline
)
}
it
{
is_expected
.
to
have_many
(
:sourced_pipelines
)
}
it
{
is_expected
.
to
have_
many
(
:triggered_by_pipeline
)
}
it
{
is_expected
.
to
have_
one
(
:triggered_by_pipeline
)
}
it
{
is_expected
.
to
have_many
(
:triggered_pipelines
)
}
it
{
is_expected
.
to
validate_presence_of
(
:sha
)
}
...
...
spec/serializers/pipeline_serializer_spec.rb
View file @
8367e91f
...
...
@@ -113,7 +113,7 @@ describe PipelineSerializer do
it
"verifies number of queries"
do
recorded
=
ActiveRecord
::
QueryRecorder
.
new
{
subject
}
expect
(
recorded
.
count
).
to
be_within
(
1
).
of
(
6
2
)
expect
(
recorded
.
count
).
to
be_within
(
1
).
of
(
6
4
)
expect
(
recorded
.
cached_count
).
to
eq
(
0
)
end
...
...
spec/services/ci/retry_build_service_spec.rb
View file @
8367e91f
...
...
@@ -22,7 +22,7 @@ describe Ci::RetryBuildService, :services do
%i[type lock_version target_url base_tags
commit_id deployments erased_by_id last_deployment project_id
runner_id tag_taggings taggings tags trigger_request_id
user_id auto_canceled_by_id retried]
.
freeze
user_id auto_canceled_by_id retried
sourced_pipelines
]
.
freeze
shared_examples
'build duplication'
do
let
(
:build
)
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