Fix spec. Add PipelineScheduleVariable for import_export

This commit is contained in:
Shinya Maeda 2017-07-01 19:23:41 +09:00
parent 5e7db4e36c
commit 324cfe0f9b
5 changed files with 8 additions and 5 deletions

View file

@ -5,6 +5,6 @@ module Ci
belongs_to :pipeline_schedule belongs_to :pipeline_schedule
validates :key, uniqueness: { scope: :pipeline_schedule_id } validates :key, uniqueness: { scope: :pipeline_schedule_id }, presence: { unless: :importing? }
end end
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 The variables can be overwritten and they take precedence over each other in
this order: 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. [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 [job-level variables](../yaml/README.md#job-variables)
1. YAML-defined [global variables](../yaml/README.md#variables) 1. YAML-defined [global variables](../yaml/README.md#variables)

View file

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

View file

@ -130,9 +130,9 @@ pipeline_schedules:
- owner - owner
- pipelines - pipelines
- last_pipeline - last_pipeline
- variables
pipeline_schedule: pipeline_schedule:
- pipelines - pipelines
- pipeline_schedule_variables
pipeline_schedule_variables: pipeline_schedule_variables:
- pipeline_schedule - pipeline_schedule
deploy_keys: deploy_keys:

View file

@ -1371,8 +1371,10 @@ describe Ci::Build, :models do
context 'when a job was triggered by a pipeline schedule' do context 'when a job was triggered by a pipeline schedule' do
let(:pipeline_schedule) { create(:ci_pipeline_schedule, project: project) } let(:pipeline_schedule) { create(:ci_pipeline_schedule, project: project) }
let!(:pipeline_schedule_variable) do 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) pipeline_schedule: pipeline_schedule)
end end