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
end
def default_branch
ENV['QA_DEFAULT_BRANCH'] || 'master'
ENV['QA_DEFAULT_BRANCH'] || 'main'
end
def log_destination
......
......@@ -10,7 +10,7 @@ module QA
let!(:target) do
Resource::Repository::Commit.fabricate_via_api! do |commit|
commit.project = project
commit.branch = 'master'
commit.branch = project.default_branch
commit.add_files([
{ file_path: '.gitlab/CODEOWNERS', content: '* @root' }
])
......@@ -21,7 +21,7 @@ module QA
Resource::Repository::Commit.fabricate_via_api! do |commit|
commit.project = project
commit.branch = 'codeowners_test'
commit.start_branch = 'master'
commit.start_branch = project.default_branch
commit.add_files([
{ file_path: 'test1.txt', content: '1' }
])
......@@ -50,13 +50,13 @@ module QA
# so we unprotect it first and then protect it again with the desired parameters
Resource::ProtectedBranch.unprotect_via_api! do |branch|
branch.project = project
branch.branch_name = 'master'
branch.branch_name = project.default_branch
end
Resource::ProtectedBranch.fabricate_via_api! do |branch|
branch.project = project
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_merge = { roles: Resource::ProtectedBranch::Roles::MAINTAINERS }
branch.require_code_owner_approval = true
......
......@@ -189,9 +189,9 @@ RSpec.describe QA::Specs::Helpers::ContextSelector do
it 'runs on default branch pipelines' do
group = describe_successfully do
it('runs on master pipeline given a single pipeline', only: { pipeline: :master }) {}
it('runs in master given an array of pipelines', only: { pipeline: [:canary, :master] }) {}
it('does not run in non-default pipelines', only: { pipeline: [:nightly, :not_nightly, :not_master] }) {}
it('runs on main pipeline given a single pipeline', only: { pipeline: :main }) {}
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_main] }) {}
end
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