From 2f1d667e64d6364fdfa239a795d35cf563772459 Mon Sep 17 00:00:00 2001 From: Luke Sneeringer Date: Wed, 18 Jun 2014 10:51:24 -0500 Subject: [PATCH] Don't run the large inventory timing test locally. This commit turns off local execution of the timing test for a large inventory. This test is pointless on local development, where (1) memory varies widely and (2) we're using an entirely different database (SQLite) for testing. Pulling it out makes local testing considerably quicker and avoids specious failures. --- awx/main/tests/commands.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/awx/main/tests/commands.py b/awx/main/tests/commands.py index c79637371e..d1e8bd27fe 100644 --- a/awx/main/tests/commands.py +++ b/awx/main/tests/commands.py @@ -11,6 +11,7 @@ import sys import tempfile import time import urlparse +import unittest # Django from django.conf import settings @@ -872,6 +873,9 @@ class InventoryImportTest(BaseCommandMixin, BaseLiveServerTest): self.assertEqual(new_inv.total_groups, ngroups) self.assertElapsedLessThan(30) + @unittest.skipIf(getattr(settings, 'LOCAL_DEVELOPMENT', False), + 'Skip this test in local development environments, ' + 'which may vary widely on memory.') def test_large_inventory_file(self): new_inv = self.organizations[0].inventories.create(name='largeinv') self.assertEqual(new_inv.hosts.count(), 0)