diff --git a/openwisp-qa-check b/openwisp-qa-check index 7ca185a2..27552749 100755 --- a/openwisp-qa-check +++ b/openwisp-qa-check @@ -162,7 +162,7 @@ runcheckpendingmigrations() { if [ ! -f "./tests/manage.py" ]; then echo "File manage.py not found, skipping Make Migration Check." else - OUTPUT=$(python tests/manage.py makemigrations --dry-run $MODULE) + OUTPUT=$(OWQA_USE_IN_MEMORY_DB=1 python tests/manage.py makemigrations --dry-run $MODULE) echo $OUTPUT | grep "No changes detected" &>/dev/null && echo "SUCCESS: Migrations check successful!" || { diff --git a/tests/openwisp2/settings.py b/tests/openwisp2/settings.py index 27038e9c..ace22cae 100644 --- a/tests/openwisp2/settings.py +++ b/tests/openwisp2/settings.py @@ -13,6 +13,14 @@ "NAME": "openwisp_utils.db", } } + +# Force in-memory DB for QA migration checks +if os.environ.get("OWQA_USE_IN_MEMORY_DB"): + DATABASES["default"] = { + "ENGINE": "django.db.backends.sqlite3", + "NAME": ":memory:", + } + if TESTING and "--exclude-tag=selenium_tests" not in sys.argv: DATABASES["default"]["TEST"] = { "NAME": os.path.join(BASE_DIR, "openwisp_utils_tests.db"),