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>2021-07-20 12:55:51 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-20 12:55:51 +0300
commite8d2c2579383897a1dd7f9debd359abe8ae8373d (patch)
treec42be41678c2586d49a75cabce89322082698334 /spec/lib/gitlab/database_importers
parentfc845b37ec3a90aaa719975f607740c22ba6a113 (diff)
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'spec/lib/gitlab/database_importers')
-rw-r--r--spec/lib/gitlab/database_importers/instance_administrators/create_group_spec.rb4
-rw-r--r--spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb34
2 files changed, 19 insertions, 19 deletions
diff --git a/spec/lib/gitlab/database_importers/instance_administrators/create_group_spec.rb b/spec/lib/gitlab/database_importers/instance_administrators/create_group_spec.rb
index e70b34d6557..2740664d200 100644
--- a/spec/lib/gitlab/database_importers/instance_administrators/create_group_spec.rb
+++ b/spec/lib/gitlab/database_importers/instance_administrators/create_group_spec.rb
@@ -56,10 +56,10 @@ RSpec.describe Gitlab::DatabaseImporters::InstanceAdministrators::CreateGroup do
it "tracks successful install" do
expect(::Gitlab::Tracking).to receive(:event).with(
- 'instance_administrators_group', 'group_created'
+ 'instance_administrators_group', 'group_created', namespace: group
)
- result
+ subject.execute
end
it 'creates group' do
diff --git a/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb b/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb
index 28291508ac0..f5ea660ee1e 100644
--- a/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb
+++ b/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb
@@ -63,11 +63,11 @@ RSpec.describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService
application_setting.update(allow_local_requests_from_web_hooks_and_services: true)
end
- shared_examples 'has prometheus service' do |server_address|
+ shared_examples 'has prometheus integration' do |server_address|
it do
expect(result[:status]).to eq(:success)
- prometheus = project.prometheus_service
+ prometheus = project.prometheus_integration
expect(prometheus).not_to eq(nil)
expect(prometheus.api_url).to eq(server_address)
expect(prometheus.active).to eq(true)
@@ -75,7 +75,7 @@ RSpec.describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService
end
end
- it_behaves_like 'has prometheus service', 'http://localhost:9090'
+ it_behaves_like 'has prometheus integration', 'http://localhost:9090'
it 'is idempotent' do
result1 = subject.execute
@@ -86,10 +86,10 @@ RSpec.describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService
end
it "tracks successful install" do
- expect(::Gitlab::Tracking).to receive(:event).twice
- expect(::Gitlab::Tracking).to receive(:event).with('self_monitoring', 'project_created')
+ expect(::Gitlab::Tracking).to receive(:event).with("instance_administrators_group", "group_created", namespace: project.namespace)
+ expect(::Gitlab::Tracking).to receive(:event).with('self_monitoring', 'project_created', project: project, namespace: project.namespace)
- result
+ subject.execute
end
it 'creates group' do
@@ -134,13 +134,13 @@ RSpec.describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService
expect(application_setting.reload.self_monitoring_project_id).to eq(project.id)
end
- it 'creates a Prometheus service' do
+ it 'creates a Prometheus integration' do
expect(result[:status]).to eq(:success)
integrations = result[:project].reload.integrations
expect(integrations.count).to eq(1)
- # Ensures PrometheusService#self_monitoring_project? is true
+ # Ensures Integrations::Prometheus#self_monitoring_project? is true
expect(integrations.first.allow_local_api_url?).to be_truthy
end
@@ -193,12 +193,12 @@ RSpec.describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService
end
end
- context 'when local requests from hooks and services are not allowed' do
+ context 'when local requests from hooks and integrations are not allowed' do
before do
application_setting.update(allow_local_requests_from_web_hooks_and_services: false)
end
- it_behaves_like 'has prometheus service', 'http://localhost:9090'
+ it_behaves_like 'has prometheus integration', 'http://localhost:9090'
end
context 'with non default prometheus address' do
@@ -211,18 +211,18 @@ RSpec.describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService
}
end
- it_behaves_like 'has prometheus service', 'https://localhost:9090'
+ it_behaves_like 'has prometheus integration', 'https://localhost:9090'
context 'with :9090 symbol' do
let(:server_address) { :':9090' }
- it_behaves_like 'has prometheus service', 'http://localhost:9090'
+ it_behaves_like 'has prometheus integration', 'http://localhost:9090'
end
context 'with 0.0.0.0:9090' do
let(:server_address) { '0.0.0.0:9090' }
- it_behaves_like 'has prometheus service', 'http://localhost:9090'
+ it_behaves_like 'has prometheus integration', 'http://localhost:9090'
end
end
@@ -233,7 +233,7 @@ RSpec.describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService
it 'does not fail' do
expect(result).to include(status: :success)
- expect(project.prometheus_service).to be_nil
+ expect(project.prometheus_integration).to be_nil
end
end
@@ -244,7 +244,7 @@ RSpec.describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService
it 'does not fail' do
expect(result).to include(status: :success)
- expect(project.prometheus_service).to be_nil
+ expect(project.prometheus_integration).to be_nil
end
end
@@ -258,7 +258,7 @@ RSpec.describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService
it 'does not configure prometheus' do
expect(result).to include(status: :success)
- expect(project.prometheus_service).to be_nil
+ expect(project.prometheus_integration).to be_nil
end
end
@@ -267,7 +267,7 @@ RSpec.describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService
it 'does not configure prometheus' do
expect(result).to include(status: :success)
- expect(project.prometheus_service).to be_nil
+ expect(project.prometheus_integration).to be_nil
end
end