2014-11-13 17:51:37 +00:00
|
|
|
import os
|
|
|
|
|
2014-05-29 17:57:57 +00:00
|
|
|
from datetime import datetime, timedelta
|
2015-01-30 21:32:37 +00:00
|
|
|
from tempfile import NamedTemporaryFile
|
2014-05-29 17:57:57 +00:00
|
|
|
|
2014-04-07 20:59:22 +00:00
|
|
|
from config import DefaultConfig
|
|
|
|
|
|
|
|
|
|
|
|
class FakeTransaction(object):
|
|
|
|
def __enter__(self):
|
|
|
|
return self
|
|
|
|
|
|
|
|
def __exit__(self, exc_type, value, traceback):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2015-01-30 21:32:37 +00:00
|
|
|
TEST_DB_FILE = NamedTemporaryFile(delete=True)
|
|
|
|
|
|
|
|
|
2014-04-07 20:59:22 +00:00
|
|
|
class TestConfig(DefaultConfig):
|
|
|
|
TESTING = True
|
2015-01-05 17:31:02 +00:00
|
|
|
SECRET_KEY = 'a36c9d7d-25a9-4d3f-a586-3d2f8dc40a83'
|
2015-09-15 18:33:35 +00:00
|
|
|
BILLING_TYPE = 'FakeStripe'
|
2014-04-07 20:59:22 +00:00
|
|
|
|
2015-09-08 16:35:03 +00:00
|
|
|
TEST_DB_FILE = TEST_DB_FILE
|
2015-01-30 21:32:37 +00:00
|
|
|
DB_URI = os.environ.get('TEST_DATABASE_URI', 'sqlite:///{0}'.format(TEST_DB_FILE.name))
|
2014-11-13 17:51:37 +00:00
|
|
|
DB_CONNECTION_ARGS = {
|
|
|
|
'threadlocals': True,
|
2016-02-24 21:01:27 +00:00
|
|
|
'autorollback': True,
|
2014-11-13 17:51:37 +00:00
|
|
|
}
|
2014-04-07 20:59:22 +00:00
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def create_transaction(db):
|
|
|
|
return FakeTransaction()
|
|
|
|
|
|
|
|
DB_TRANSACTION_FACTORY = create_transaction
|
|
|
|
|
2014-11-13 18:20:21 +00:00
|
|
|
DISTRIBUTED_STORAGE_CONFIG = {'local_us': ['FakeStorage', {}], 'local_eu': ['FakeStorage', {}]}
|
2014-06-17 20:03:43 +00:00
|
|
|
DISTRIBUTED_STORAGE_PREFERENCE = ['local_us']
|
2014-04-07 20:59:22 +00:00
|
|
|
|
2014-05-09 22:45:11 +00:00
|
|
|
BUILDLOGS_MODULE_AND_CLASS = ('test.testlogs', 'testlogs.TestBuildLogs')
|
2014-07-08 22:19:13 +00:00
|
|
|
BUILDLOGS_OPTIONS = ['devtable', 'building', 'deadbeef-dead-beef-dead-beefdeadbeef', False]
|
2014-04-07 20:59:22 +00:00
|
|
|
|
2014-09-09 19:54:03 +00:00
|
|
|
USERFILES_LOCATION = 'local_us'
|
2014-05-12 18:45:19 +00:00
|
|
|
|
|
|
|
FEATURE_SUPER_USERS = True
|
2014-05-30 19:48:20 +00:00
|
|
|
FEATURE_BILLING = True
|
2014-09-22 23:11:48 +00:00
|
|
|
FEATURE_MAILING = True
|
2014-05-12 18:45:19 +00:00
|
|
|
SUPER_USERS = ['devtable']
|
2014-05-28 18:06:21 +00:00
|
|
|
|
|
|
|
LICENSE_USER_LIMIT = 500
|
2014-05-29 17:57:57 +00:00
|
|
|
LICENSE_EXPIRATION = datetime.now() + timedelta(weeks=520)
|
|
|
|
LICENSE_EXPIRATION_WARNING = datetime.now() + timedelta(weeks=520)
|
2014-11-24 21:07:38 +00:00
|
|
|
|
2014-05-30 22:28:18 +00:00
|
|
|
FEATURE_GITHUB_BUILD = True
|
2016-01-20 21:33:10 +00:00
|
|
|
FEATURE_BITTORRENT = True
|
2016-05-13 22:29:57 +00:00
|
|
|
FEATURE_ACI_CONVERSION = True
|
2015-08-17 20:26:20 +00:00
|
|
|
|
|
|
|
CLOUDWATCH_NAMESPACE = None
|
2015-10-23 19:20:28 +00:00
|
|
|
|
|
|
|
FEATURE_SECURITY_SCANNER = True
|
2016-03-01 21:14:56 +00:00
|
|
|
FEATURE_SECURITY_NOTIFICATIONS = True
|
2016-12-14 22:11:45 +00:00
|
|
|
SECURITY_SCANNER_ENDPOINT = 'http://fakesecurityscanner/'
|
2016-05-02 19:29:31 +00:00
|
|
|
SECURITY_SCANNER_API_VERSION = 'v1'
|
|
|
|
SECURITY_SCANNER_ENGINE_VERSION_TARGET = 1
|
|
|
|
SECURITY_SCANNER_API_TIMEOUT_SECONDS = 1
|
2017-04-05 18:01:55 +00:00
|
|
|
|
2017-04-05 17:27:31 +00:00
|
|
|
FEATURE_SIGNING = True
|
2017-07-12 19:48:35 +00:00
|
|
|
|
2016-05-13 22:29:57 +00:00
|
|
|
SIGNING_ENGINE = 'gpg2'
|
|
|
|
|
|
|
|
GPG2_PRIVATE_KEY_NAME = 'EEB32221'
|
2016-05-23 21:10:03 +00:00
|
|
|
GPG2_PRIVATE_KEY_FILENAME = 'test/data/signing-private.gpg'
|
|
|
|
GPG2_PUBLIC_KEY_FILENAME = 'test/data/signing-public.gpg'
|
2016-05-13 22:29:57 +00:00
|
|
|
|
2016-05-31 20:48:19 +00:00
|
|
|
INSTANCE_SERVICE_KEY_KID_LOCATION = 'test/data/test.kid'
|
|
|
|
INSTANCE_SERVICE_KEY_LOCATION = 'test/data/test.pem'
|
2016-07-14 19:48:21 +00:00
|
|
|
|
|
|
|
PROMETHEUS_AGGREGATOR_URL = None
|
2016-12-08 23:35:42 +00:00
|
|
|
|
2017-01-20 20:21:08 +00:00
|
|
|
GITHUB_LOGIN_CONFIG = {}
|
|
|
|
GOOGLE_LOGIN_CONFIG = {}
|
|
|
|
|
2016-12-08 23:35:42 +00:00
|
|
|
FEATURE_GITHUB_LOGIN = True
|
|
|
|
FEATURE_GOOGLE_LOGIN = True
|
|
|
|
|
2017-01-23 22:53:34 +00:00
|
|
|
TESTOIDC_LOGIN_CONFIG = {
|
|
|
|
'CLIENT_ID': 'foo',
|
|
|
|
'CLIENT_SECRET': 'bar',
|
|
|
|
'OIDC_SERVER': 'http://fakeoidc',
|
|
|
|
'DEBUGGING': True,
|
2017-02-09 20:52:33 +00:00
|
|
|
'LOGIN_BINDING_FIELD': 'sub',
|
2016-12-08 23:35:42 +00:00
|
|
|
}
|
2016-12-17 07:13:36 +00:00
|
|
|
|
|
|
|
RECAPTCHA_SITE_KEY = 'somekey'
|
|
|
|
RECAPTCHA_SECRET_KEY = 'somesecretkey'
|
2017-03-23 16:01:59 +00:00
|
|
|
|
|
|
|
FEATURE_APP_REGISTRY = True
|
2017-02-23 18:26:47 +00:00
|
|
|
FEATURE_TEAM_SYNCING = True
|
2017-04-05 18:01:55 +00:00
|
|
|
FEATURE_CHANGE_TAG_EXPIRATION = True
|
|
|
|
|
|
|
|
TAG_EXPIRATION_OPTIONS = ['0s', '1s', '1d', '1w', '2w', '4w']
|
|
|
|
|
2018-02-20 18:58:14 +00:00
|
|
|
DEFAULT_NAMESPACE_MAXIMUM_BUILD_COUNT = None
|
2017-12-19 22:13:37 +00:00
|
|
|
|
|
|
|
DATA_MODEL_CACHE_CONFIG = {
|
|
|
|
'engine': 'inmemory',
|
|
|
|
}
|