summaryrefslogtreecommitdiff
path: root/qa/qa/specs/features/browser_ui/4_verify/ci_variable/ui_variable_non_inheritable_when_forward_pipeline_variables_false_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-04-20 10:00:54 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-04-20 10:00:54 +0000
commit3cccd102ba543e02725d247893729e5c73b38295 (patch)
treef36a04ec38517f5deaaacb5acc7d949688d1e187 /qa/qa/specs/features/browser_ui/4_verify/ci_variable/ui_variable_non_inheritable_when_forward_pipeline_variables_false_spec.rb
parent205943281328046ef7b4528031b90fbda70c75ac (diff)
downloadgitlab-ce-3cccd102ba543e02725d247893729e5c73b38295.tar.gz
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'qa/qa/specs/features/browser_ui/4_verify/ci_variable/ui_variable_non_inheritable_when_forward_pipeline_variables_false_spec.rb')
-rw-r--r--qa/qa/specs/features/browser_ui/4_verify/ci_variable/ui_variable_non_inheritable_when_forward_pipeline_variables_false_spec.rb91
1 files changed, 91 insertions, 0 deletions
diff --git a/qa/qa/specs/features/browser_ui/4_verify/ci_variable/ui_variable_non_inheritable_when_forward_pipeline_variables_false_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/ci_variable/ui_variable_non_inheritable_when_forward_pipeline_variables_false_spec.rb
new file mode 100644
index 00000000000..2a0aaf6d7a3
--- /dev/null
+++ b/qa/qa/specs/features/browser_ui/4_verify/ci_variable/ui_variable_non_inheritable_when_forward_pipeline_variables_false_spec.rb
@@ -0,0 +1,91 @@
+# frozen_string_literal: true
+
+module QA
+ # TODO:
+ # Remove FF :ci_trigger_forward_variables
+ # when https://gitlab.com/gitlab-org/gitlab/-/issues/355572 is closed
+ RSpec.describe 'Verify', :runner, feature_flag: {
+ name: 'ci_trigger_forward_variables',
+ scope: :global
+ } do
+ describe 'UI defined variable' do
+ include_context 'variable inheritance test prep'
+
+ before do
+ add_ci_file(downstream1_project, [downstream1_ci_file])
+ add_ci_file(downstream2_project, [downstream2_ci_file])
+ add_ci_file(upstream_project, [upstream_ci_file, upstream_child1_ci_file, upstream_child2_ci_file])
+
+ start_pipeline_with_variable
+ Page::Project::Pipeline::Show.perform do |show|
+ Support::Waiter.wait_until { show.passed? }
+ end
+ end
+
+ it(
+ 'is not inheritable when forward:pipeline_variables is false',
+ :aggregate_failures,
+ testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/358199'
+ ) do
+ visit_job_page('child1', 'child1_job')
+ verify_job_log_does_not_show_variable_value
+
+ page.go_back
+
+ visit_job_page('downstream1', 'downstream1_job')
+ verify_job_log_does_not_show_variable_value
+ end
+
+ it(
+ 'is not inheritable by default',
+ :aggregate_failures,
+ testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/358200'
+ ) do
+ visit_job_page('child2', 'child2_job')
+ verify_job_log_does_not_show_variable_value
+
+ page.go_back
+
+ visit_job_page('downstream2', 'downstream2_job')
+ verify_job_log_does_not_show_variable_value
+ end
+
+ def upstream_ci_file
+ {
+ file_path: '.gitlab-ci.yml',
+ content: <<~YAML
+ stages:
+ - test
+ - deploy
+
+ child1_trigger:
+ stage: test
+ trigger:
+ include: .child1-ci.yml
+ forward:
+ pipeline_variables: false
+
+ # default behavior
+ child2_trigger:
+ stage: test
+ trigger:
+ include: .child2-ci.yml
+
+ downstream1_trigger:
+ stage: deploy
+ trigger:
+ project: #{downstream1_project.full_path}
+ forward:
+ pipeline_variables: false
+
+ # default behavior
+ downstream2_trigger:
+ stage: deploy
+ trigger:
+ project: #{downstream2_project.full_path}
+ YAML
+ }
+ end
+ end
+ end
+end