I've been trying to get Conductor running with rvm and Bundler, versus using system ruby. (I've been semi-inaccurately referring to this as "upstream" ruby, based on our desire to work upstream in pure ruby, without requiring Fedora.)
I opened https://www.aeolusproject.org/redmine/issues/3447 to track getting cucumber tests to pass there.
I ran these against ruby 1.8.7 patchlevel 357, using Bundler which got me 3.2-series Rails. With both of these in place, and various services running, I have only failure left (see task #3450 -- it seems to be reaching live Image Factory, and I'm not going to be able to fix this today, so I'm sending this out now.)
Note that, ideally, this should be tested two ways -- one on "upstream" ruby with Bundler, and the other against system ruby to make sure I didn't break anything.
We do want to get tests working with Ruby 1.9, and with all external services disabled, but that's not my focus with these particular patches.
-- Matt
This cleans up task.rb to fix a strange failure that was being encountered when using newer versions of Rails (via Bundler).
Resolves https://www.aeolusproject.org/redmine/issues/3448 --- src/app/models/task.rb | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/app/models/task.rb b/src/app/models/task.rb index 86d966c..6d65fcc 100644 --- a/src/app/models/task.rb +++ b/src/app/models/task.rb @@ -76,6 +76,8 @@ class Task < ActiveRecord::Base validates_inclusion_of :state, :in => COMPLETED_STATES + WORKING_STATES
+ after_initialize :initialize_state + # FIXME validate action depending on type / subclass # validate task_target_id, task_type_id, arg, message # depending on subclass, action, state @@ -89,11 +91,6 @@ class Task < ActiveRecord::Base ["Canceled", Task::STATE_CANCELED, "break"], ["All States", ""]]
- def initialize(params) - super - self.state = STATE_QUEUED unless self.state - end - def cancel self[:state] = STATE_CANCELED save! @@ -143,4 +140,8 @@ class Task < ActiveRecord::Base errors.add("time_ended", "Tasks ends before it's started") unless time_ended.nil? or time_started.nil? or time_ended >= time_started errors.add("time_started", "Tasks starts before it's created") unless time_started.nil? or created_at.nil? or time_started >= created_at end + + def initialize_state + self.state = STATE_QUEUED unless self.state + end end
On 07/05/2012 01:45 PM, Matt Wagner wrote:
This cleans up task.rb to fix a strange failure that was being encountered when using newer versions of Rails (via Bundler).
Resolves https://www.aeolusproject.org/redmine/issues/3448
src/app/models/task.rb | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/app/models/task.rb b/src/app/models/task.rb index 86d966c..6d65fcc 100644 --- a/src/app/models/task.rb +++ b/src/app/models/task.rb @@ -76,6 +76,8 @@ class Task < ActiveRecord::Base validates_inclusion_of :state, :in => COMPLETED_STATES + WORKING_STATES
- after_initialize :initialize_state
- # FIXME validate action depending on type / subclass # validate task_target_id, task_type_id, arg, message # depending on subclass, action, state
@@ -89,11 +91,6 @@ class Task < ActiveRecord::Base ["Canceled", Task::STATE_CANCELED, "break"], ["All States", ""]]
- def initialize(params)
- super
- self.state = STATE_QUEUED unless self.state
- end
- def cancel self[:state] = STATE_CANCELED save!
@@ -143,4 +140,8 @@ class Task < ActiveRecord::Base errors.add("time_ended", "Tasks ends before it's started") unless time_ended.nil? or time_started.nil? or time_ended >= time_started errors.add("time_started", "Tasks starts before it's created") unless time_started.nil? or created_at.nil? or time_started >= created_at end
- def initialize_state
- self.state = STATE_QUEUED unless self.state
- end end
I wasn't able to reproduce the error you were seeing. With and without bundler I see these three errors in instance.feature with all services turned off.
Scenario: Stop instance # features/instance.feature:66 Given there is a "mock1" running instance # features/step_definitions/instance_steps.rb:85 And I am on the instances page # features/step_definitions/web_steps.rb:59 When I check "mock1" instance # features/step_definitions/instance_steps.rb:106 And I press "stop_selected_instances" # features/step_definitions/web_steps.rb:68 Then I should be on the instances page # features/step_definitions/web_steps.rb:203 And I should see "mock1: stop action was successfully queued" # features/step_definitions/web_steps.rb:121 expected there to be content "mock1: stop action was successfully queued" in "\nAeolus Conductor\n\n\n\n //<![CDATA[\n window.Conductor = {}\n window.Conductor.PATH_PREFIX = \"/\"\n // This hack prevents Backbone from switching to the #/pools/1 type URLs\n // when the browser doesn't support the HTML5 History API.\n window.history || (window.history = {});\n window.history.pushState || (window.history.pushState = function(){});\n window.history.replaceState || (window.history.replaceState = function(){});\n //]]>\n\n\n\n\n\n\nMonitorAdminister\nJohn Smith\nMy Account\nLog out\n\n\n\n\nTerminate Instances\n\n\nProvider is not accessible, status of following instances will be changed to 'stopped' but their actual state is unknown.\n\n\nmock1\nCancel\n\n\n\nCopyright © 2009-2012 Red Hat, Inc.\n\n" (RSpec::Expectations::ExpectationNotMetError) ./features/step_definitions/web_steps.rb:123:in `/^(?:|I )should see "([^"]*)"$/' features/instance.feature:72:in `And I should see "mock1: stop action was successfully queued"'
Scenario: Stop multiple instances # features/instance.feature:85 Given there is a "mock1" running instance # features/step_definitions/instance_steps.rb:85 And there is a "mock2" running instance # features/step_definitions/instance_steps.rb:85 And there is a "mock3" stopped instance # features/step_definitions/instance_steps.rb:89 And I am on the instances page # features/step_definitions/web_steps.rb:59 When I check "mock1" instance # features/step_definitions/instance_steps.rb:106 And I check "mock2" instance # features/step_definitions/instance_steps.rb:106 And I check "mock3" instance # features/step_definitions/instance_steps.rb:106 And I press "stop_selected_instances" # features/step_definitions/web_steps.rb:68 Then I should be on the instances page # features/step_definitions/web_steps.rb:203 And I should see "mock1: stop action was successfully queued" # features/step_definitions/web_steps.rb:121 expected there to be content "mock1: stop action was successfully queued" in "\nAeolus Conductor\n\n\n\n //<![CDATA[\n window.Conductor = {}\n window.Conductor.PATH_PREFIX = \"/\"\n // This hack prevents Backbone from switching to the #/pools/1 type URLs\n // when the browser doesn't support the HTML5 History API.\n window.history || (window.history = {});\n window.history.pushState || (window.history.pushState = function(){});\n window.history.replaceState || (window.history.replaceState = function(){});\n //]]>\n\n\n\n\n\n\nMonitorAdminister\nJohn Smith\nMy Account\nLog out\n\n\n\n\nTerminate Instances\n\n\nProvider is not accessible, status of following instances will be changed to 'stopped' but their actual state is unknown.\n\n\nmock1\nmock2\nCancel\n\n\n\nCopyright © 2009-2012 Red Hat, Inc.\n\n" (RSpec::Expectations::ExpectationNotMetError) ./features/step_definitions/web_steps.rb:123:in `/^(?:|I )should see "([^"]*)"$/' features/instance.feature:95:in `And I should see "mock1: stop action was successfully queued"' And I should see "mock2: stop action was successfully queued" # features/step_definitions/web_steps.rb:121 And I should see "mock3: stop is an invalid action" # features/step_definitions/web_steps.rb:121
#Scenario: Create an instance over XHR # Given I request XHR # When I create mock instance # Then I should get back a partial Scenario: Stop an instance # features/instance.feature:202 Given there is a "mock1" running instance # features/step_definitions/instance_steps.rb:85 And I accept JSON # features/step_definitions/instance_steps.rb:139 When I stop "mock1" instance # features/step_definitions/instance_steps.rb:168 Then I should get back JSON object with success and errors # features/step_definitions/instance_steps.rb:173 expected: not nil got: nil (RSpec::Expectations::ExpectationNotMetError) ./features/step_definitions/instance_steps.rb:175:in `/^I should get back JSON object with success and errors$/' features/instance.feature:206:in `Then I should get back JSON object with success and errors'
On Thu, Jul 05, 2012 at 05:20:19PM -0700, Richard Su wrote:
I wasn't able to reproduce the error you were seeing. With and without bundler I see these three errors in instance.feature with all services turned off.
Thanks for testing these!
It looks like what's happening here is that this particular test will fail a bit before the error I was fixing if Deltacloud is disabled. I hadn't addressed the reliance on external dependencies yet, so I was working with Deltacloud and company running. If you enable Deltacloud, the test will fail a little further down the line, and that's the failure I fix. So this on its own won't help the standalone install.
-- Matt
Trivial fix for a bug that failed with newer test libraries.
Resolves https://www.aeolusproject.org/redmine/issues/3449 --- src/features/step_definitions/provider_steps.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/features/step_definitions/provider_steps.rb b/src/features/step_definitions/provider_steps.rb index 92d73ed..6d07463 100644 --- a/src/features/step_definitions/provider_steps.rb +++ b/src/features/step_definitions/provider_steps.rb @@ -116,7 +116,7 @@ end
Given /^there are some providers$/ do 3.times do - FactoryGirl.create :provider + FactoryGirl.create :mock_provider end end
On 07/05/2012 01:45 PM, Matt Wagner wrote:
Trivial fix for a bug that failed with newer test libraries.
Resolves https://www.aeolusproject.org/redmine/issues/3449
src/features/step_definitions/provider_steps.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/features/step_definitions/provider_steps.rb b/src/features/step_definitions/provider_steps.rb index 92d73ed..6d07463 100644 --- a/src/features/step_definitions/provider_steps.rb +++ b/src/features/step_definitions/provider_steps.rb @@ -116,7 +116,7 @@ end
Given /^there are some providers$/ do 3.times do
- FactoryGirl.create :provider
- FactoryGirl.create :mock_provider end end
This worked for me.
On 05/07/12 16:45 -0400, Matt Wagner wrote:
I've been trying to get Conductor running with rvm and Bundler, versus using system ruby. (I've been semi-inaccurately referring to this as "upstream" ruby, based on our desire to work upstream in pure ruby, without requiring Fedora.)
I opened https://www.aeolusproject.org/redmine/issues/3447 to track getting cucumber tests to pass there.
I ran these against ruby 1.8.7 patchlevel 357, using Bundler which got me 3.2-series Rails. With both of these in place, and various services running, I have only failure left (see task #3450 -- it seems to be reaching live Image Factory, and I'm not going to be able to fix this today, so I'm sending this out now.)
Note that, ideally, this should be tested two ways -- one on "upstream" ruby with Bundler, and the other against system ruby to make sure I didn't break anything.
We do want to get tests working with Ruby 1.9, and with all external services disabled, but that's not my focus with these particular patches.
-- Matt
ACK and pushed. Fwiw, this also fixed 7 failing specs for me, which puts us down to 13 (with iwhd running), and 1 failing cuke under ruby 1.8.7 (with services running). Ruby 1.9 had 3 failures, but ran in 3m13s vs ~15 minutes, wow! I also saw a speed increase on specs, but forgot to track what they were. Anyway, good work, hope to see others pitch in on getting tests improved.
-j
aeolus-devel@lists.fedorahosted.org