From 21059123d49f15aeba66ec3bc0b5bfc3460ac979 Mon Sep 17 00:00:00 2001 From: David Lenwell Date: Mon, 4 Nov 2013 14:32:23 +0800 Subject: [PATCH] random changes --- .../59e15d864941_added_subunit_output.py | 26 +++++++++++++++++++ refstack/cli/refstack | 7 ++--- refstack/common/tester.py | 4 +-- refstack/models.py | 1 + 4 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 alembic/versions/59e15d864941_added_subunit_output.py diff --git a/alembic/versions/59e15d864941_added_subunit_output.py b/alembic/versions/59e15d864941_added_subunit_output.py new file mode 100644 index 00000000..f393f454 --- /dev/null +++ b/alembic/versions/59e15d864941_added_subunit_output.py @@ -0,0 +1,26 @@ +"""added subunit output field + +Revision ID: 59e15d864941 +Revises: 4f6f77184d45 +Create Date: 2013-11-02 04:41:58.431516 + +""" + +# revision identifiers, used by Alembic. +revision = '59e15d864941' +down_revision = '4f6f77184d45' + +from alembic import op +import sqlalchemy as sa + + +def upgrade(): + ### commands auto generated by Alembic - please adjust! ### + op.add_column('test_results', sa.Column('subunit', sa.String(length=8192), nullable=True)) + ### end Alembic commands ### + + +def downgrade(): + ### commands auto generated by Alembic - please adjust! ### + op.drop_column('test_results', 'subunit') + ### end Alembic commands ### diff --git a/refstack/cli/refstack b/refstack/cli/refstack index 58b7da45..eac390bb 100755 --- a/refstack/cli/refstack +++ b/refstack/cli/refstack @@ -126,16 +126,17 @@ def start(args): db.commit() print 'test added with id: %s' % test.id - + + ''' # do cleanup and then mark the last status to 'canceled' test_result = TestResults() test_result.test_id = test.id - test_result.blob = result + test_result.subunit = result db.add(test_result) db.commit() - + ''' def status(args): """get the status of a running test diff --git a/refstack/common/tester.py b/refstack/common/tester.py index 2808bc16..2c3fd9e6 100755 --- a/refstack/common/tester.py +++ b/refstack/common/tester.py @@ -180,7 +180,7 @@ class Tester(object): # get the config print "writing configs %s" % path - self.config = self.tempest_config.build_config_from_keystone() + self._config = self.tempest_config.build_config_from_keystone() runtests_script = """#!/bin/bash cd %s @@ -203,7 +203,7 @@ group_regex=([^\.]*\.)*""" os.chmod(path+"runtests.sh", 0744) with open(path+"tempest.conf", "w") as config_file: - config_file.write(self.config) + config_file.write(self._config) with open(path+".testr.conf", "w") as testr_config_file: testr_config_file.write(testr_output) diff --git a/refstack/models.py b/refstack/models.py index d0eff77f..47f2a13f 100755 --- a/refstack/models.py +++ b/refstack/models.py @@ -138,6 +138,7 @@ class TestResults(Base): test = relationship('Test', backref=backref('results',lazy='dynamic')) timestamp = Column(DateTime, default=datetime.now) + subunit = Column(String(8192)) blob = Column(Binary)