Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing and Continuous Integration #186

Closed
andrericardo opened this issue Oct 7, 2016 · 2 comments
Closed

Testing and Continuous Integration #186

andrericardo opened this issue Oct 7, 2016 · 2 comments

Comments

@andrericardo
Copy link
Contributor

Hello, I would like to add some initial tests, but running them with the current whatweb is a bit tricky.
For example the simple run $ ./whatweb slashdot.org reddit.com hangs when ran in rake maybe because rake eats the ARGV ? and the target list ends up being

Target List:["http://test/test*.rb"]

The whole full log is here:
https://travis-ci.org/andrericardo/WhatWeb/jobs/165846465

My branch code is here
https://github.com/andrericardo/WhatWeb/blob/continous-integration/test/test_whatweb.rb

From what I read it would be easier if whatweb had

if $0 == __FILE__
  # scripty bits
end

Is this something you are interested in having?

@bcoles
Copy link
Collaborator

bcoles commented Oct 7, 2016

Hi @andrericardo

We've been looking at implementing unit tests recently.

I'm not convinced the if $0 == __FILE__ approach would work here without some other refactoring (threads and command line parsing for starters).

Ideally the tests could be performed by instantiating a WhatWeb object then calling methods on the object. This would require some refactoring.

Perhaps in the short term you could fork a process and parse the output?

@urbanadventurer
Copy link
Owner

Thanks for the suggestion @andrericardo. Travis CI looks like a good platform for testing.

Thanks @bcoles for writing the Rake unit tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants