Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions mod_ci/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2437,7 +2437,7 @@ def progress_type_request(log, test, test_id, request) -> bool:
results = g.db.query(count(TestResultFile.got)).filter(
and_(
TestResultFile.test_id == test.id,
TestResultFile.regression_test_id.in_(results_zero_rc),
TestResultFile.regression_test_id.in_(results_zero_rc.select()),
TestResultFile.got.isnot(None)
)
).scalar()
Expand Down Expand Up @@ -2513,13 +2513,13 @@ def update_final_status():
finished_tests = g.db.query(TestProgress.test_id).filter(
and_(
TestProgress.status.in_([TestStatus.canceled, TestStatus.completed]),
TestProgress.test_id.in_(platform_tests)
TestProgress.test_id.in_(platform_tests.select())
)
).subquery()
in_progress_statuses = [TestStatus.preparation, TestStatus.completed, TestStatus.canceled]
finished_tests_progress = g.db.query(TestProgress).filter(
and_(
TestProgress.test_id.in_(finished_tests),
TestProgress.test_id.in_(finished_tests.select()),
TestProgress.status.in_(in_progress_statuses)
)
).subquery()
Expand Down
2 changes: 1 addition & 1 deletion mod_customized/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def index():
g.log.error('GitHub token not configured, cannot fetch commits')

populated_categories = g.db.query(regressionTestLinkTable.c.category_id).subquery()
categories = Category.query.filter(Category.id.in_(populated_categories)).order_by(Category.name.asc()).all()
categories = Category.query.filter(Category.id.in_(populated_categories.select())).order_by(Category.name.asc()).all()

tests = Test.query.filter(and_(TestFork.user_id == g.user.id, TestFork.test_id == Test.id)).order_by(
Test.id.desc()).limit(50).all()
Expand Down
8 changes: 4 additions & 4 deletions mod_sample/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ def display_sample_info(sample) -> Dict[str, Any]:
sq = g.db.query(RegressionTest.id).filter(RegressionTest.sample_id == sample.id).subquery()
exit_code = g.db.query(TestResult.exit_code).filter(and_(
TestResult.exit_code != TestResult.expected_rc,
and_(TestResult.test_id == test_commit.id, TestResult.regression_test_id.in_(sq))
and_(TestResult.test_id == test_commit.id, TestResult.regression_test_id.in_(sq.select()))
)).first()
not_null = g.db.query(TestResultFile.got).filter(and_(
TestResultFile.got.isnot(None),
and_(TestResultFile.test_id == test_commit.id, TestResultFile.regression_test_id.in_(sq))
and_(TestResultFile.test_id == test_commit.id, TestResultFile.regression_test_id.in_(sq.select()))
)).first()

if exit_code is None and not_null is None:
Expand All @@ -87,12 +87,12 @@ def display_sample_info(sample) -> Dict[str, Any]:
exit_code = g.db.query(TestResult.exit_code).filter(
and_(
TestResult.exit_code != TestResult.expected_rc,
and_(TestResult.test_id == test_release.id, TestResult.regression_test_id.in_(sq))
and_(TestResult.test_id == test_release.id, TestResult.regression_test_id.in_(sq.select()))
)
).first()
not_null = g.db.query(TestResultFile.got).filter(and_(
TestResultFile.got.isnot(None),
and_(TestResultFile.test_id == test_release.id, TestResultFile.regression_test_id.in_(sq))
and_(TestResultFile.test_id == test_release.id, TestResultFile.regression_test_id.in_(sq.select()))
)).first()

if exit_code is None and not_null is None:
Expand Down
2 changes: 1 addition & 1 deletion mod_test/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def get_test_results(test) -> List[Dict[str, Any]]:
:type test: Test
"""
populated_categories = g.db.query(regressionTestLinkTable.c.category_id).subquery()
categories = Category.query.filter(Category.id.in_(populated_categories)).order_by(Category.name.asc()).all()
categories = Category.query.filter(Category.id.in_(populated_categories.select())).order_by(Category.name.asc()).all()
results = [{
'category': category,
'tests': [{
Expand Down