Netflix-Skunkworks / Scumblr

Web framework that allows performing periodic syncs of data sources and performing analysis on the identified results
Apache License 2.0
2.64k stars 318 forks source link

Move calls to #skip inside test instance methods to fix failure when Sketchy isn't configured #178

Closed ajstiles closed 7 years ago

ajstiles commented 7 years ago

Calls to #skip were at class scope leading to this error when Sketchy wasn't configured:

test/models/results_test.rb:151:in `<class:ResultTest>': undefined method `skip' for ResultTest:Class (NoMethodError)
  from test/models/results_test.rb:3:in `<main>'

This commit moves those calls to #skip into the test instance methods to fix this error.

sbehrens commented 7 years ago

It looks like if skip is moved outside of the method definition, the context on the skipped method isn't included (which i'd like to have). Here's an example:

 SKIP["test_can_conect_and_list_S3", AwsTest, 13.808750869939104]
 test_can_conect_and_list_S3#AwsTest (13.81s)
        Not deployed on AWS, skipping...
        test/support/aws_test.rb:12:in `block in <class:AwsTest>'

I'm not sure what's triggering this issue, have you removed sketchy_url from your configuration file?

can

ajstiles commented 7 years ago

I'm not clear about your question above. Google is failing me - would you point me to that example on Github? I was proposing moving the skip method inside the test definition.

It looks like if skip is moved outside of the method definition, the context on the skipped method isn't included (which i'd like to have). Here's an example:

Would you mind clarifying this?

I don't have anything configured for sketchy_url as I never setup a scumblr.rb file.

sbehrens commented 7 years ago

Hi @ajstiles,

I'm trying to determine why you are seeing the error in the first place (since I can reproduce it). Do you not have sketchy_url in your scumblr.rb file (either set to nil, "", or a value)?

ajstiles commented 7 years ago

I don't have a scumblr.rb initializer file. I never renamed it from the .example after cloning the repo.

sbehrens commented 7 years ago

Hi @ajstiles,

If you rename the file to scumblr.rb that will resolve the issue. The tool will not run correctly with that file so that is why you are seeing the error.

-Scott