random changes

This commit is contained in:
David Lenwell 2013-11-04 14:32:23 +08:00
parent eb6680c759
commit 21059123d4
4 changed files with 33 additions and 5 deletions

View File

@ -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 ###

View File

@ -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

View File

@ -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)

View File

@ -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)