Commit 4c0a1af9 authored by Dan Davison's avatar Dan Davison

Merge branch 'ml-update-qa-framework-default-branch' into 'master'

Set default branch for QA tests to main

See merge request gitlab-org/gitlab!62631
parents e3a29f0a dd3c5312
...@@ -57,7 +57,7 @@ module QA ...@@ -57,7 +57,7 @@ module QA
end end
def default_branch def default_branch
ENV['QA_DEFAULT_BRANCH'] || 'master' ENV['QA_DEFAULT_BRANCH'] || 'main'
end end
def log_destination def log_destination
......
...@@ -10,7 +10,7 @@ module QA ...@@ -10,7 +10,7 @@ module QA
let!(:target) do let!(:target) do
Resource::Repository::Commit.fabricate_via_api! do |commit| Resource::Repository::Commit.fabricate_via_api! do |commit|
commit.project = project commit.project = project
commit.branch = 'master' commit.branch = project.default_branch
commit.add_files([ commit.add_files([
{ file_path: '.gitlab/CODEOWNERS', content: '* @root' } { file_path: '.gitlab/CODEOWNERS', content: '* @root' }
]) ])
...@@ -21,7 +21,7 @@ module QA ...@@ -21,7 +21,7 @@ module QA
Resource::Repository::Commit.fabricate_via_api! do |commit| Resource::Repository::Commit.fabricate_via_api! do |commit|
commit.project = project commit.project = project
commit.branch = 'codeowners_test' commit.branch = 'codeowners_test'
commit.start_branch = 'master' commit.start_branch = project.default_branch
commit.add_files([ commit.add_files([
{ file_path: 'test1.txt', content: '1' } { file_path: 'test1.txt', content: '1' }
]) ])
...@@ -50,13 +50,13 @@ module QA ...@@ -50,13 +50,13 @@ module QA
# so we unprotect it first and then protect it again with the desired parameters # so we unprotect it first and then protect it again with the desired parameters
Resource::ProtectedBranch.unprotect_via_api! do |branch| Resource::ProtectedBranch.unprotect_via_api! do |branch|
branch.project = project branch.project = project
branch.branch_name = 'master' branch.branch_name = project.default_branch
end end
Resource::ProtectedBranch.fabricate_via_api! do |branch| Resource::ProtectedBranch.fabricate_via_api! do |branch|
branch.project = project branch.project = project
branch.new_branch = false branch.new_branch = false
branch.branch_name = 'master' branch.branch_name = project.default_branch
branch.allowed_to_push = { roles: Resource::ProtectedBranch::Roles::NO_ONE } branch.allowed_to_push = { roles: Resource::ProtectedBranch::Roles::NO_ONE }
branch.allowed_to_merge = { roles: Resource::ProtectedBranch::Roles::MAINTAINERS } branch.allowed_to_merge = { roles: Resource::ProtectedBranch::Roles::MAINTAINERS }
branch.require_code_owner_approval = true branch.require_code_owner_approval = true
......
...@@ -189,9 +189,9 @@ RSpec.describe QA::Specs::Helpers::ContextSelector do ...@@ -189,9 +189,9 @@ RSpec.describe QA::Specs::Helpers::ContextSelector do
it 'runs on default branch pipelines' do it 'runs on default branch pipelines' do
group = describe_successfully do group = describe_successfully do
it('runs on master pipeline given a single pipeline', only: { pipeline: :master }) {} it('runs on main pipeline given a single pipeline', only: { pipeline: :main }) {}
it('runs in master given an array of pipelines', only: { pipeline: [:canary, :master] }) {} it('runs in main given an array of pipelines', only: { pipeline: [:canary, :main] }) {}
it('does not run in non-default pipelines', only: { pipeline: [:nightly, :not_nightly, :not_master] }) {} it('does not run in non-default pipelines', only: { pipeline: [:nightly, :not_nightly, :not_main] }) {}
end end
aggregate_failures do aggregate_failures do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment