2017-04-06 12:20:27 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2018-06-01 01:22:31 -04:00
|
|
|
describe Gitlab::Ci::Trace, :clean_gitlab_redis_shared_state do
|
2017-04-06 12:20:27 -04:00
|
|
|
let(:build) { create(:ci_build) }
|
|
|
|
let(:trace) { described_class.new(build) }
|
|
|
|
|
|
|
|
describe "associations" do
|
|
|
|
it { expect(trace).to respond_to(:job) }
|
|
|
|
it { expect(trace).to delegate_method(:old_trace).to(:job) }
|
|
|
|
end
|
|
|
|
|
2018-05-04 06:49:26 -04:00
|
|
|
context 'when live trace feature is disabled' do
|
2017-04-06 12:20:27 -04:00
|
|
|
before do
|
2018-05-04 06:49:26 -04:00
|
|
|
stub_feature_flags(ci_enable_live_trace: false)
|
2017-04-06 12:20:27 -04:00
|
|
|
end
|
2018-04-05 11:42:25 -04:00
|
|
|
|
2018-05-04 06:49:26 -04:00
|
|
|
it_behaves_like 'trace with disabled live trace feature'
|
2017-04-06 12:20:27 -04:00
|
|
|
end
|
2018-02-27 13:44:13 -05:00
|
|
|
|
2018-05-04 06:49:26 -04:00
|
|
|
context 'when live trace feature is enabled' do
|
2018-04-02 12:22:46 -04:00
|
|
|
before do
|
2018-05-04 06:49:26 -04:00
|
|
|
stub_feature_flags(ci_enable_live_trace: true)
|
2018-04-02 12:22:46 -04:00
|
|
|
end
|
|
|
|
|
2018-05-04 06:49:26 -04:00
|
|
|
it_behaves_like 'trace with enabled live trace feature'
|
2018-02-27 13:44:13 -05:00
|
|
|
end
|
2017-04-06 12:20:27 -04:00
|
|
|
end
|