diff --git a/spec/models/fluentd/agent_spec.rb b/spec/models/fluentd/agent_spec.rb index a946ca7..0baef63 100644 --- a/spec/models/fluentd/agent_spec.rb +++ b/spec/models/fluentd/agent_spec.rb @@ -98,7 +98,7 @@ describe Fluentd::Agent do end end - describe "TdAgent" do + describe "TdAgent", td_agent_required: true do let(:described_class) { Fluentd::Agent::TdAgent } # override nested described_class behavior as https://github.com/rspec/rspec-core/issues/1114 it_should_behave_like "Fluentd::Agent has common behavior" diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d315e94..e4c349f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -62,6 +62,12 @@ RSpec.configure do |config| # rspec 2.99 config.infer_spec_type_from_file_location! + unless File.directory?("/opt/td-agent") + # including td-agent specific tests, so some tests will fail if the system has no td-agent + warn "\n\nSkipping td-agent specific tests (system has no td-agent)\n\n" + config.filter_run_excluding :td_agent_required => true + end + config.after(:suite) do FileUtils.rm_rf FluentdUI.data_dir end