mirror of
https://github.com/ZwareBear/awx.git
synced 2026-03-20 07:43:35 -05:00
fixing ad_hoc imports
flake8 fixes Fix and add awx/api/tests added fact tests added proper xml reports for jenkins added jenkins requirements and adjusted Makefile target
This commit is contained in:
@@ -25,3 +25,5 @@ exclude_lines =
|
|||||||
|
|
||||||
ignore_errors = True
|
ignore_errors = True
|
||||||
|
|
||||||
|
[xml]
|
||||||
|
output = ./reports/coverage.xml
|
||||||
|
|||||||
12
Makefile
12
Makefile
@@ -155,7 +155,7 @@ endif
|
|||||||
.PHONY: clean rebase push requirements requirements_dev requirements_jenkins \
|
.PHONY: clean rebase push requirements requirements_dev requirements_jenkins \
|
||||||
real-requirements real-requirements_dev real-requirements_jenkins \
|
real-requirements real-requirements_dev real-requirements_jenkins \
|
||||||
develop refresh adduser syncdb migrate dbchange dbshell runserver celeryd \
|
develop refresh adduser syncdb migrate dbchange dbshell runserver celeryd \
|
||||||
receiver test test_coverage coverage_html test_jenkins dev_build \
|
receiver test test_unit test_coverage coverage_html test_jenkins dev_build \
|
||||||
release_build release_clean sdist rpmtar mock-rpm mock-srpm rpm-sign \
|
release_build release_clean sdist rpmtar mock-rpm mock-srpm rpm-sign \
|
||||||
build-ui sync-ui test-ui build-ui-for-coverage test-ui-for-coverage \
|
build-ui sync-ui test-ui build-ui-for-coverage test-ui-for-coverage \
|
||||||
build-ui-for-browser-tests test-ui-debug jshint ngdocs \
|
build-ui-for-browser-tests test-ui-debug jshint ngdocs \
|
||||||
@@ -360,14 +360,14 @@ check: flake8 pep8 # pyflakes pylint
|
|||||||
|
|
||||||
# Run all API unit tests.
|
# Run all API unit tests.
|
||||||
test:
|
test:
|
||||||
$(PYTHON) -m py.test awx/main/tests
|
py.test awx/main/tests awx/api/tests awx/fact/tests
|
||||||
|
|
||||||
test_unit:
|
test_unit:
|
||||||
$(PYTHON) -m py.test awx/main/tests/unit
|
py.test awx/main/tests/unit
|
||||||
|
|
||||||
# Run all API unit tests with coverage enabled.
|
# Run all API unit tests with coverage enabled.
|
||||||
test_coverage:
|
test_coverage:
|
||||||
$(PYTHON) -m py.test --cov=awx awx/main/tests
|
py.test --cov=awx --cov-report=xml --junitxml=./reports/junit.xml awx/main/tests awx/api/tests awx/fact/tests
|
||||||
|
|
||||||
# Output test coverage as HTML (into htmlcov directory).
|
# Output test coverage as HTML (into htmlcov directory).
|
||||||
coverage_html:
|
coverage_html:
|
||||||
@@ -378,8 +378,8 @@ test_tox:
|
|||||||
tox -v
|
tox -v
|
||||||
|
|
||||||
# Run unit tests to produce output for Jenkins.
|
# Run unit tests to produce output for Jenkins.
|
||||||
test_jenkins:
|
# Alias existing make target so old versions run against Jekins the same way
|
||||||
$(PYTHON) manage.py jenkins -v2 --enable-coverage --project-apps-tests
|
test_jenkins : test_coverage
|
||||||
|
|
||||||
# UI TASKS
|
# UI TASKS
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ from django.conf import settings
|
|||||||
from django.test import LiveServerTestCase
|
from django.test import LiveServerTestCase
|
||||||
from django.test.utils import override_settings
|
from django.test.utils import override_settings
|
||||||
|
|
||||||
from awx.main.tests.jobs import BaseJobTestMixin
|
from awx.main.tests.job_base import BaseJobTestMixin
|
||||||
|
|
||||||
|
|
||||||
@override_settings(CELERY_ALWAYS_EAGER=True,
|
@override_settings(CELERY_ALWAYS_EAGER=True,
|
||||||
|
|||||||
@@ -470,3 +470,4 @@ class Credential(PasswordFieldsModel, CommonModelNameNotUnique):
|
|||||||
if 'cloud' not in update_fields:
|
if 'cloud' not in update_fields:
|
||||||
update_fields.append('cloud')
|
update_fields.append('cloud')
|
||||||
super(Credential, self).save(*args, **kwargs)
|
super(Credential, self).save(*args, **kwargs)
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,11 @@ from crum import impersonate
|
|||||||
from awx.main.utils import * # noqa
|
from awx.main.utils import * # noqa
|
||||||
from awx.main.models import * # noqa
|
from awx.main.models import * # noqa
|
||||||
from awx.main.tests.base import BaseJobExecutionTest
|
from awx.main.tests.base import BaseJobExecutionTest
|
||||||
from tasks import TEST_SSH_KEY_DATA, TEST_SSH_KEY_DATA_LOCKED, TEST_SSH_KEY_DATA_UNLOCK
|
from awx.main.tests.data.ssh import (
|
||||||
|
TEST_SSH_KEY_DATA,
|
||||||
|
TEST_SSH_KEY_DATA_LOCKED,
|
||||||
|
TEST_SSH_KEY_DATA_UNLOCK,
|
||||||
|
)
|
||||||
|
|
||||||
__all__ = ['RunAdHocCommandTest', 'AdHocCommandApiTest']
|
__all__ = ['RunAdHocCommandTest', 'AdHocCommandApiTest']
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ from django.core.urlresolvers import reverse
|
|||||||
|
|
||||||
# AWX
|
# AWX
|
||||||
from awx.main.models import * # noqa
|
from awx.main.models import * # noqa
|
||||||
from job_base import BaseJobTestMixin
|
from awx.main.tests.job_base import BaseJobTestMixin
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
__all__ = ['JobTemplateLaunchTest', 'JobTemplateLaunchPasswordsTest']
|
__all__ = ['JobTemplateLaunchTest', 'JobTemplateLaunchPasswordsTest']
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ from django.core.urlresolvers import reverse
|
|||||||
# AWX
|
# AWX
|
||||||
from awx.main.models import * # noqa
|
from awx.main.models import * # noqa
|
||||||
from awx.main.tests.base import BaseLiveServerTest
|
from awx.main.tests.base import BaseLiveServerTest
|
||||||
from job_base import BaseJobTestMixin
|
from awx.main.tests.job_base import BaseJobTestMixin
|
||||||
|
|
||||||
__all__ = ['JobRelaunchTest',]
|
__all__ = ['JobRelaunchTest',]
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import requests
|
|||||||
|
|
||||||
# AWX
|
# AWX
|
||||||
from awx.main.models import * # noqa
|
from awx.main.models import * # noqa
|
||||||
from job_base import BaseJobTestMixin
|
from awx.main.tests.job_base import BaseJobTestMixin
|
||||||
|
|
||||||
__all__ = ['JobTemplateTest', 'JobTest', 'JobTemplateCallbackTest', 'JobTransactionTest', 'JobTemplateSurveyTest']
|
__all__ = ['JobTemplateTest', 'JobTest', 'JobTemplateCallbackTest', 'JobTransactionTest', 'JobTemplateSurveyTest']
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ from django.conf import settings
|
|||||||
# AWX
|
# AWX
|
||||||
from awx.main.models import * # noqa
|
from awx.main.models import * # noqa
|
||||||
from awx.main.tests.base import BaseLiveServerTest
|
from awx.main.tests.base import BaseLiveServerTest
|
||||||
from job_base import BaseJobTestMixin
|
from awx.main.tests.job_base import BaseJobTestMixin
|
||||||
|
|
||||||
__all__ = ['JobStartCancelTest',]
|
__all__ = ['JobStartCancelTest',]
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import tempfile
|
|||||||
from rest_framework.exceptions import ParseError, PermissionDenied
|
from rest_framework.exceptions import ParseError, PermissionDenied
|
||||||
from django.utils.encoding import smart_str
|
from django.utils.encoding import smart_str
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from django.core.exceptions import ValidationError
|
|
||||||
|
|
||||||
# PyCrypto
|
# PyCrypto
|
||||||
from Crypto.Cipher import AES
|
from Crypto.Cipher import AES
|
||||||
|
|||||||
@@ -9,3 +9,7 @@ pylint
|
|||||||
flake8
|
flake8
|
||||||
distribute==0.7.3
|
distribute==0.7.3
|
||||||
unittest2
|
unittest2
|
||||||
|
pytest
|
||||||
|
pytest-cov
|
||||||
|
pytest-django
|
||||||
|
pytest-pythonpath
|
||||||
|
|||||||
@@ -12,10 +12,7 @@ RUN echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-or
|
|||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get install -y openssh-server ansible mg vim tmux git mercurial subversion python-dev python-psycopg2 make postgresql-client libpq-dev nodejs python-psutil libxml2-dev libxslt-dev lib32z1-dev libsasl2-dev libldap2-dev libffi-dev libzmq-dev proot python-pip libxmlsec1-dev swig redis-server && rm -rf /var/lib/apt/lists/*
|
RUN apt-get install -y openssh-server ansible mg vim tmux git mercurial subversion python-dev python-psycopg2 make postgresql-client libpq-dev nodejs python-psutil libxml2-dev libxslt-dev lib32z1-dev libsasl2-dev libldap2-dev libffi-dev libzmq-dev proot python-pip libxmlsec1-dev swig redis-server && rm -rf /var/lib/apt/lists/*
|
||||||
RUN pip install flake8
|
RUN pip install flake8
|
||||||
RUN pip install pytest
|
RUN pip install pytest pytest-pythonpath pytest-django pytest-cov
|
||||||
RUN pip install pytest-pythonpath
|
|
||||||
RUN pip install pytest-django
|
|
||||||
RUN pip install pytest-cov
|
|
||||||
RUN /usr/bin/ssh-keygen -q -t rsa -N "" -f /root/.ssh/id_rsa
|
RUN /usr/bin/ssh-keygen -q -t rsa -N "" -f /root/.ssh/id_rsa
|
||||||
RUN mkdir -p /etc/tower
|
RUN mkdir -p /etc/tower
|
||||||
RUN mkdir -p /data/db
|
RUN mkdir -p /data/db
|
||||||
|
|||||||
Reference in New Issue
Block a user