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
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-07-25 12:10:16 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-07-25 12:10:16 +0300
commitacad0870f7fd0cfe163a9d3a248a4a3eb8ca343d (patch)
treeafc7b07db38fbc23a5becced3244776578b01d55 /spec/scripts
parentccb37f9759b534764404b50e31daf8c18e6def91 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/scripts')
-rw-r--r--spec/scripts/trigger-build_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/scripts/trigger-build_spec.rb b/spec/scripts/trigger-build_spec.rb
index 3ac383e8d30..1dd1f429b43 100644
--- a/spec/scripts/trigger-build_spec.rb
+++ b/spec/scripts/trigger-build_spec.rb
@@ -237,8 +237,14 @@ RSpec.describe Trigger, feature_category: :tooling do
describe "TRIGGER_BRANCH" do
context 'when CNG_BRANCH is not set' do
it 'sets TRIGGER_BRANCH to master' do
+ stub_env('CI_PROJECT_NAMESPACE', 'gitlab-org')
expect(subject.variables['TRIGGER_BRANCH']).to eq('master')
end
+
+ it 'sets TRIGGER_BRANCH to main-jh on JH side' do
+ stub_env('CI_PROJECT_NAMESPACE', 'gitlab-cn')
+ expect(subject.variables['TRIGGER_BRANCH']).to eq('main-jh')
+ end
end
context 'when CNG_BRANCH is set' do
@@ -261,6 +267,20 @@ RSpec.describe Trigger, feature_category: :tooling do
end
it 'sets TRIGGER_BRANCH to the corresponding stable branch' do
+ stub_env('CI_PROJECT_NAMESPACE', 'gitlab-org')
+ expect(subject.variables['TRIGGER_BRANCH']).to eq(ref)
+ end
+ end
+
+ context 'when CI_COMMIT_REF_NAME is a stable branch on JH side' do
+ let(:ref) { '14-10-stable' }
+
+ before do
+ stub_env('CI_COMMIT_REF_NAME', "#{ref}-jh")
+ end
+
+ it 'sets TRIGGER_BRANCH to the corresponding stable branch' do
+ stub_env('CI_PROJECT_NAMESPACE', 'gitlab-cn')
expect(subject.variables['TRIGGER_BRANCH']).to eq(ref)
end
end