splunk / splunk-sdk-ruby

Splunk Software Development Kit for Ruby
http://dev.splunk.com
Apache License 2.0
36 stars 21 forks source link

Running Test Suite #38

Closed DavidGeukers closed 10 years ago

DavidGeukers commented 10 years ago

Cloned repo and ran tests. Looks to only be passing 35% of tests.

Is there something special that needs to be done before running tests?

stelles commented 10 years ago

Usually not, could you please provide a bit more information about which tests are failing?

DavidGeukers commented 10 years ago

178 tests, 2600 assertions, 0 failures, 228 errors, 0 pendings, 0 omissions, 0 notifications 35.9551% passed

For which tests are failing, I'll toss in a random sampling:

test_create_and_delete_stanzas(ConfigurationFileTestCase) Errno::ENOENT: No such file or directory - /Users/David/.splunkrc NoMethodError: undefined method `server_requires_restart?' for nil:NilClass

test_disable_enable(EntityTestCase) Errno::ENOENT: No such file or directory - /Users/David/.splunkrc NoMethodError: undefined method `delete' for nil:NilClass

test_submit_via_attach(IndexTestCase) Errno::ENOENT: No such file or directory - /Users/David/.splunkrc NoMethodError: undefined method `splunk_version' for nil:NilClass

test_create_and_delete_tcp_raw_with_restrictToHost(InputsTest) Errno::ENOENT: No such file or directory - /Users/David/.splunkrc NoMethodError: undefined method `each' for nil:NilClass

test_each_and_values(JobsTestCase) Errno::ENOENT: No such file or directory - /Users/David/.splunkrc NoMethodError: undefined method `server_requires_restart?' for nil:NilClass

test_setttl(LongJobTestCase) Errno::ENOENT: No such file or directory - /Users/David/.splunkrc NoMethodError: undefined method `server_requires_restart?' for nil:NilClass

test_settings(ServiceTestCase) Errno::ENOENT: No such file or directory - /Users/David/.splunkrc NoMethodError: undefined method `server_requires_restart?' for nil:NilClass

test_has_key(TestCollection) Errno::ENOENT: No such file or directory - /Users/David/.splunkrc NoMethodError: undefined method `request' for nil:NilClass

test_roles(UserTestCase) Errno::ENOENT: No such file or directory - /Users/DerGeuken/.splunkrc NoMethodError: undefined method `users' for nil:NilClass

stelles commented 10 years ago

That looks like a build error. It seems that the gem file isn't being install correctly. If you can try the following commands in your splunk-sdk-ruby directory.

gem install rake
rake install
gem install splunk-sdk-ruby
gem splunk-sdk-ruby
bundle

I've had a lot of success with this build.

EDIT: It may also be an authentication problem. I recommend having the .splunkrc file in your $HOME folder. Following these steps should help. http://dev.splunk.com/view/ruby-sdk/SP-CAAAENY