diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-13 15:06:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-13 15:06:22 +0300 |
commit | 4e516dbff9767a35677fdc4a6e39005b4b564376 (patch) | |
tree | 7c650b30777b8e7f72cafb186e9446a50d3fa3be /spec/factories/ci | |
parent | 4f01ac5ba0bf72427ed4fef9b229d056dbb60e89 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/factories/ci')
-rw-r--r-- | spec/factories/ci/pipelines.rb | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/spec/factories/ci/pipelines.rb b/spec/factories/ci/pipelines.rb index 39ab574cc76..e2ec9d496bc 100644 --- a/spec/factories/ci/pipelines.rb +++ b/spec/factories/ci/pipelines.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true FactoryBot.define do + # TODO: we can remove this factory in favour of :ci_pipeline factory :ci_empty_pipeline, class: Ci::Pipeline do source { :push } ref { 'master' } @@ -10,20 +11,6 @@ FactoryBot.define do project - factory :ci_pipeline_without_jobs do - after(:build) do |pipeline| - pipeline.instance_variable_set(:@ci_yaml_file, YAML.dump({})) - end - end - - factory :ci_pipeline_with_one_job do - after(:build) do |pipeline| - allow(pipeline).to receive(:ci_yaml_file) do - pipeline.instance_variable_set(:@ci_yaml_file, YAML.dump({ rspec: { script: "ls" } })) - end - end - end - # Persist merge request head_pipeline_id # on pipeline factories to avoid circular references transient { head_pipeline_of { nil } } @@ -34,24 +21,8 @@ FactoryBot.define do end factory :ci_pipeline do - transient { config { nil } } - - after(:build) do |pipeline, evaluator| - if evaluator.config - pipeline.instance_variable_set(:@ci_yaml_file, YAML.dump(evaluator.config)) - - # Populates pipeline with errors - pipeline.config_processor if evaluator.config - else - pipeline.instance_variable_set(:@ci_yaml_file, File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml'))) - end - end - trait :invalid do - config do - { rspec: nil } - end - + yaml_errors { 'invalid YAML' } failure_reason { :config_error } end |