I’m working on a patch for Foreman Ansible, however, I’ve found it quite difficult to figure out how I can run the tests. rake -T displays “test:core” as a potential tasks, but it doesn’t really run any tests.
Did anyone manage to get this working? Wouldn’t want to have to push and wait for Jenkins to fail actually.
…Unless that would be the only way forward
I don’t think I fully understand how to use this. I’ll try to explain what I’ve done so far:
Cloned GIT of foreman_ansible repo
Added my unit test
Execute: rake test:foreman_ansible
=> It states it doesn’t know how to run this tasks (also, -T does not provide this task).
Now, when I read your text, you state that i “should run that from Foreman’s checkout”, do you mean I also have to clone the foreman repo and from there I should run the command? How does that clone know where to look for my development repo? (sorry for this total n00b question )
put gem 'foreman_ansible', :path => $FOREMAN_ANSIBLE_DIR into $FOREMAN_DIR/bundler.d/my_gems.local.rb. This tells the clone where to look for your development repo
Do the bundle install, npm install, bundle exec rake db:create db:migrate dance
Run bundle exec rake test:foreman_ansible from $FOREMAN_DIR
Aah, will try this tonight; explains a lot actually! Feels like I’ll be able to make a quantum leap once I got that set-up. Thank you for these clear steps on how to get this to run.