mirror of
https://github.com/ZwareBear/awx.git
synced 2026-03-20 07:43:35 -05:00
Added setting for production builds to be able to run tests using SQLite.
This commit is contained in:
@@ -22,13 +22,13 @@ DATABASES = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Continue to use SQLite for unit tests instead of PostgreSQL.
|
# Use SQLite for unit tests instead of PostgreSQL.
|
||||||
if 'test' in sys.argv:
|
if len(sys.argv) >= 2 and sys.argv[1] == 'test':
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
'default': {
|
||||||
'ENGINE': 'django.db.backends.sqlite3',
|
'ENGINE': 'django.db.backends.sqlite3',
|
||||||
'NAME': os.path.join(BASE_DIR, 'awx.sqlite3'),
|
'NAME': os.path.join(BASE_DIR, 'awx.sqlite3'),
|
||||||
# Test database cannot be :memory: for celery/inventory tests to work.
|
# Test database cannot be :memory: for celery/inventory tests.
|
||||||
'TEST_NAME': os.path.join(BASE_DIR, 'awx_test.sqlite3'),
|
'TEST_NAME': os.path.join(BASE_DIR, 'awx_test.sqlite3'),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,17 @@ DATABASES = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Use SQLite for unit tests instead of PostgreSQL.
|
||||||
|
if len(sys.argv) >= 2 and sys.argv[1] == 'test':
|
||||||
|
DATABASES = {
|
||||||
|
'default': {
|
||||||
|
'ENGINE': 'django.db.backends.sqlite3',
|
||||||
|
'NAME': 'var/lib/awx/awx.sqlite3',
|
||||||
|
# Test database cannot be :memory: for celery/inventory tests.
|
||||||
|
'TEST_NAME': '/var/lib/awx/awx_test.sqlite3',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
STATIC_ROOT = '/var/lib/awx/public/static'
|
STATIC_ROOT = '/var/lib/awx/public/static'
|
||||||
|
|
||||||
PROJECTS_ROOT = '/var/lib/awx/projects'
|
PROJECTS_ROOT = '/var/lib/awx/projects'
|
||||||
|
|||||||
@@ -13,6 +13,17 @@ DATABASES = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Use SQLite for unit tests instead of PostgreSQL.
|
||||||
|
if len(sys.argv) >= 2 and sys.argv[1] == 'test':
|
||||||
|
DATABASES = {
|
||||||
|
'default': {
|
||||||
|
'ENGINE': 'django.db.backends.sqlite3',
|
||||||
|
'NAME': 'var/lib/awx/awx.sqlite3',
|
||||||
|
# Test database cannot be :memory: for celery/inventory tests.
|
||||||
|
'TEST_NAME': '/var/lib/awx/awx_test.sqlite3',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
STATIC_ROOT = '/var/lib/awx/public/static'
|
STATIC_ROOT = '/var/lib/awx/public/static'
|
||||||
|
|
||||||
PROJECTS_ROOT = '/var/lib/awx/projects'
|
PROJECTS_ROOT = '/var/lib/awx/projects'
|
||||||
|
|||||||
Reference in New Issue
Block a user