-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdatabase.py
More file actions
138 lines (72 loc) · 4.27 KB
/
database.py
File metadata and controls
138 lines (72 loc) · 4.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#! /usr/bin/env python3
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from sqlalchemy import Table
from lib.database_conn import Session, Base, pool
class Projects(Base):
__table__ = Table('projects', Base.metadata, autoload_with=pool)
class TestAutomationStatus(Base):
__table__ = Table('test_automation_status', Base.metadata, autoload_with=pool)
class TestAutomationCoverage(Base):
__table__ = Table('test_automation_coverage', Base.metadata, autoload_with=pool)
class TestSuites(Base):
__table__ = Table('test_suites', Base.metadata, autoload_with=pool)
class TestSubSuites(Base):
__table__ = Table('test_sub_suites', Base.metadata, autoload_with=pool)
class ReportTestCaseCoverage(Base):
__table__ = Table('report_test_case_coverage', Base.metadata, autoload_with=pool) # noqa
class ReportTestRailTestHealth(Base):
__table__ = Table("report_testrail_test_health", Base.metadata, autoload_with=pool)
# class ReportTestRunCounts(Base):
# __table__ = Table('report_test_run_counts', Base.metadata, autoload_with=pool)
class ReportTestRailTestPlans(Base):
__table__ = Table('report_testrail_test_plans', Base.metadata, autoload_with=pool) # noqa
class ReportTestRailTestRuns(Base):
__table__ = Table('report_testrail_test_runs', Base.metadata, autoload_with=pool) # noqa
class ReportGithubIssues(Base):
__table__ = Table('report_github_issues', Base.metadata, autoload_with=pool)
class ReportJiraQARequests(Base):
__table__ = Table('report_jira_qa_requests', Base.metadata, autoload_with=pool) # noqa
class ReportJIraQARequestsNewIssueType(Base):
__table__ = Table('report_jira_qa_requests_new_issue_types', Base.metadata, autoload_with=pool) # noqa
class ReportJiraQARequestsDesktop(Base):
__table__ = Table('report_jira_qa_requests_desktop', Base.metadata, autoload_with=pool) # noqa
class ReportJiraQANeeded(Base):
__table__ = Table('report_jira_qa_needed', Base.metadata, autoload_with=pool) # noqa
class ReportBugzillaQENeeded(Base):
__table__ = Table('report_bugzilla_qe_needed', Base.metadata, autoload_with=pool) # noqa
class ReportBugzillaQEVerifyCount(Base):
__table__ = Table('report_bugzilla_qe_needed_count', Base.metadata, autoload_with=pool) # noqa
class ReportTestRailMilestones(Base):
__table__ = Table('report_testrail_milestones', Base.metadata, autoload_with=pool) # noqa
class ReportTestRailUsers(Base):
__table__ = Table('report_testrail_users', Base.metadata, autoload_with=pool) # noqa
class ReportJiraSoftvisionWorklogs(Base):
__table__ = Table('report_jira_softvision_worklogs', Base.metadata, autoload_with=pool) # noqa
class ReportBitriseBuildsCount(Base):
__table__ = Table('report_bitrise_builds_count', Base.metadata, autoload_with=pool) # noqa
class ReportSentryIssues(Base):
__table__ = Table('report_sentry_issues', Base.metadata, autoload_with=pool) # noqa
class ReportSentryRates(Base):
__table__ = Table('report_sentry_rates', Base.metadata, autoload_with=pool) # noqa
class ReportBugzillaSoftvisionBugs(Base):
__table__ = Table('report_bugzilla_softvision_bugs', Base.metadata, autoload_with=pool) # noqa
class ReportBugzillaReleaseFlagsBugs(Base):
__table__ = Table('report_bugzilla_query_release_flags_for_bugs', Base.metadata, autoload_with=pool) # noqa
class ReportTestRailTestResults(Base):
__table__ = Table('report_testrail_test_results', Base.metadata, autoload_with=pool) # noqa
class ReportBugzillaMetaBugs(Base):
__table__ = Table('report_bugzilla_meta_bugs', Base.metadata, autoload_with=pool) # noqa
class ReportBugzillaQueryByKeyword(Base):
__table__ = Table('report_bugzilla_query_by_keyword', Base.metadata, autoload_with=pool) # noqa
class ReportBugzillaOverallBugs(Base):
__table__ = Table('report_bugzilla_overall_bugs', Base.metadata, autoload_with=pool) # noqa
class ReportGithubBugs(Base):
__table__ = Table('report_github_bugs', Base.metadata, autoload_with=pool) # noqa
class Database:
def __init__(self):
self.session = Session()
def clean_table(self, table):
self.session.query(table).delete()
self.session.commit()