+import contextlib
import datetime
import os
+import sys
import unittest
+
import flask_migrate
import flask_testing
class UsesModels(UsesApp):
def setUp(self):
- flask_migrate.upgrade(revision="head")
+ with open(os.devnull, "w") as f, contextlib.redirect_stderr(f):
+ flask_migrate.upgrade(revision="head")
def tearDown(self):
- flask_migrate.downgrade(revision="base")
+ with open(os.devnull, "w") as f, contextlib.redirect_stderr(f):
+ flask_migrate.downgrade(revision="base")
class TestModels(UsesModels):
assert build.build_runner.runner_name == "phenom-test"
assert build.build_version == "lineage-15.1"
assert build.build_device == "FAKE_TEST"
- print(build.build_status)
assert build.build_status == "success"
assert build.build_duration == 81
import os
SQLALCHEMY_DATABASE_URI = os.environ.get("SQLALCHEMY_DATABASE_URI", 'sqlite:////tmp/ui.db')
+SQLALCHEMY_TRACK_MODIFICATIONS = False
CACHE_TYPE = 'simple'
GITLAB_WEBHOOK_TOKEN = os.environ.get("GITLAB_WEBHOOK_TOKEN", "secret")
if stage.get('name') == 'build':
build_stage = stage
runner = build_stage.get("runner")
- print(type(runner))
if runner:
build.build_runner = Runner.get_or_create_by_id(runner.get('id'))
if not build.build_runner.runner_name: