This repository has been archived by the owner on Feb 18, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:mozilla/ouija
- Loading branch information
Showing
9 changed files
with
212 additions
and
167 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from sqlalchemy import create_engine | ||
from sqlalchemy.orm import sessionmaker | ||
from sqlalchemy.ext.declarative import declarative_base | ||
|
||
|
||
engine = create_engine('mysql+mysqldb://root:root@localhost/ouija2', echo=True) | ||
Session = sessionmaker(engine) | ||
|
||
session = Session() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
"""This file define all the model we will need in seta""" | ||
import logging | ||
from sqlalchemy import Column, Integer, String, DateTime, Text | ||
from sqlalchemy.schema import MetaData | ||
from sqlalchemy.ext.declarative import declarative_base | ||
from config import engine | ||
|
||
|
||
logger = logging.getLogger(__name__) | ||
Metadata = MetaData(bind=engine) | ||
MetaBase = declarative_base(metadata=Metadata) | ||
|
||
|
||
class Dailyjobs(MetaBase): | ||
__tablename__ = 'dailyjobs' | ||
|
||
id = Column(Integer, primary_key=True) | ||
date = Column(DateTime, nullable=False, index=True) | ||
platform = Column(String(32), nullable=False) | ||
branch = Column(String(64), nullable=False) | ||
numpushes = Column(Integer, nullable=False) | ||
numjobs = Column(Integer, nullable=False) | ||
sumduration = Column(Integer, nullable=False) | ||
|
||
def __init__(self, date, platform, branch, numpushes, | ||
numjobs, sumduration): | ||
self.date = date | ||
self.platform = platform | ||
self.branch = branch | ||
self.numpushes = numpushes | ||
self.numjobs = numjobs | ||
self.sumduration = sumduration | ||
|
||
|
||
class Testjobs(MetaBase): | ||
__tablename__ = 'testjobs' | ||
|
||
id = Column(Integer, primary_key=True) | ||
slave = Column(String(64), nullable=False) | ||
result = Column(String(64), nullable=False) | ||
build_system_type = Column(String(64), nullable=False) | ||
duration = Column(Integer, nullable=False) | ||
platform = Column(String(32), nullable=False) | ||
buildtype = Column(String(32), nullable=False) | ||
testtype = Column(String(64), nullable=False) | ||
bugid = Column(Text, nullable=False) | ||
branch = Column(String(64), nullable=False) | ||
revision = Column(String(32), nullable=False, index=True) | ||
date = Column(DateTime, nullable=False, index=True) | ||
failure_classification = Column(Integer, nullable=False) | ||
failures = Column(String(256), nullable=False) | ||
|
||
def __init__(self, slave, result, build_system_type, | ||
duration, platform, buildtype, | ||
testtype, bugid, branch, revision, date, | ||
failure_classification, failures): | ||
self.slave = slave | ||
self.result = result | ||
self.build_system_type = build_system_type | ||
self.duration = duration | ||
self.platform = platform | ||
self.buildtype = buildtype | ||
self.testtype = testtype | ||
self.bugid = bugid | ||
self.branch = branch | ||
self.revision = revision | ||
self.date = date | ||
self.failure_classification = failure_classification | ||
self.failures = failures | ||
|
||
|
||
class Seta(MetaBase): | ||
__tablename__ = 'seta' | ||
|
||
id = Column(Integer, primary_key=True) | ||
jobtype = Column(String(256), nullable=False) | ||
date = Column(DateTime, nullable=False, index=True) | ||
|
||
def __init__(self, jobtype, date): | ||
self.jobtype = jobtype | ||
self.date = date | ||
|
||
|
||
if __name__ == "__main__": | ||
# create all table and column, so we must call this before | ||
# all things begin. | ||
Metadata.create_all(bind=engine, checkfirst=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
Flask==0.10.1 | ||
MarkupSafe==0.23 | ||
MySQL-python==1.2.5 | ||
Flask-SQLAlchemy==2.1 | ||
argparse==1.2.1 | ||
requests==2.9.1 | ||
redo>=1.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.