include awxkit CI in zuul runs

additionally, fix up some flake8 failures
This commit is contained in:
Ryan Petrello
2019-08-08 22:26:39 -04:00
parent 9616cc6f78
commit adaa4148c6
8 changed files with 38 additions and 31 deletions

View File

@@ -376,6 +376,7 @@ test:
. $(VENV_BASE)/awx/bin/activate; \ . $(VENV_BASE)/awx/bin/activate; \
fi; \ fi; \
PYTHONDONTWRITEBYTECODE=1 py.test -p no:cacheprovider -n auto $(TEST_DIRS) PYTHONDONTWRITEBYTECODE=1 py.test -p no:cacheprovider -n auto $(TEST_DIRS)
cd awxkit && $(VENV_BASE)/awx/bin/tox -re py3
awx-manage check_migrations --dry-run --check -n 'vNNN_missing_migration_file' awx-manage check_migrations --dry-run --check -n 'vNNN_missing_migration_file'
test_unit: test_unit:

View File

@@ -375,14 +375,14 @@ class HasCreate(object):
to_teardown = all_instantiated_dependencies(self) to_teardown = all_instantiated_dependencies(self)
to_teardown_types = set(map(get_class_if_instance, to_teardown)) to_teardown_types = set(map(get_class_if_instance, to_teardown))
order = [ order = [
set( set(
[ [
potential for potential in ( potential for potential in (
get_class_if_instance(x) for x in group) if potential in to_teardown_types get_class_if_instance(x) for x in group) if potential in to_teardown_types
]
)
for group in page_creation_order(self, *to_teardown)
] ]
)
for group in page_creation_order(self, *to_teardown)
]
order.reverse() order.reverse()
for teardown_group in order: for teardown_group in order:
for teardown_class in teardown_group: for teardown_class in teardown_group:

View File

@@ -33,8 +33,8 @@ class UnifiedJob(HasStatus, base.Base):
def result_stdout(self): def result_stdout(self):
if 'result_stdout' not in self.json and 'stdout' in self.related: if 'result_stdout' not in self.json and 'stdout' in self.related:
return self.connection.get( return self.connection.get(
self.related.stdout, query_parameters=dict(format='txt_download') self.related.stdout, query_parameters=dict(format='txt_download')
).content.decode() ).content.decode()
if str(self.json.get('result_stdout')) == 'stdout capture is missing' and 'stdout' in self.related: if str(self.json.get('result_stdout')) == 'stdout capture is missing' and 'stdout' in self.related:
ping = self.walk(resources.ping) ping = self.walk(resources.ping)
if self.execution_node != ping.active_node: if self.execution_node != ping.active_node:
@@ -60,7 +60,7 @@ class UnifiedJob(HasStatus, base.Base):
pretty_stdout = pformat(stdout) pretty_stdout = pformat(stdout)
raise AssertionError( raise AssertionError(
'Expected "{}", but it was not found in stdout. Full stdout:\n {}'.format(expected_text, pretty_stdout) 'Expected "{}", but it was not found in stdout. Full stdout:\n {}'.format(expected_text, pretty_stdout)
) )
@property @property
def is_successful(self): def is_successful(self):

View File

@@ -29,8 +29,9 @@ class User(HasCreate, base.Base):
random_title()), random_title()),
email=kwargs.get( email=kwargs.get(
'email', 'email',
'{}@example.com'.format(random_title(5, non_ascii=False))) '{}@example.com'.format(random_title(5, non_ascii=False))
) )
)
return payload return payload
def create_payload(self, username='', password='', **kwargs): def create_payload(self, username='', password='', **kwargs):

View File

@@ -148,13 +148,16 @@ def format_human(output, fmt):
else: else:
output = [output] output = [output]
return tabulate([ return tabulate(
[
dict( dict(
(col, record.get(col, '')) (col, record.get(col, ''))
for col in column_names for col in column_names
) )
for record in output for record in output
], headers='keys', tablefmt='rst' ],
headers='keys',
tablefmt='rst'
) )

View File

@@ -51,20 +51,21 @@ class CleanCommand(Command):
version = '0.1.0' version = '0.1.0'
setup(name='awxkit', setup(
version=version, name='awxkit',
description='awx cli client', version=version,
packages=find_packages(exclude=['test']), description='awx cli client',
cmdclass={ packages=find_packages(exclude=['test']),
'clean': CleanCommand, cmdclass={
}, 'clean': CleanCommand,
include_package_data=True, },
install_requires=requirements, include_package_data=True,
python_requires=">= 3.5", install_requires=requirements,
entry_points={ python_requires=">= 3.5",
'console_scripts': [ entry_points={
'akit=awxkit.scripts.basic_session:load_interactive', 'console_scripts': [
'awx=awxkit.cli:run' 'akit=awxkit.scripts.basic_session:load_interactive',
] 'awx=awxkit.cli:run'
} ]
}
) )

View File

@@ -14,6 +14,7 @@ pytest-pythonpath
pytest-mock pytest-mock
pytest-timeout pytest-timeout
pytest-xdist<1.28.0 pytest-xdist<1.28.0
tox # for awxkit
logutils logutils
jupyter jupyter
matplotlib matplotlib

View File

@@ -18,4 +18,4 @@ exclude=.tox,venv,awx/lib/site-packages,awx/plugins/inventory/ec2.py,awx/plugins
[flake8] [flake8]
max-line-length=160 max-line-length=160
ignore=E201,E203,E221,E225,E231,E241,E251,E261,E265,E303,W291,W391,W293,E731,W504 ignore=E201,E203,E221,E225,E231,E241,E251,E261,E265,E303,W291,W391,W293,E731,W504
exclude=.tox,venv,awx/lib/site-packages,awx/plugins/inventory,awx/ui,awx/api/urls.py,awx/main/migrations,awx/main/tests/data,node_modules/,awx/projects/,tools/docker,awx/settings/local_*.py,installer/openshift/settings.py,build/,installer/ exclude=.tox,venv,awx/lib/site-packages,awx/plugins/inventory,awx/ui,awx/api/urls.py,awx/main/migrations,awx/main/tests/data,node_modules/,awx/projects/,tools/docker,awx/settings/local_*.py,installer/openshift/settings.py,build/,installer/,awxkit/test