Project

General

Profile

Actions

Defect #16258

closed

Testing redmine with plugins. Redmine::Plugin.clear looks suspicious.

Added by Kirill Smirnov about 10 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Category:
Plugin API
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

We add several plugins to redmine code base and start running tests. Since some plugins intentionally break vanilla redmine logic a couple of tests fails. It looks confusing.
To avoid that failures we patched redmine to skip tests if specific plugins are loaded. Unfortunately it does not work for functional tests, because of this piece of code: test/functional/admin_controller_test.rb:105

  def test_no_plugins
    Redmine::Plugin.clear

    get :plugins
    assert_response :success
    assert_template 'plugins'
  end

The method Redmine::Plugin.clear looks suspicious: it clears hash of installing plugins without really unloading them. Plugin is loaded but every other class believes it does not.

It is a defect or behaviour by design?

Actions #1

Updated by Jean-Philippe Lang about 10 years ago

  • Assignee set to Jean-Philippe Lang

This is the expected behaviour, this method is for testing purpose and does not unload plugins indeed.
See the source comments: source:/tags/2.5.0/lib/redmine/plugin.rb#L110

The call to the method in this test is removed in r12987, let me know if it solves your issue.

Actions #2

Updated by Jean-Philippe Lang about 10 years ago

  • Status changed from New to Needs feedback

Other calls to Redmine::Plugin.clear are removed from tests in r12988.

Actions #3

Updated by Kirill Smirnov about 10 years ago

The patches 12987 and 12988 really solve our issue, thank you!

Actions #4

Updated by Go MAEDA over 2 years ago

  • Status changed from Needs feedback to Closed
  • Resolution set to Fixed

Kirill Smirnov wrote:

The patches 12987 and 12988 really solve our issue, thank you!

Closing this issue.

Actions

Also available in: Atom PDF