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-05-17 19:05:49 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-05-17 19:05:49 +0300
commit43a25d93ebdabea52f99b05e15b06250cd8f07d7 (patch)
treedceebdc68925362117480a5d672bcff122fb625b /spec/lib/gitlab/kas/client_spec.rb
parent20c84b99005abd1c82101dfeff264ac50d2df211 (diff)
Add latest changes from gitlab-org/gitlab@16-0-stable-eev16.0.0-rc42
Diffstat (limited to 'spec/lib/gitlab/kas/client_spec.rb')
-rw-r--r--spec/lib/gitlab/kas/client_spec.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/lib/gitlab/kas/client_spec.rb b/spec/lib/gitlab/kas/client_spec.rb
index 9a0fa6c4067..5668c265611 100644
--- a/spec/lib/gitlab/kas/client_spec.rb
+++ b/spec/lib/gitlab/kas/client_spec.rb
@@ -109,6 +109,35 @@ RSpec.describe Gitlab::Kas::Client do
it { expect(subject).to eq(agent_configurations) }
end
+ describe '#send_git_push_event' do
+ let(:stub) { instance_double(Gitlab::Agent::Notifications::Rpc::Notifications::Stub) }
+ let(:request) { instance_double(Gitlab::Agent::Notifications::Rpc::GitPushEventRequest) }
+ let(:project_param) { instance_double(Gitlab::Agent::Notifications::Rpc::Project) }
+ let(:response) { double(Gitlab::Agent::Notifications::Rpc::GitPushEventResponse) }
+
+ subject { described_class.new.send_git_push_event(project: project) }
+
+ before do
+ expect(Gitlab::Agent::Notifications::Rpc::Notifications::Stub).to receive(:new)
+ .with('example.kas.internal', :this_channel_is_insecure, timeout: described_class::TIMEOUT)
+ .and_return(stub)
+
+ expect(Gitlab::Agent::Notifications::Rpc::Project).to receive(:new)
+ .with(id: project.id, full_path: project.full_path)
+ .and_return(project_param)
+
+ expect(Gitlab::Agent::Notifications::Rpc::GitPushEventRequest).to receive(:new)
+ .with(project: project_param)
+ .and_return(request)
+
+ expect(stub).to receive(:git_push_event)
+ .with(request, metadata: { 'authorization' => 'bearer test-token' })
+ .and_return(response)
+ end
+
+ it { expect(subject).to eq(response) }
+ end
+
describe 'with grpcs' do
let(:stub) { instance_double(Gitlab::Agent::ConfigurationProject::Rpc::ConfigurationProject::Stub) }
let(:credentials) { instance_double(GRPC::Core::ChannelCredentials) }