Example #1
0
#!/usr/bin/env python
import os
import subprocess

from pulp.devel.test_runner import run_tests

# Find and eradicate any existing .pyc files, so they do not eradicate us!
PROJECT_DIR = os.path.dirname(__file__)
subprocess.call(['find', PROJECT_DIR, '-name', '*.pyc', '-delete'])

PACKAGES = [os.path.dirname(__file__), 'pulp_puppet']

TESTS = [
    'pulp_puppet_common/test/unit/',
    'pulp_puppet_extensions_admin/test/unit/',
    'pulp_puppet_extensions_consumer/test/unit/',
    'pulp_puppet_handlers/test/unit/',
]

PLUGIN_TESTS = ['pulp_puppet_plugins/test/unit/']

dir_safe_all_platforms = [os.path.join(os.path.dirname(__file__), x) for x in TESTS]
dir_safe_non_rhel5 = [os.path.join(os.path.dirname(__file__), x) for x in PLUGIN_TESTS]

os.environ['DJANGO_SETTINGS_MODULE'] = 'pulp_puppet.forge.settings'

run_tests(PACKAGES, dir_safe_all_platforms, dir_safe_non_rhel5)
Example #2
0
PROJECT_DIR = os.path.dirname(__file__)
subprocess.call(['find', PROJECT_DIR, '-name', '*.pyc', '-delete'])

PACKAGES = [
    PROJECT_DIR,
    'pulp_rpm',
    'rpm_repo',
    'rpm_sync',
    'rpm_units_copy',
    'rpm_units_search',
    'rpm_upload',
    'yum_distributor',
    'yum_importer'
]

TESTS = [
    'common/test/unit',
    'handlers/test/unit',
    'extensions_consumer/test/unit/',
]
PLUGIN_TESTS = [
    'plugins/test/unit',
    'extensions_admin/test/unit/',
    'devel/test/unit'
]

dir_safe_all_platforms = [os.path.join(os.path.dirname(__file__), x) for x in TESTS]
dir_safe_non_rhel5 = [os.path.join(os.path.dirname(__file__), x) for x in PLUGIN_TESTS]

run_tests(PACKAGES, dir_safe_all_platforms, dir_safe_non_rhel5, flake8_paths=[PROJECT_DIR])
Example #3
0
if exit_code != 0:
    sys.exit(exit_code)

# Check the code for PEP-257 compliance
# We should remove some of these over time
pep257_fail_ignore_codes = 'D100,D103,D200,D202,D203,D205,D400,D401,D402'

print "checking pep257 for failures, ignoring %s" % pep257_fail_ignore_codes
exit_code = subprocess.call(['pep257', '--ignore=' + pep257_fail_ignore_codes])

if exit_code != 0:
    sys.exit(exit_code)

# Ensure that all doc strings are present
doc_check.recursive_check(PROJECT_DIR)

PACKAGES = [PROJECT_DIR, 'pulp_python', ]

TESTS = [
    'common/test/unit/',
    'extensions_admin/test/unit/',
]

PLUGIN_TESTS = ['plugins/test/unit/']

dir_safe_all_platforms = [os.path.join(os.path.dirname(__file__), x) for x in TESTS]
dir_safe_non_rhel5 = [os.path.join(os.path.dirname(__file__), x) for x in PLUGIN_TESTS]

sys.exit(run_tests(PACKAGES, dir_safe_all_platforms, dir_safe_non_rhel5))
Example #4
0
    os.path.dirname(__file__),
    'pulp',
    'pulp_node',
]


TESTS_ALL_PLATFORMS = [
    'agent/test/unit',
    'bindings/test/unit',
    'client_consumer/test/unit',
    'client_lib/test/unit',
    'common/test/unit'
]

TESTS_NON_RHEL5 = [
    'client_admin/test/unit',
    'nodes/test/nodes_tests',
    'server/test/unit',
    'repoauth/test',
    'oid_validation/test',
    'devel/test/unit'
]

dir_safe_all_platforms = [os.path.join(os.path.dirname(__file__), x) for x in TESTS_ALL_PLATFORMS]
dir_safe_non_rhel5 = [os.path.join(os.path.dirname(__file__), x) for x in TESTS_NON_RHEL5]

tests_exit_code = run_tests(PACKAGES, dir_safe_all_platforms, dir_safe_non_rhel5,
                            flake8_paths=paths_to_check, flake8_exclude=paths_to_ignore)

sys.exit(tests_exit_code)
Example #5
0
flake8_exit_code = subprocess.call(command)

PACKAGES = [
    os.path.dirname(__file__),
    'pulp',
    'pulp_node',
]


TESTS_ALL_PLATFORMS = [
    'agent/test/unit',
    'bindings/test/unit',
    'client_consumer/test/unit',
    'client_lib/test/unit',
    'common/test/unit'
]

TESTS_NON_RHEL5 = [
    'client_admin/test/unit',
    'nodes/test/unit',
    'server/test/unit',
    'devel/test/unit'
]

dir_safe_all_platforms = [os.path.join(os.path.dirname(__file__), x) for x in TESTS_ALL_PLATFORMS]
dir_safe_non_rhel5 = [os.path.join(os.path.dirname(__file__), x) for x in TESTS_NON_RHEL5]

tests_exit_code = run_tests(PACKAGES, dir_safe_all_platforms, dir_safe_non_rhel5)

sys.exit(flake8_exit_code or tests_exit_code)
Example #6
0
command.extend(paths_to_check)
flake8_exit_code = subprocess.call(command)

PACKAGES = [
    os.path.dirname(__file__),
    'pulp',
    'pulp_node',
]

TESTS_ALL_PLATFORMS = [
    'agent/test/unit', 'bindings/test/unit', 'client_consumer/test/unit',
    'client_lib/test/unit', 'common/test/unit'
]

TESTS_NON_RHEL5 = [
    'client_admin/test/unit', 'nodes/test/unit', 'server/test/unit',
    'devel/test/unit'
]

dir_safe_all_platforms = [
    os.path.join(os.path.dirname(__file__), x) for x in TESTS_ALL_PLATFORMS
]
dir_safe_non_rhel5 = [
    os.path.join(os.path.dirname(__file__), x) for x in TESTS_NON_RHEL5
]

tests_exit_code = run_tests(PACKAGES, dir_safe_all_platforms,
                            dir_safe_non_rhel5)

sys.exit(flake8_exit_code or tests_exit_code)