Esempio n. 1
0
    def setUpClass(cls):
        app, _ = create_app("e2e_test/test-settings.yml")
        with app.app_context():
            create_project_model(save=True)
            kubernetes_model = create_kubernetes_model(first=True, save=True)
            stop_worker(kubernetes_model.config_path)
            kubernetes_model = create_kubernetes_model(first=False, save=True)
            stop_worker(kubernetes_model.config_path)
            db.session.remove()
            db.drop_all()
            db.create_all()

            create_project_model(save=True)
            create_data_server_model(save=True)
            kubernetes_model = create_kubernetes_model(first=True, save=True)
            create_application_model(save=True)
            create_model_model(model_id=TEST_MODEL_ID1,
                               positive_model=True,
                               save=True)
            create_model_model(model_id=TEST_MODEL_ID2,
                               positive_model=False,
                               save=True)
            create_service_model(save=True)
            start_worker(kubernetes_model.config_path)
            warnings.filterwarnings("ignore",
                                    category=ResourceWarning,
                                    message="unclosed.*<ssl.SSLSocket.*>")
Esempio n. 2
0
 def tearDownClass(cls):
     app, _ = create_app("e2e_test/test-settings.yml")
     with app.app_context():
         create_project_model(save=True)
         kubernetes_model = create_kubernetes_model(first=True, save=True)
         stop_worker(kubernetes_model.config_path)
         kubernetes_model = create_kubernetes_model(first=False, save=True)
         stop_worker(kubernetes_model.config_path)
         db.session.remove()
         db.drop_all()
Esempio n. 3
0
def db_handler(args: dict):
    import sys
    from flask_script import Manager
    from flask_migrate import Migrate, MigrateCommand
    from rekcurd_dashboard.models import db

    tmp = sys.argv[1:]
    sys.argv = [sys.argv[0]]
    for i, t in enumerate(tmp):
        if t == 'db':
            sys.argv.append(t)
            sys.argv.append(tmp[i + 1])
            break
    app, _ = create_app(config_file=args["settings"],
                        logger_file=args["logger"],
                        **args)
    migrate = Migrate(app, db)
    manager = Manager(app)
    manager.add_command('db', MigrateCommand)
    manager.run()
Esempio n. 4
0
 def create_app(self):
     app, _ = create_app("test/test-settings.yml")
     return app
Esempio n. 5
0
def server_handler(args: dict):
    app, config = create_app(config_file=args["settings"],
                             logger_file=args["logger"],
                             **args)
    app.run(host=args["host"], port=config.SERVICE_PORT, threaded=True)
Esempio n. 6
0
 def create_app(self):
     app, _ = create_app("test/test-auth-settings.yml",
                         "test/dummy_logger.py")
     return app
Esempio n. 7
0
 def create_app(self):
     app, _ = create_app("test/test-auth-settings.yml",
                         "rekcurd_dashboard/test/dummy_invalid_logger.py")
     return app