theforeman / foreman_default_hostgroup

A plugin to set the default hostgroup when hosts are created.
GNU General Public License v3.0
11 stars 29 forks source link

adds ability to specify multiple regex strings for a single fact #14

Closed logicminds closed 3 years ago

logicminds commented 9 years ago
logicminds commented 9 years ago

I wrote the tests for this but I have no idea how to run the tests. There is no rakefile or docs on how to run run your tests. I can document this once I know.

GregSutcliffe commented 9 years ago

Hey, thanks for this!

For running the tests, see http://projects.theforeman.org/projects/foreman/wiki/How_to_Create_a_Plugin#Testing - in short, add the plugin to a normal Foreman source install and run "rake test" or "rake test:default_hostgroup"

I'll add some comments inline, but overall it looks great.

logicminds commented 9 years ago

@GregSutcliffe I am having trouble testing. Is the load path not setup correctly? This occurs when running rake test:default_hostgroup.

/opt/rh/ruby193/root/usr/local/share/gems/bundler/gems/foreman_default_hostgroup-044ae9fec6a7/test/unit/default_hostgroup_test.rb:1:in `require': cannot load such file -- test_plugin_helper (LoadError)
        from /opt/rh/ruby193/root/usr/local/share/gems/bundler/gems/foreman_default_hostgroup-044ae9fec6a7/test/unit/default_hostgroup_test.rb:1:in `<top (required)>'
        from /opt/rh/ruby193/root/usr/local/share/gems/gems/rake-10.4.2/lib/rake/rake_test_loader.rb:10:in `require'
        from /opt/rh/ruby193/root/usr/local/share/gems/gems/rake-10.4.2/lib/rake/rake_test_loader.rb:10:in `block (2 levels) in <main>'
        from /opt/rh/ruby193/root/usr/local/share/gems/gems/rake-10.4.2/lib/rake/rake_test_loader.rb:9:in `each'
        from /opt/rh/ruby193/root/usr/local/share/gems/gems/rake-10.4.2/lib/rake/rake_test_loader.rb:9:in `block in <main>'
        from /opt/rh/ruby193/root/usr/local/share/gems/gems/rake-10.4.2/lib/rake/rake_test_loader.rb:4:in `select'
        from /opt/rh/ruby193/root/usr/local/share/gems/gems/rake-10.4.2/lib/rake/rake_test_loader.rb:4:in `<main>'
GregSutcliffe commented 9 years ago

@logicminds ugh sorry this slipped my mind - thanks for reminding me. PR looks great now - I'll try to test over the weekend. Are you still having test errors yourself?

logicminds commented 9 years ago

Yes, I am still having test errors. I have another PR that tries to automate the testing with travis much like foreman hooks. Give me a minute to push that.

logicminds commented 9 years ago

See #15 regarding testing.

GregSutcliffe commented 9 years ago

Commented on #15. Regarding the above failure, which dir are you in when running the tests, and what's the full command you're using?

EDIT: also, is the test_plugin_helper file present in the test dir of the plugin? (I assume so but lets check those assumptions :P)

logicminds commented 9 years ago

Running the rake test command and the rake test default host group . It could be some dev environment setting I don't have that you might.

GregSutcliffe commented 9 years ago

Running the rake test command and the rake test default host group . It could be some dev environment setting I don't have that you might.

And that's from your Foreman dir, rather than from the plugin dir, right? And the file is present?

logicminds commented 9 years ago

That's from the foreman directory

ares commented 3 years ago

I appologize, this plugin has not been maintained for a long time. Given it has now conflicts, I'm closing. I'll try to find an active maintainer, please consider reopening after the rebase.