akiko-pusu / redmine_issue_templates

Maintenance Repository - https://github.com/agileware-jp/redmine_issue_templates
https://www.redmine.org/plugins/redmine_issue_templates
GNU General Public License v2.0
199 stars 120 forks source link

Every rake command now fails with "spec failed." #129

Closed backaf closed 7 years ago

backaf commented 7 years ago

Today I installed the latest (master) version of the plugin. I noticed the Gemfile requires only jbuilder, therefore I executed a bundle install (by default this is without dev and test). The migration went fine and I was able to configure it in the Redmine settings.

We have a "fetch_changesets" call which runs every 5 minutes and I started to get e-mail notifications saying:

spec failed.
yard not installed (gem install yard)

I added yard to the main Gemfile and installed it. The yard message went away but spec failed remains there. Any idea what is causing this, how to debug it further and fix?

For a test I also tried the 1.5 version but this is throwing a different error:

yardoc failed.

My env details:

Environment:
  Redmine version                3.3.1.stable
  Ruby version                   1.9.3-p194 (2012-04-20) [x86_64-linux]
  Rails version                  4.2.7.1
  Environment                    production
  Database adapter               Mysql2
akiko-pusu commented 7 years ago

Hi, @backaf Thank you so much for your interest in my plugin and trying it. And so sorry to have bothered you.

I added yard to the main Gemfile and installed it. The yard message went away but spec failed remains there.

Is the task "rake redmine:fetch_changesets” failed with this message? Though this "spec failed.” is shown, I think the rake task you invoke works fine.

But I totally agree that this message, "spec failed.” , is not appropriate one. This message is caused by the rake tasks under this plugin lib/ directory, and these tasks exist only for testing to plugin itself.

So, you can stop this unnecessary message with deleting the files under plugins/redmine_issue_templates/lib/ .

Could you please try this as workaround?


Also I’m going to correct my rake files and test helper, on commit: 0e10aae. After the CI test has passed, I’m going to apply this bug fix into master branch.

In addition to this defect, I’m going to change not to use jbuilder with commit: 7888829ce. As a result, my plugin does not need to use Gemfile.

akiko-pusu commented 7 years ago

Hi, commit: 0e10aae was merged into master branch. Please let me know if you still have any problems.

akiko-pusu commented 7 years ago

This problem was fixed, thanks for your feedback!

backaf commented 7 years ago

@akiko-pusu thanks for the quick fix! I cloned the latest version, deleted both directories in lib (issue_templates and tasks) and tried to run the plugins migrate. This, however, failed:

# rake redmine:plugins:migrate RAILS_ENV=production
rake aborted!
SyntaxError: /srv/www/redmine-3.3.1/plugins/redmine_issue_templates/init.rb:43: unknown type of %string
...templates, issue_templates: %i[new edit destroy move]
...                               ^
/srv/www/redmine-3.3.1/plugins/redmine_issue_templates/init.rb:43: syntax error, unexpected $end
...templates, issue_templates: %i[new edit destroy move]
...                               ^
/var/lib/gems/1.9.1/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
/var/lib/gems/1.9.1/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require'
/var/lib/gems/1.9.1/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/var/lib/gems/1.9.1/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
/srv/www/redmine-3.3.1/lib/redmine/plugin.rb:155:in `block in load'
/srv/www/redmine-3.3.1/lib/redmine/plugin.rb:146:in `each'
/srv/www/redmine-3.3.1/lib/redmine/plugin.rb:146:in `load'
/srv/www/redmine-3.3.1/config/initializers/30-redmine.rb:21:in `<top (required)>'
/var/lib/gems/1.9.1/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:268:in `load'
/var/lib/gems/1.9.1/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:268:in `block in load'
/var/lib/gems/1.9.1/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/var/lib/gems/1.9.1/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:268:in `load'
/var/lib/gems/1.9.1/gems/railties-4.2.7.1/lib/rails/engine.rb:652:in `block in load_config_initializer'
/var/lib/gems/1.9.1/gems/activesupport-4.2.7.1/lib/active_support/notifications.rb:166:in `instrument'
/var/lib/gems/1.9.1/gems/railties-4.2.7.1/lib/rails/engine.rb:651:in `load_config_initializer'
/var/lib/gems/1.9.1/gems/railties-4.2.7.1/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
/var/lib/gems/1.9.1/gems/railties-4.2.7.1/lib/rails/engine.rb:615:in `each'
/var/lib/gems/1.9.1/gems/railties-4.2.7.1/lib/rails/engine.rb:615:in `block in <class:Engine>'
/var/lib/gems/1.9.1/gems/railties-4.2.7.1/lib/rails/initializable.rb:30:in `instance_exec'
/var/lib/gems/1.9.1/gems/railties-4.2.7.1/lib/rails/initializable.rb:30:in `run'
/var/lib/gems/1.9.1/gems/railties-4.2.7.1/lib/rails/initializable.rb:55:in `block in run_initializers'
/var/lib/gems/1.9.1/gems/railties-4.2.7.1/lib/rails/initializable.rb:44:in `each'
/var/lib/gems/1.9.1/gems/railties-4.2.7.1/lib/rails/initializable.rb:44:in `tsort_each_child'
/var/lib/gems/1.9.1/gems/railties-4.2.7.1/lib/rails/initializable.rb:54:in `run_initializers'
/var/lib/gems/1.9.1/gems/railties-4.2.7.1/lib/rails/application.rb:352:in `initialize!'
/srv/www/redmine-3.3.1/config/environment.rb:14:in `<top (required)>'
/var/lib/gems/1.9.1/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
/var/lib/gems/1.9.1/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require'
/var/lib/gems/1.9.1/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/var/lib/gems/1.9.1/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
/var/lib/gems/1.9.1/gems/railties-4.2.7.1/lib/rails/application.rb:328:in `require_environment!'
/var/lib/gems/1.9.1/gems/railties-4.2.7.1/lib/rails/application.rb:457:in `block in run_tasks_blocks'
/var/lib/gems/1.9.1/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
Tasks: TOP => redmine:plugins:migrate => environment
(See full trace by running task with --trace)

Something I've done wrong?

akiko-pusu commented 7 years ago

Hi, @backaf Above workaround is for version 0.1.5.

Now latest version was fixed this problem, so, if you cloned latest master branch, v0.1.6, you don't have to remove redmine_issue_templates/lib/ directory.

backaf commented 7 years ago

HI @akiko-pusu

I cloned again without removing any other files, the migration fails with the same error.

akiko-pusu commented 7 years ago

Sorry I missed quite important thing. Are you using ruby1.9.x? I hope not to support ruby1.9.x because support for Ruby 1.9.3, 2.0 and 2.1 has ended by Ruby community. Related: http://www.redmine.org/projects/redmine/wiki/RedmineInstall#Requirements

First, maybe I have to convert the place such as

issue_templates: %i[new edit destroy move] to issue_templates: [:new, :edit, :destroy, :move]

Not only init.rb, but also 3 controllers should be rewrited in case using ruby1.9x. If you hard to change ruby version, of course I'm going to rewrite above.

https://github.com/akiko-pusu/redmine_issue_templates/commit/aef6f9fa9574acc49f3bdc7afe4dc364002d2c57

backaf commented 7 years ago

As I am running Redmine on Debian Wheezy it might be hard to upgrade to a version of ruby which is outside of the official repositories. My long term plan is to migrate the whole server to Jessie, then Stretch but this is something that needs quite a bit of testing before I can push it into production. Lets mark this as resolved and I will plan an OS upgrade for my Redmine server.

Many thanks for your help!

akiko-pusu commented 7 years ago

@backaf, thanks for your message again. And so sorry inconvenient. I'm going to fix in a few hours. Could you please wait for a while.

akiko-pusu commented 7 years ago

Now I reverted lines that are not compatible with ruby ​​1.9 format. Sorry for trouble you. If you are still using the same environment, please try current master branch. Also other feedback are highly appreciated.

backaf commented 7 years ago

Thanks a lot for fixing this, I won't, however, be able to test it until Monday morning. I will return with the feedback after.

akiko-pusu commented 7 years ago

No problem. Have a nice weekend! FYI: Redmine 3.4 might be released in this weekend. This version has a lot of new features.

backaf commented 7 years ago

Many thanks for all the help @akiko-pusu ! I redeployed this morning and everything seems to work fine. I still need to plan the OS upgrade and move to a newer version of Ruby and Redmine :)

akiko-pusu commented 7 years ago

I'm glad to hear that! Please, feel free to leave any comment or feedback on this repository.