summaryrefslogtreecommitdiff
path: root/qa/qa/specs/features/browser_ui/4_verify/pipeline
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/specs/features/browser_ui/4_verify/pipeline')
-rw-r--r--qa/qa/specs/features/browser_ui/4_verify/pipeline/include_local_config_file_paths_with_wildcard_spec.rb6
-rw-r--r--qa/qa/specs/features/browser_ui/4_verify/pipeline/merge_mr_when_pipline_is_blocked_spec.rb2
-rw-r--r--qa/qa/specs/features/browser_ui/4_verify/pipeline/mr_event_rule_pipeline_spec.rb81
-rw-r--r--qa/qa/specs/features/browser_ui/4_verify/pipeline/pass_dotenv_variables_to_downstream_via_bridge_spec.rb2
4 files changed, 84 insertions, 7 deletions
diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/include_local_config_file_paths_with_wildcard_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/include_local_config_file_paths_with_wildcard_spec.rb
index 5083b7b0859..5b3949f9c3a 100644
--- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/include_local_config_file_paths_with_wildcard_spec.rb
+++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/include_local_config_file_paths_with_wildcard_spec.rb
@@ -1,10 +1,8 @@
# frozen_string_literal: true
module QA
- RSpec.describe 'Verify', :requires_admin do
+ RSpec.describe 'Verify' do
describe 'Include local config file paths with wildcard' do
- let(:feature_flag) { :ci_wildcard_file_paths }
-
let(:project) do
Resource::Project.fabricate_via_api! do |project|
project.name = 'project-with-pipeline'
@@ -12,7 +10,6 @@ module QA
end
before do
- Runtime::Feature.enable(feature_flag)
Flow::Login.sign_in
add_files_to_project
project.visit!
@@ -20,7 +17,6 @@ module QA
end
after do
- Runtime::Feature.disable(feature_flag)
project.remove_via_api!
end
diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/merge_mr_when_pipline_is_blocked_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/merge_mr_when_pipline_is_blocked_spec.rb
index 01aada2d6dd..b43581289ef 100644
--- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/merge_mr_when_pipline_is_blocked_spec.rb
+++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/merge_mr_when_pipline_is_blocked_spec.rb
@@ -73,7 +73,7 @@ module QA
it 'can still merge MR successfully', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/971' do
Page::MergeRequest::Show.perform do |show|
# waiting for manual action status shows status badge 'blocked' on pipelines page
- show.wait_until(reload: false) { show.has_pipeline_status?('waiting for manual action') }
+ show.has_pipeline_status?('waiting for manual action')
show.merge!
expect(show).to be_merged
diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/mr_event_rule_pipeline_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/mr_event_rule_pipeline_spec.rb
new file mode 100644
index 00000000000..47b36b55c8c
--- /dev/null
+++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/mr_event_rule_pipeline_spec.rb
@@ -0,0 +1,81 @@
+# frozen_string_literal: true
+
+require 'faker'
+
+module QA
+ RSpec.describe 'Verify', :runner do
+ context 'When job is configured to only run on merge_request_events' do
+ let(:mr_only_job_name) { 'mr_only_job' }
+ let(:non_mr_only_job_name) { 'non_mr_only_job' }
+ let(:executor) { "qa-runner-#{Faker::Alphanumeric.alphanumeric(8)}" }
+
+ let(:project) do
+ Resource::Project.fabricate_via_api! do |project|
+ project.name = 'merge-request-only-job'
+ end
+ end
+
+ let!(:runner) do
+ Resource::Runner.fabricate! do |runner|
+ runner.project = project
+ runner.name = executor
+ runner.tags = [executor]
+ end
+ end
+
+ let!(:ci_file) do
+ Resource::Repository::Commit.fabricate_via_api! do |commit|
+ commit.project = project
+ commit.commit_message = 'Add .gitlab-ci.yml'
+ commit.add_files(
+ [
+ {
+ file_path: '.gitlab-ci.yml',
+ content: <<~YAML
+ #{mr_only_job_name}:
+ script: echo 'OK'
+ rules:
+ - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
+ #{non_mr_only_job_name}:
+ script: echo 'OK'
+ rules:
+ - if: '$CI_PIPELINE_SOURCE != "merge_request_event"'
+ YAML
+ }
+ ]
+ )
+ end
+ end
+
+ let(:merge_request) do
+ Resource::MergeRequest.fabricate_via_api! do |merge_request|
+ merge_request.project = project
+ merge_request.description = Faker::Lorem.sentence
+ merge_request.target_new_branch = false
+ merge_request.file_name = 'new.txt'
+ merge_request.file_content = Faker::Lorem.sentence
+ end
+ end
+
+ before do
+ Flow::Login.sign_in
+ merge_request.visit!
+ Page::MergeRequest::Show.perform(&:click_pipeline_link)
+ end
+
+ after do
+ runner.remove_via_api!
+ project.remove_via_api!
+ end
+
+ it 'only runs the job configured to run on merge requests', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/170' do
+ Page::Project::Pipeline::Show.perform do |pipeline|
+ aggregate_failures do
+ expect(pipeline).to have_job(mr_only_job_name)
+ expect(pipeline).to have_no_job(non_mr_only_job_name)
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/pass_dotenv_variables_to_downstream_via_bridge_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/pass_dotenv_variables_to_downstream_via_bridge_spec.rb
index c1625f1e679..adacedb36ab 100644
--- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/pass_dotenv_variables_to_downstream_via_bridge_spec.rb
+++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/pass_dotenv_variables_to_downstream_via_bridge_spec.rb
@@ -41,7 +41,7 @@ module QA
after do
runner.remove_via_api!
- group.remove_via_api!
+ [upstream_project, downstream_project].each(&:remove_via_api!)
end
it 'runs the pipeline with composed config', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1086' do