Closed azatoth closed 11 years ago
Hey, thanks for your contribution. I like the way you're handling this, by allowing it to be configured via the querystring.
One thing, though, this change massively breaks the test suite. If the failures are fixed I'll be happy to merge this in.
I would love to, but I've failed to grasp how to actually run the tests; i.e. which environment is required etc... I actually thought the test routines was broken, as "rake test" just bailed out for me.
Yeah, testing unfortunately isn't as simple as I'd wish it was.
With Redmine Github Hook being a Redmine plugin it needs to be run inside a full Redmine installation. The plugin writing tutorial at http://www.redmine.org/projects/redmine/wiki/Plugin_Tutorial#Testing-your-plugin has some instructions for how to get it setup.
The short version is (I believe):
rake test
should run the tests.Let me know if that doesn't work out for you, and especially what messages rake test
bails out with. I might need to document this in further detail.
It bails out at the moment with following text:
[0:1][carl@carl-excito redmine_github_hook] «koppen $»$ rake test RAILS_ENV=test
/home/carl/.rvm/rubies/ruby-1.9.2-p180/bin/ruby -I"lib:test" -I"/home/carl/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2.2/lib" "/home/carl/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb" "test/functional/github_hook_controller_test.rb"
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- /home/carl/Downloads/redmine-1.4.4/vendor/test/test_helper (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from /home/carl/Downloads/redmine-1.4.4/vendor/plugins/redmine_github_hook/test/test_helper.rb:2:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from /home/carl/Downloads/redmine-1.4.4/vendor/plugins/redmine_github_hook/test/functional/github_hook_controller_test.rb:1:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from /home/carl/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:15:in `block in <main>'
from /home/carl/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:4:in `select'
from /home/carl/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:4:in `<main>'
rake aborted!
Command failed with status (1): [/home/carl/.rvm/rubies/ruby-1.9.2-p180/bin...]
Tasks: TOP => test
(See full trace by running task with --trace)
Oh, I missed you're using Redmine 1.4.
master is currently tracking Redmine 2.x, which expects plugins to be in Rails.root/plugins
, not Rails.root/vendor/plugins
, which I suspect is why you're seeing that error.
You should be able to run the tests on the redmine_1.x branch, but there is no rake task for it (I think), so you'll have to do
ruby -Itest test/functional/github_hooks_controller.rb
Hi,
Why this correction (multi-repo problem) isn't merged on the master branch (for 2.x redmine users) ?
Thanks.
This specific pull request adds has only been tested for Redmine 1.4, thus has only been added to the Redmine 1.4 branch. Actually, I should be closing this since it was moved to pull request #28 and merged there.
@rodrigueznicolas , I'd be very happy to merge a pull request adding and testing this feature to master.
We want to handle this in a nice way, thus we enable posibility to update "default", "specific" and "all" git repos (default might or might not be a git repo, so we'll have to handle that as well)
To update a specific repo, add parameter "repository_id=NN" to the query string. to update all repos, add "update_all=yes"