Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-05-25 18:08:05 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-05-25 18:08:05 +0300
commit4dc41ac252c0bfefb9bc55a8627262cc76c69d5e (patch)
tree24bd114dee0235c3874d83d57d64abab87b39a3c /qa
parentba9892d3c122a4f437b4b38926fb75848deaf097 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/specs/features/api/4_verify/api_variable_inheritance_with_forward_pipeline_variables_spec.rb32
-rw-r--r--qa/qa/specs/features/shared_contexts/variable_inheritance_shared_context.rb30
2 files changed, 25 insertions, 37 deletions
diff --git a/qa/qa/specs/features/api/4_verify/api_variable_inheritance_with_forward_pipeline_variables_spec.rb b/qa/qa/specs/features/api/4_verify/api_variable_inheritance_with_forward_pipeline_variables_spec.rb
index 18505e5e948..d5bc31311cb 100644
--- a/qa/qa/specs/features/api/4_verify/api_variable_inheritance_with_forward_pipeline_variables_spec.rb
+++ b/qa/qa/specs/features/api/4_verify/api_variable_inheritance_with_forward_pipeline_variables_spec.rb
@@ -29,20 +29,14 @@ module QA
start_pipeline_via_api_with_variable(i + 1)
wait_for_pipelines
- # Is inheritable when true
- expect(child1_pipeline).to have_variable(key: key, value: value),
- "Expected to find `{key: 'TEST_VAR', value: 'This is great!'}`" \
- " but got #{child1_pipeline.pipeline_variables}"
+ # When forward:pipeline_variables is true
+ expect_downstream_pipeline_to_inherit_variable
- # Is not inheritable when false
- expect(child2_pipeline).not_to have_variable(key: key, value: value),
- "Did not expect to find `{key: 'TEST_VAR', value: 'This is great!'}`" \
- " but got #{child2_pipeline.pipeline_variables}"
+ # When forward:pipeline_variables is false
+ expect_downstream_pipeline_not_to_inherit_variable(upstream_project, 'child2_trigger')
- # Is not inheritable by default
- expect(downstream1_pipeline).not_to have_variable(key: key, value: value),
- "Did not expect to find `{key: 'TEST_VAR', value: 'This is great!'}`" \
- " but got #{downstream1_pipeline.pipeline_variables}"
+ # When forward:pipeline_variables is default
+ expect_downstream_pipeline_not_to_inherit_variable(downstream1_project, 'downstream1_trigger')
end
end
@@ -84,6 +78,20 @@ module QA
YAML
}
end
+
+ def expect_downstream_pipeline_to_inherit_variable
+ pipeline = downstream_pipeline(upstream_project, 'child1_trigger')
+ expect(pipeline).to have_variable(key: key, value: value),
+ "Expected to find `{key: 'TEST_VAR', value: 'This is great!'}`" \
+ " but got #{pipeline.pipeline_variables}"
+ end
+
+ def expect_downstream_pipeline_not_to_inherit_variable(project, bridge_name)
+ pipeline = downstream_pipeline(project, bridge_name)
+ expect(pipeline).not_to have_variable(key: key, value: value),
+ "Did not expect to find `{key: 'TEST_VAR', value: 'This is great!'}`" \
+ " but got #{pipeline.pipeline_variables}"
+ end
end
end
end
diff --git a/qa/qa/specs/features/shared_contexts/variable_inheritance_shared_context.rb b/qa/qa/specs/features/shared_contexts/variable_inheritance_shared_context.rb
index 155a6db5975..0c4eee2909e 100644
--- a/qa/qa/specs/features/shared_contexts/variable_inheritance_shared_context.rb
+++ b/qa/qa/specs/features/shared_contexts/variable_inheritance_shared_context.rb
@@ -66,7 +66,8 @@ module QA
def wait_for_pipelines
Support::Waiter.wait_until(max_duration: 300, sleep_interval: 10) do
- upstream_pipeline.status == 'success' && downstream1_pipeline.status == 'success'
+ upstream_pipeline.status == 'success' &&
+ downstream_pipeline(downstream1_project, 'downstream1_trigger').status == 'success'
end
end
@@ -106,31 +107,10 @@ module QA
end
end
- def child1_pipeline
+ def downstream_pipeline(project, bridge_name)
Resource::Pipeline.fabricate_via_api! do |pipeline|
- pipeline.project = upstream_project
- pipeline.id = upstream_pipeline.downstream_pipeline_id(bridge_name: 'child1_trigger')
- end
- end
-
- def child2_pipeline
- Resource::Pipeline.fabricate_via_api! do |pipeline|
- pipeline.project = upstream_project
- pipeline.id = upstream_pipeline.downstream_pipeline_id(bridge_name: 'child2_trigger')
- end
- end
-
- def downstream1_pipeline
- Resource::Pipeline.fabricate_via_api! do |pipeline|
- pipeline.project = downstream1_project
- pipeline.id = upstream_pipeline.downstream_pipeline_id(bridge_name: 'downstream1_trigger')
- end
- end
-
- def downstream2_pipeline
- Resource::Pipeline.fabricate_via_api! do |pipeline|
- pipeline.project = downstream2_project
- pipeline.id = upstream_pipeline.downstream_pipeline_id(bridge_name: 'downstream2_trigger')
+ pipeline.project = project
+ pipeline.id = upstream_pipeline.downstream_pipeline_id(bridge_name: bridge_name)
end
end