feat: update default persistence to MongoDB and enhance configuration options
Chore App Build, Test, and Push Docker Images / build-and-push (push) Failing after 2m19s
Chore App Build, Test, and Push Docker Images / build-and-push (push) Failing after 2m19s
This commit is contained in:
+1
-1
@@ -25,7 +25,7 @@ except ImportError: # pragma: no cover - pymongo is a required dependency
|
||||
ASCENDING = 1
|
||||
|
||||
|
||||
USE_MONGODB = os.environ.get('USE_MONGODB', 'false').lower() == 'true'
|
||||
USE_MONGODB = os.environ.get('USE_MONGODB', 'true').lower() == 'true'
|
||||
# Resolve the MongoDB database name once at module load so runtime changes to
|
||||
# DB_ENV/DATA_ENV in tests do not switch databases mid-process.
|
||||
_mongo_db_name = get_mongo_db_name() if USE_MONGODB else None
|
||||
|
||||
@@ -184,7 +184,7 @@ def main():
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
if os.environ.get('USE_MONGODB', 'false').lower() != 'true':
|
||||
if os.environ.get('USE_MONGODB', 'true').lower() != 'true':
|
||||
print('Set USE_MONGODB=true to run the migration.', file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ from db.mongo_client import get_mongo_client, get_mongo_db_name
|
||||
|
||||
# All tests in this module require the mongomock-backed MongoDB adapter.
|
||||
pytestmark = pytest.mark.skipif(
|
||||
os.environ.get('USE_MONGODB', 'false').lower() != 'true',
|
||||
os.environ.get('USE_MONGODB', 'true').lower() != 'true',
|
||||
reason='MongoDB adapter tests require USE_MONGODB=true',
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user