mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Skylight instrumentation
This allows individual installations to optionally collect performance data using [Skylight for Open Source](https://www.skylight.io/oss).
This commit is contained in:
parent
637f6ce765
commit
0c8095493a
6 changed files with 62 additions and 4 deletions
|
|
@ -30,7 +30,45 @@ describe ApplicationController, type: :controller do
|
|||
expect(controller.after_sign_in_path_for(user)).to eq conferences_path
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
describe ApplicationController, type: :request do
|
||||
let(:conference) { create(:conference) }
|
||||
|
||||
describe 'Skylight link' do
|
||||
|
||||
around do |example|
|
||||
original_value = ENV['SKYLIGHT_PUBLIC_DASHBOARD_URL']
|
||||
example.run
|
||||
ENV['SKYLIGHT_PUBLIC_DASHBOARD_URL'] = original_value
|
||||
end
|
||||
|
||||
context 'when SKYLIGHT_PUBLIC_DASHBOARD_URL is set' do
|
||||
before do
|
||||
ENV['SKYLIGHT_PUBLIC_DASHBOARD_URL'] = 'https://oss.skylight.io/app/applications/my-osem'
|
||||
end
|
||||
|
||||
it 'should include a link to view performance data' do
|
||||
get '/'
|
||||
expect(response.body).to match(/Performance data/i)
|
||||
expect(response.body).to include('https://oss.skylight.io/app/applications/my-osem')
|
||||
end
|
||||
end
|
||||
|
||||
context 'when SKYLIGHT_PUBLIC_DASHBOARD_URL is not set' do
|
||||
before do
|
||||
ENV['SKYLIGHT_PUBLIC_DASHBOARD_URL'] = nil
|
||||
end
|
||||
|
||||
it 'should not include a link to view performance data' do
|
||||
get '/'
|
||||
expect(response.body).to_not match(/performance data/i)
|
||||
expect(response.body).to_not match(/skylight/i)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue