Fix spec. Add PipelineScheduleVariable for import_export

This commit is contained in:
Shinya Maeda 2017-07-01 19:23:41 +09:00
parent 23f3c73355
commit b6f41544d8
5 changed files with 10 additions and 4 deletions

View File

@ -5,6 +5,6 @@ module Ci
belongs_to :pipeline_schedule
validates :key, uniqueness: { scope: :pipeline_schedule_id }
validates :key, uniqueness: { scope: :pipeline_schedule_id }, presence: { unless: :importing? }
end
end

View File

@ -9,7 +9,7 @@ and a list of **user-defined variables**.
The variables can be overwritten and they take precedence over each other in
this order:
1. [Trigger variables][triggers] or [scheduled pipeline variables](../../user/project/pipelines/schedules#making-use-of-scheduled-pipeline-variables) (take precedence over all)
1. [Trigger variables][triggers] or [scheduled pipeline variables](../../user/project/pipelines/schedules.md#making-use-of-scheduled-pipeline-variables) (take precedence over all)
1. [Secret variables](#secret-variables) or [protected secret variables](#protected-secret-variables)
1. YAML-defined [job-level variables](../yaml/README.md#job-variables)
1. YAML-defined [global variables](../yaml/README.md#variables)

View File

@ -42,7 +42,8 @@ project_tree:
- :stages
- :statuses
- :triggers
- :pipeline_schedules
- pipeline_schedules:
- :variables
- :services
- :hooks
- protected_branches:

View File

@ -132,6 +132,9 @@ pipeline_schedules:
- last_pipeline
pipeline_schedule:
- pipelines
- pipeline_schedule_variables
pipeline_schedule_variables:
- pipeline_schedule
deploy_keys:
- user
- deploy_keys_projects

View File

@ -1375,8 +1375,10 @@ describe Ci::Build, :models do
context 'when a job was triggered by a pipeline schedule' do
let(:pipeline_schedule) { create(:ci_pipeline_schedule, project: project) }
let!(:pipeline_schedule_variable) do
create(:ci_pipeline_schedule_variable, key: 'SCHEDULE_VARIABLE_KEY',
create(:ci_pipeline_schedule_variable,
key: 'SCHEDULE_VARIABLE_KEY',
pipeline_schedule: pipeline_schedule)
end