class Parameter(Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String) # TODO: Constrain type = db.Column(db.String) data = db.Column(JSONB) parameter_group_id = db.Column(db.Integer, db.ForeignKey('parameter_group.id'))
class Step(Model): id = db.Column(db.Integer, primary_key=True) test_case_id = db.Column(db.Integer, db.ForeignKey('test_case.id')) execution_id = db.Column(db.Integer, db.ForeignKey('execution.id')) order = db.Column(db.Integer) execution_runs = db.relationship("ExecutionRun", backref="step")
class Execution(Model): id = db.Column(db.Integer, primary_key=True) description = db.Column(db.String) # TODO: Constrain type = db.Column(db.String) strategy = db.Column(db.String) data = db.Column(JSONB) steps = db.relationship("Step", backref="execution")
class TestSuite(Model): id = db.Column(db.Integer, primary_key=True) short_name = db.Column(db.String) name = db.Column(db.String) description = db.Column(db.String) parameter_group_id = db.Column(db.Integer, db.ForeignKey('parameter_group.id')) test_cases = db.relationship("TestCase", secondary=test_cases, backref=db.backref('test_cases', lazy='dynamic')) test_suite_runs = db.relationship("TestSuiteRun", backref='test_suite', lazy='dynamic')
class TestRun(Model): id = db.Column(db.Integer, primary_key=True) test_case_id = db.Column(db.ForeignKey("test_case.id")) message = db.Column(db.String) start_time = db.Column(db.DateTime) end_time = db.Column(db.DateTime) task_id = db.Column(db.String) # TODO: Constrain status = db.Column(db.String) runtime_data = db.Column(JSONB) parameter_id = db.Column(db.Integer, db.ForeignKey('parameter.id')) execution_runs = relationship("ExecutionRun", backref='TestRun')
class TestSuiteRun(Model): id = db.Column(db.Integer, primary_key=True) test_suite_id = db.Column(db.ForeignKey("test_suite.id")) message = db.Column(db.String) start_time = db.Column(db.DateTime) end_time = db.Column(db.DateTime) task_id = db.Column(db.String) # TODO: Constrain status = db.Column(db.String) runtime_data = db.Column(JSONB) parameter_id = db.Column(db.Integer, db.ForeignKey('parameter.id')) test_case_runs = db.relationship("TestRun", secondary=test_case_runs, backref=db.backref('test_runs', lazy='dynamic'))
class ExecutionRun(Model): id = db.Column(db.Integer, primary_key=True) test_run_id = db.Column( db.Integer, db.ForeignKey('test_run.id')) # , primary_key=True) step_id = db.Column(db.Integer, db.ForeignKey('step.id')) # , primary_key=True) message = db.Column(db.String) context = db.Column(db.String) status = db.Column(db.String)
class TestCase(Model): id = db.Column(db.Integer, primary_key=True) short_name = db.Column(db.String) name = db.Column(db.String) description = db.Column(db.String) expected_success = db.Column(db.Boolean, default=True) parameter_group_id = db.Column(db.Integer, db.ForeignKey('parameter_group.id')) test_suite_id = db.Column(db.Integer, db.ForeignKey('test_suite.id')) test_runs = db.relationship("TestRun", backref='test_case', lazy='dynamic') steps = db.relationship("Step", backref='test_cases', lazy='dynamic')
from sqlalchemy.dialects.postgresql import JSONB from taas.database import Model, db test_case_runs = db.Table( 'test_suite_case_runs', db.Column('test_case_run_id', db.Integer, db.ForeignKey('test_run.id')), db.Column('test_suite_run_id', db.Integer, db.ForeignKey('test_suite_run.id'))) class TestSuiteRun(Model): id = db.Column(db.Integer, primary_key=True) test_suite_id = db.Column(db.ForeignKey("test_suite.id")) message = db.Column(db.String) start_time = db.Column(db.DateTime) end_time = db.Column(db.DateTime) task_id = db.Column(db.String) # TODO: Constrain status = db.Column(db.String) runtime_data = db.Column(JSONB) parameter_id = db.Column(db.Integer, db.ForeignKey('parameter.id')) test_case_runs = db.relationship("TestRun", secondary=test_case_runs, backref=db.backref('test_runs', lazy='dynamic'))
class ParameterGroup(Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String) parameters = relationship("Parameter", backref='ParameterGroup')