mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 15:09:32 -02:30
Skip old slow tests for normal unit test runs, pick them up in nightly runs
This commit is contained in:
@@ -58,6 +58,7 @@ class BaseAdHocCommandTest(BaseJobExecutionTest):
|
||||
return self.credential
|
||||
|
||||
|
||||
@unittest.skipIf(os.environ.get('SKIP_SLOW_TESTS', False), 'Skipping slow test')
|
||||
class RunAdHocCommandTest(BaseAdHocCommandTest):
|
||||
'''
|
||||
Test cases for RunAdHocCommand celery task.
|
||||
@@ -375,6 +376,7 @@ class RunAdHocCommandTest(BaseAdHocCommandTest):
|
||||
def run_pexpect_mock(self, *args, **kwargs):
|
||||
return 'successful', 0
|
||||
|
||||
@unittest.skipIf(os.environ.get('SKIP_SLOW_TESTS', False), 'Skipping slow test')
|
||||
class AdHocCommandApiTest(BaseAdHocCommandTest):
|
||||
'''
|
||||
Test API list/detail views for ad hoc commands.
|
||||
|
||||
@@ -108,6 +108,7 @@ grandchild
|
||||
parent
|
||||
'''
|
||||
|
||||
|
||||
class BaseCommandMixin(object):
|
||||
'''
|
||||
Base class for tests that run management commands.
|
||||
@@ -381,6 +382,7 @@ class CleanupJobsTest(BaseCommandMixin, BaseLiveServerTest):
|
||||
self.assertFalse(ad_hoc_commands_after)
|
||||
|
||||
|
||||
@unittest.skipIf(os.environ.get('SKIP_SLOW_TESTS', False), 'Skipping slow test')
|
||||
class CleanupActivityStreamTest(BaseCommandMixin, BaseTest):
|
||||
'''
|
||||
Test cases for cleanup_activitystream management command.
|
||||
@@ -447,6 +449,7 @@ class CleanupActivityStreamTest(BaseCommandMixin, BaseTest):
|
||||
'create took %0.3fs, cleanup took %0.3fs, expected < %0.3fs' % (create_elapsed, cleanup_elapsed, create_elapsed / 4))
|
||||
|
||||
|
||||
@unittest.skipIf(os.environ.get('SKIP_SLOW_TESTS', False), 'Skipping slow test')
|
||||
class InventoryImportTest(BaseCommandMixin, BaseLiveServerTest):
|
||||
'''
|
||||
Test cases for inventory_import management command.
|
||||
|
||||
@@ -8,6 +8,8 @@ import os
|
||||
import re
|
||||
import tempfile
|
||||
import time
|
||||
import unittest2 as unittest
|
||||
|
||||
|
||||
# Django
|
||||
from django.conf import settings
|
||||
@@ -37,6 +39,7 @@ inventory['group-\u037c\u03b4\u0138\u0137\u03cd\u03a1\u0121\u0137\u0138\u01a1'].
|
||||
print json.dumps(inventory)
|
||||
"""
|
||||
|
||||
@unittest.skipIf(os.environ.get('SKIP_SLOW_TESTS', False), 'Skipping slow test')
|
||||
class InventoryTest(BaseTest):
|
||||
|
||||
def setUp(self):
|
||||
@@ -1097,6 +1100,7 @@ class InventoryTest(BaseTest):
|
||||
self.assertEqual(response['hosts']['failed'], 8)
|
||||
|
||||
|
||||
@unittest.skipIf(os.environ.get('SKIP_SLOW_TESTS', False), 'Skipping slow test')
|
||||
@override_settings(CELERY_ALWAYS_EAGER=True,
|
||||
CELERY_EAGER_PROPAGATES_EXCEPTIONS=True,
|
||||
IGNORE_CELERY_INSPECTOR=True,
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
# Python
|
||||
from __future__ import absolute_import
|
||||
import os
|
||||
import unittest2 as unittest
|
||||
|
||||
# Django
|
||||
import django
|
||||
@@ -15,6 +17,7 @@ import yaml
|
||||
|
||||
__all__ = ['JobTemplateLaunchTest', 'JobTemplateLaunchPasswordsTest']
|
||||
|
||||
@unittest.skipIf(os.environ.get('SKIP_SLOW_TESTS', False), 'Skipping slow test')
|
||||
class JobTemplateLaunchTest(BaseJobTestMixin, django.test.TransactionTestCase):
|
||||
def setUp(self):
|
||||
super(JobTemplateLaunchTest, self).setUp()
|
||||
@@ -183,6 +186,7 @@ class JobTemplateLaunchTest(BaseJobTestMixin, django.test.TransactionTestCase):
|
||||
with self.current_user(self.user_sue):
|
||||
self.post(self.launch_url, {}, expect=400)
|
||||
|
||||
@unittest.skipIf(os.environ.get('SKIP_SLOW_TESTS', False), 'Skipping slow test')
|
||||
class JobTemplateLaunchPasswordsTest(BaseJobTestMixin, django.test.TransactionTestCase):
|
||||
def setUp(self):
|
||||
super(JobTemplateLaunchPasswordsTest, self).setUp()
|
||||
|
||||
@@ -9,6 +9,9 @@ import struct
|
||||
import threading
|
||||
import time
|
||||
import urlparse
|
||||
import os
|
||||
import unittest2 as unittest
|
||||
|
||||
|
||||
# Django
|
||||
import django.test
|
||||
@@ -183,6 +186,7 @@ TEST_SURVEY_REQUIREMENTS = '''
|
||||
}
|
||||
'''
|
||||
|
||||
@unittest.skipIf(os.environ.get('SKIP_SLOW_TESTS', False), 'Skipping slow test')
|
||||
class JobTemplateTest(BaseJobTestMixin, django.test.TransactionTestCase):
|
||||
|
||||
JOB_TEMPLATE_FIELDS = ('id', 'type', 'url', 'related', 'summary_fields',
|
||||
@@ -501,6 +505,7 @@ class JobTemplateTest(BaseJobTestMixin, django.test.TransactionTestCase):
|
||||
with self.current_user(self.user_doug):
|
||||
self.get(detail_url, expect=403)
|
||||
|
||||
@unittest.skipIf(os.environ.get('SKIP_SLOW_TESTS', False), 'Skipping slow test')
|
||||
class JobTest(BaseJobTestMixin, django.test.TransactionTestCase):
|
||||
|
||||
def test_get_job_list(self):
|
||||
@@ -653,6 +658,7 @@ class JobTest(BaseJobTestMixin, django.test.TransactionTestCase):
|
||||
# and that jobs come back nicely serialized with related resources and so on ...
|
||||
# that we can drill all the way down and can get at host failure lists, etc ...
|
||||
|
||||
@unittest.skipIf(os.environ.get('SKIP_SLOW_TESTS', False), 'Skipping slow test')
|
||||
@override_settings(CELERY_ALWAYS_EAGER=True,
|
||||
CELERY_EAGER_PROPAGATES_EXCEPTIONS=True,
|
||||
ANSIBLE_TRANSPORT='local')
|
||||
@@ -1028,6 +1034,7 @@ class JobTemplateCallbackTest(BaseJobTestMixin, django.test.LiveServerTestCase):
|
||||
self.post(url, data, expect=400, remote_addr=host_ip)
|
||||
|
||||
|
||||
@unittest.skipIf(os.environ.get('SKIP_SLOW_TESTS', False), 'Skipping slow test')
|
||||
@override_settings(CELERY_ALWAYS_EAGER=True,
|
||||
CELERY_EAGER_PROPAGATES_EXCEPTIONS=True,
|
||||
ANSIBLE_TRANSPORT='local')
|
||||
@@ -1092,6 +1099,7 @@ class JobTransactionTest(BaseJobTestMixin, django.test.LiveServerTestCase):
|
||||
self.assertEqual(job.status, 'successful', job.result_stdout)
|
||||
self.assertFalse(errors)
|
||||
|
||||
@unittest.skipIf(os.environ.get('SKIP_SLOW_TESTS', False), 'Skipping slow test')
|
||||
class JobTemplateSurveyTest(BaseJobTestMixin, django.test.TransactionTestCase):
|
||||
def setUp(self):
|
||||
super(JobTemplateSurveyTest, self).setUp()
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
# Python
|
||||
from __future__ import absolute_import
|
||||
import os
|
||||
import unittest2 as unittest
|
||||
|
||||
# Django
|
||||
from django.core.urlresolvers import reverse
|
||||
@@ -15,6 +17,7 @@ from awx.main.tests.job_base import BaseJobTestMixin
|
||||
|
||||
__all__ = ['JobStartCancelTest',]
|
||||
|
||||
@unittest.skipIf(os.environ.get('SKIP_SLOW_TESTS', False), 'Skipping slow test')
|
||||
class JobStartCancelTest(BaseJobTestMixin, BaseLiveServerTest):
|
||||
|
||||
def test_job_start(self):
|
||||
|
||||
@@ -237,6 +237,7 @@ TEST_VAULT_PLAYBOOK = '''$ANSIBLE_VAULT;1.1;AES256
|
||||
|
||||
TEST_VAULT_PASSWORD = '1234'
|
||||
|
||||
@unittest.skipIf(os.environ.get('SKIP_SLOW_TESTS', False), 'Skipping slow test')
|
||||
class RunJobTest(BaseJobExecutionTest):
|
||||
'''
|
||||
Test cases for RunJob celery task.
|
||||
@@ -337,10 +338,9 @@ class RunJobTest(BaseJobExecutionTest):
|
||||
print
|
||||
qs = self.super_django_user.get_queryset(JobEvent)
|
||||
for je in qs.filter(job=job):
|
||||
print je.get_event_display2()
|
||||
print je.event, je, je.failed
|
||||
print je.event_data
|
||||
print
|
||||
print(je.get_event_display2())
|
||||
print(je.event, je, je.failed)
|
||||
print(je.event_data)
|
||||
for job_event in job_events:
|
||||
unicode(job_event) # For test coverage.
|
||||
job_event.save()
|
||||
|
||||
Reference in New Issue
Block a user