Commit 54920263 authored by Vitali Tatarintev's avatar Vitali Tatarintev

Merge branch '337071-doctor-rake-grafanaintegration-error' into 'master'

Resolve "Doctor rake task reports GrafanaIntegration error if Grafana integration is configured on a project level"

See merge request gitlab-org/gitlab!69062
parents 9c60a1fb 2e532882
...@@ -72,7 +72,7 @@ module Gitlab ...@@ -72,7 +72,7 @@ module Gitlab
end end
def valid_attribute?(data, attr) def valid_attribute?(data, attr)
data.public_send(attr) # rubocop:disable GitlabSecurity/PublicSend data.send(attr) # rubocop:disable GitlabSecurity/PublicSend
true true
rescue OpenSSL::Cipher::CipherError, TypeError rescue OpenSSL::Cipher::CipherError, TypeError
......
...@@ -5,6 +5,8 @@ require 'spec_helper' ...@@ -5,6 +5,8 @@ require 'spec_helper'
RSpec.describe Gitlab::Doctor::Secrets do RSpec.describe Gitlab::Doctor::Secrets do
let!(:user) { create(:user, otp_secret: "test") } let!(:user) { create(:user, otp_secret: "test") }
let!(:group) { create(:group, runners_token: "test") } let!(:group) { create(:group, runners_token: "test") }
let!(:project) { create(:project) }
let!(:grafana_integration) { create(:grafana_integration, project: project, token: "test") }
let(:logger) { double(:logger).as_null_object } let(:logger) { double(:logger).as_null_object }
subject { described_class.new(logger).run! } subject { described_class.new(logger).run! }
...@@ -39,4 +41,12 @@ RSpec.describe Gitlab::Doctor::Secrets do ...@@ -39,4 +41,12 @@ RSpec.describe Gitlab::Doctor::Secrets do
subject subject
end end
end end
context 'when GrafanaIntegration token is set via private method' do
it 'can access GrafanaIntegration token value' do
expect(logger).to receive(:info).with(/GrafanaIntegration failures: 0/)
subject
end
end
end end
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