mirror of
https://github.com/ansible/awx.git
synced 2026-05-10 02:47:36 -02:30
Skip test_fact.py migrations if MONGO_DB is not confingured
This commit is contained in:
@@ -2,6 +2,7 @@ import pytest
|
|||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
from django.apps import apps
|
from django.apps import apps
|
||||||
|
from django.conf import settings
|
||||||
|
|
||||||
from awx.main.models.inventory import Host
|
from awx.main.models.inventory import Host
|
||||||
from awx.main.models.fact import Fact
|
from awx.main.models.fact import Fact
|
||||||
@@ -14,6 +15,7 @@ from awx.fact.models.fact import FactVersion, FactHost
|
|||||||
def micro_to_milli(micro):
|
def micro_to_milli(micro):
|
||||||
return micro - (((int)(micro / 1000)) * 1000)
|
return micro - (((int)(micro / 1000)) * 1000)
|
||||||
|
|
||||||
|
@pytest.mark.skipif(not getattr(settings, 'MONGO_DB', None), reason="MongoDB not configured")
|
||||||
@pytest.mark.django_db
|
@pytest.mark.django_db
|
||||||
@pytest.mark.mongo_db
|
@pytest.mark.mongo_db
|
||||||
def test_migrate_facts(inventories, hosts, hosts_mongo, fact_scans):
|
def test_migrate_facts(inventories, hosts, hosts_mongo, fact_scans):
|
||||||
@@ -36,6 +38,7 @@ def test_migrate_facts(inventories, hosts, hosts_mongo, fact_scans):
|
|||||||
assert len(fact) == 1
|
assert len(fact) == 1
|
||||||
assert fact[0] is not None
|
assert fact[0] is not None
|
||||||
|
|
||||||
|
@pytest.mark.skipif(not getattr(settings, 'MONGO_DB', None), reason="MongoDB not configured")
|
||||||
@pytest.mark.django_db
|
@pytest.mark.django_db
|
||||||
@pytest.mark.mongo_db
|
@pytest.mark.mongo_db
|
||||||
def test_migrate_facts_hostname_does_not_exist(inventories, hosts, hosts_mongo, fact_scans):
|
def test_migrate_facts_hostname_does_not_exist(inventories, hosts, hosts_mongo, fact_scans):
|
||||||
@@ -61,6 +64,7 @@ def test_migrate_facts_hostname_does_not_exist(inventories, hosts, hosts_mongo,
|
|||||||
assert len(fact) == 1
|
assert len(fact) == 1
|
||||||
assert fact[0] is not None
|
assert fact[0] is not None
|
||||||
|
|
||||||
|
@pytest.mark.skipif(not getattr(settings, 'MONGO_DB', None), reason="MongoDB not configured")
|
||||||
@pytest.mark.django_db
|
@pytest.mark.django_db
|
||||||
@pytest.mark.mongo_db
|
@pytest.mark.mongo_db
|
||||||
def test_drop_system_tracking_db(inventories, hosts, hosts_mongo, fact_scans):
|
def test_drop_system_tracking_db(inventories, hosts, hosts_mongo, fact_scans):
|
||||||
|
|||||||
Reference in New Issue
Block a user