diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-16 21:08:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-16 21:08:22 +0300 |
commit | 123c68a7cf788ace140e57e478a12c5b7ac893ae (patch) | |
tree | b36e565ecd895ee46c1713f3734308cfce0e6ba9 /spec/services/ci | |
parent | 862d225ca0d8eb452e56b8fe5a0109aac796e872 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/ci')
-rw-r--r-- | spec/services/ci/create_pipeline_service_spec.rb | 38 | ||||
-rw-r--r-- | spec/services/ci/expire_pipeline_cache_service_spec.rb | 4 | ||||
-rw-r--r-- | spec/services/ci/retry_build_service_spec.rb | 6 |
3 files changed, 5 insertions, 43 deletions
diff --git a/spec/services/ci/create_pipeline_service_spec.rb b/spec/services/ci/create_pipeline_service_spec.rb index 4f624368215..04e57b1a2d4 100644 --- a/spec/services/ci/create_pipeline_service_spec.rb +++ b/spec/services/ci/create_pipeline_service_spec.rb @@ -914,44 +914,6 @@ describe Ci::CreatePipelineService do end end - context 'with resource group' do - context 'when resource group is defined' do - before do - config = YAML.dump( - test: { stage: 'test', script: 'ls', resource_group: resource_group_key } - ) - - stub_ci_pipeline_yaml_file(config) - end - - let(:resource_group_key) { 'iOS' } - - it 'persists the association correctly' do - result = execute_service - deploy_job = result.builds.find_by_name!(:test) - resource_group = project.resource_groups.find_by_key!(resource_group_key) - - expect(result).to be_persisted - expect(deploy_job.resource_group.key).to eq(resource_group_key) - expect(project.resource_groups.count).to eq(1) - expect(resource_group.builds.count).to eq(1) - expect(resource_group.resources.count).to eq(1) - expect(resource_group.resources.first.build).to eq(nil) - end - - context 'when resourc group key includes predefined variables' do - let(:resource_group_key) { '$CI_COMMIT_REF_NAME-$CI_JOB_NAME' } - - it 'interpolates the variables into the key correctly' do - result = execute_service - - expect(result).to be_persisted - expect(project.resource_groups.exists?(key: 'master-test')).to eq(true) - end - end - end - end - context 'with timeout' do context 'when builds with custom timeouts are configured' do before do diff --git a/spec/services/ci/expire_pipeline_cache_service_spec.rb b/spec/services/ci/expire_pipeline_cache_service_spec.rb index ff2d286465a..f7fc73d9f9c 100644 --- a/spec/services/ci/expire_pipeline_cache_service_spec.rb +++ b/spec/services/ci/expire_pipeline_cache_service_spec.rb @@ -11,7 +11,7 @@ describe Ci::ExpirePipelineCacheService do describe '#execute' do it 'invalidates Etag caching for project pipelines path' do pipelines_path = "/#{project.full_path}/pipelines.json" - new_mr_pipelines_path = "/#{project.full_path}/merge_requests/new.json" + new_mr_pipelines_path = "/#{project.full_path}/-/merge_requests/new.json" pipeline_path = "/#{project.full_path}/pipelines/#{pipeline.id}.json" expect_any_instance_of(Gitlab::EtagCaching::Store).to receive(:touch).with(pipelines_path) @@ -24,7 +24,7 @@ describe Ci::ExpirePipelineCacheService do it 'invalidates Etag caching for merge request pipelines if pipeline runs on any commit of that source branch' do pipeline = create(:ci_empty_pipeline, status: 'created', project: project, ref: 'master') merge_request = create(:merge_request, source_project: project, source_branch: pipeline.ref) - merge_request_pipelines_path = "/#{project.full_path}/merge_requests/#{merge_request.iid}/pipelines.json" + merge_request_pipelines_path = "/#{project.full_path}/-/merge_requests/#{merge_request.iid}/pipelines.json" allow_any_instance_of(Gitlab::EtagCaching::Store).to receive(:touch) expect_any_instance_of(Gitlab::EtagCaching::Store).to receive(:touch).with(merge_request_pipelines_path) diff --git a/spec/services/ci/retry_build_service_spec.rb b/spec/services/ci/retry_build_service_spec.rb index 76fe6f53a11..b1368f7776b 100644 --- a/spec/services/ci/retry_build_service_spec.rb +++ b/spec/services/ci/retry_build_service_spec.rb @@ -31,7 +31,7 @@ describe Ci::RetryBuildService do job_artifacts_container_scanning job_artifacts_dast job_artifacts_license_management job_artifacts_performance job_artifacts_codequality job_artifacts_metrics scheduled_at - job_variables waiting_for_resource_at].freeze + job_variables].freeze IGNORE_ACCESSORS = %i[type lock_version target_url base_tags trace_sections @@ -40,14 +40,14 @@ describe Ci::RetryBuildService do user_id auto_canceled_by_id retried failure_reason sourced_pipelines artifacts_file_store artifacts_metadata_store metadata runner_session trace_chunks upstream_pipeline_id - artifacts_file artifacts_metadata artifacts_size commands resource resource_group_id].freeze + artifacts_file artifacts_metadata artifacts_size commands].freeze shared_examples 'build duplication' do let(:another_pipeline) { create(:ci_empty_pipeline, project: project) } let(:build) do create(:ci_build, :failed, :expired, :erased, :queued, :coverage, :tags, - :allowed_to_fail, :on_tag, :triggered, :teardown_environment, :resource_group, + :allowed_to_fail, :on_tag, :triggered, :teardown_environment, description: 'my-job', stage: 'test', stage_id: stage.id, pipeline: pipeline, auto_canceled_by: another_pipeline, scheduled_at: 10.seconds.since) |