Commit 74037a1e by Antti Kaihola

Merge branch 'gabrielfalcao'

parents d4d215ba be50d4c0
# lettuce
> Version 0.2.6 - kryptonite
> Version 0.2.8 - kryptonite
## On release names
......
......@@ -15,12 +15,13 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
version = '0.2.6'
version = '0.2.8'
release = 'kryptonite'
import os
import sys
import traceback
from imp import reload
from datetime import datetime
from lettuce.core import Feature, TotalResult
......
......@@ -700,7 +700,7 @@ class Scenario(object):
regexes.append(broad_regex)
else:
regexes.append(re.compile(ur"(?:%s: %s.*)([@]?.*)%s: (%s)" % (
regexes.append(re.compile(ur"(?:%s: %s.*)([@]?.*)%s: (%s)\s*\n" % (
self.language.non_capturable_scenario_separator,
self.previous_scenario.name,
self.language.scenario_separator,
......
mox
nose
django>=1.4
sphinx
lxml
tornado
coverage
sure>=0.10.0
mock>=0.8.0
Django==1.4.1
Jinja2==2.6
Pygments==1.5
Sphinx==1.1.3
coverage==3.5.2
cssselect==0.7.1
distribute==0.6.27
docutils==0.9.1
fuzzywuzzy==0.1
ipdb==0.7
ipython==0.13
lxml==3.0alpha2
mock==1.0b1
mox==0.5.3
nose==1.1.2
sure==1.0.5
tornado==2.3
wsgiref==0.1.2
......@@ -39,7 +39,7 @@ if os.name.lower() == 'nt':
setup(
name='lettuce',
version='0.2.6',
version='0.2.8',
description='Behaviour Driven Development for python',
author=u'Gabriel Falcao',
author_email='gabriel@nacaolivre.org',
......
......@@ -206,6 +206,130 @@ Feature: Extra whitespace feature
Then the scenario definition should still match
"""
FEATURE15 = """
Feature: Redis database server
Scenario: Bootstraping Redis role
Given I have a an empty running farm
When I add redis role to this farm
Then I expect server bootstrapping as M1
And scalarizr version is last in M1
And redis is running on M1
Scenario: Restart scalarizr
When I reboot scalarizr in M1
And see 'Scalarizr terminated' in M1 log
Then scalarizr process is 2 in M1
And not ERROR in M1 scalarizr log
@rebundle
Scenario: Rebundle server
When I create server snapshot for M1
Then Bundle task created for M1
And Bundle task becomes completed for M1
@rebundle
Scenario: Use new role
Given I have a an empty running farm
When I add to farm role created by last bundle task
Then I expect server bootstrapping as M1
@rebundle
Scenario: Restart scalarizr after bundling
When I reboot scalarizr in M1
And see 'Scalarizr terminated' in M1 log
Then scalarizr process is 2 in M1
And not ERROR in M1 scalarizr log
Scenario: Bundling data
When I trigger databundle creation
Then Scalr sends DbMsr_CreateDataBundle to M1
And Scalr receives DbMsr_CreateDataBundleResult from M1
And Last databundle date updated to current
Scenario: Modifying data
Given I have small-sized database 1 on M1
When I create a databundle
And I terminate server M1
Then I expect server bootstrapping as M1
And M1 contains database 1
Scenario: Reboot server
When I reboot server M1
Then Scalr receives RebootStart from M1
And Scalr receives RebootFinish from M1
Scenario: Backuping data on Master
When I trigger backup creation
Then Scalr sends DbMsr_CreateBackup to M1
And Scalr receives DbMsr_CreateBackupResult from M1
And Last backup date updated to current
Scenario: Setup replication
When I increase minimum servers to 2 for redis role
Then I expect server bootstrapping as M2
And scalarizr version is last in M2
And M2 is slave of M1
Scenario: Restart scalarizr in slave
When I reboot scalarizr in M2
And see 'Scalarizr terminated' in M2 log
Then scalarizr process is 2 in M2
And not ERROR in M2 scalarizr log
Scenario: Slave force termination
When I force terminate M2
Then Scalr sends HostDown to M1
And not ERROR in M1 scalarizr log
And redis is running on M1
And scalarizr process is 2 in M1
Then I expect server bootstrapping as M2
And not ERROR in M1 scalarizr log
And not ERROR in M2 scalarizr log
And redis is running on M1
@ec2
Scenario: Slave delete EBS
When I know M2 ebs storage
And M2 ebs status is in-use
Then I terminate server M2 with decrease
And M2 ebs status is deleting
And not ERROR in M1 scalarizr log
@ec2
Scenario: Setup replication for EBS test
When I increase minimum servers to 2 for redis role
Then I expect server bootstrapping as M2
And M2 is slave of M1
Scenario: Writing on Master, reading on Slave
When I create database 2 on M1
Then M2 contains database 2
Scenario: Slave -> Master promotion
Given I increase minimum servers to 3 for redis role
And I expect server bootstrapping as M3
When I create database 3 on M1
And I terminate server M1 with decrease
Then Scalr sends DbMsr_PromoteToMaster to N1
And Scalr receives DbMsr_PromoteToMasterResult from N1
And Scalr sends DbMsr_NewMasterUp to all
And M2 contains database 3
@restart_farm
Scenario: Restart farm
When I stop farm
And wait all servers are terminated
Then I start farm
And I expect server bootstrapping as M1
And scalarizr version is last in M1
And redis is running on M1
And M1 contains database 3
Then I expect server bootstrapping as M2
And M2 is slave of M1
And M2 contains database 3
"""
def test_feature_has_repr():
"Feature implements __repr__ nicely"
......@@ -442,3 +566,28 @@ def test_scenarios_with_extra_whitespace():
scenario = feature.scenarios[0]
assert_equals(type(scenario), Scenario)
assert_equals(scenario.name, "Extra whitespace scenario")
def test_scenarios_parsing():
feature = Feature.from_string(FEATURE15)
scenarios_and_tags = [(s.name, s.tags) for s in feature.scenarios]
scenarios_and_tags.should.equal([
('Bootstraping Redis role', []),
('Restart scalarizr', []),
('Rebundle server', [u'rebundle']),
('Use new role', [u'rebundle']),
('Restart scalarizr after bundling', [u'rebundle']),
('Bundling data', []),
('Modifying data', []),
('Reboot server', []),
('Backuping data on Master', []),
('Setup replication', []),
('Restart scalarizr in slave', []),
('Slave force termination', []),
('Slave delete EBS', [u'ec2']),
('Setup replication for EBS test', [u'ec2']),
('Writing on Master, reading on Slave', []),
('Slave -> Master promotion', []),
('Restart farm', [u'restart_farm']),
])
......@@ -22,7 +22,7 @@ from mox import Mox
def test_has_version():
"A nice python module is supposed to have a version"
assert_equals(lettuce.version, '0.2.6')
assert_equals(lettuce.version, '0.2.8')
def test_has_release():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment