Fixing imports and no longer always running int tests

The horizon.utils.urlresolvers module no longer
exists, so we need to use django.core.urlresolvers.
The integration tests were always being run when
run_tests.sh was invoked.  That is not desirable.  This
patch addresses that by only running them when the
appropriate flags are passed.  Additionally, the
nose-exclude package is added to test-requriements.txt
to allow the exclusion of the integration test directories.  These 2 fixes are presented together
because tests would not pass individually, with each
patch failing on the other problem.

Change-Id: I5d3ccc8c8969992073f122f63df2c430f690a06c
Closes-Bug: #1538265
Closes-Bug: #1538159
This commit is contained in:
Chad Roberts 2016-01-26 14:10:12 -05:00
parent 91a5be83df
commit 9e32872fb3
9 changed files with 10 additions and 7 deletions

View File

@ -348,6 +348,9 @@ function run_tests_all {
${command_wrapper} python -m coverage.__main__ erase
coverage_run="python -m coverage.__main__ run -p"
fi
if [ $with_selenium -eq 0 -a $integration -eq 0 ]; then
testopts="$testopts --exclude-dir=sahara_dashboard/test/integration_tests"
fi
${command_wrapper} ${coverage_run} $root/manage.py test sahara_dashboard --settings=sahara_dashboard.test.settings $testopts
# get results of the Horizon tests
SAHARA_DASHBOARD_RESULT=$?

View File

@ -11,6 +11,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from django.core.urlresolvers import reverse
from django.core.urlresolvers import reverse_lazy
from django.utils.translation import ugettext_lazy as _
@ -19,7 +20,6 @@ from horizon import forms
from horizon import tables
from horizon import tabs
from horizon.utils import memoized
from horizon.utils.urlresolvers import reverse # noqa
from horizon import workflows
from sahara_dashboard.api import sahara as saharaclient

View File

@ -15,6 +15,7 @@ from datetime import datetime
import json
import logging
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.utils.translation import ugettext as _
from django.views.generic import base as django_base
@ -24,7 +25,6 @@ from horizon import exceptions
from horizon import tables
from horizon import tabs
from horizon.utils import memoized
from horizon.utils.urlresolvers import reverse # noqa
from horizon import workflows
from sahara_dashboard.api import sahara as saharaclient

View File

@ -11,13 +11,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import tables
from horizon import tabs
from horizon.utils import memoized
from horizon.utils.urlresolvers import reverse # noqa
from horizon import workflows
from sahara_dashboard.api import sahara as saharaclient

View File

@ -22,7 +22,6 @@ from horizon import forms
from horizon import tables
from horizon import tabs
from horizon.utils import memoized
from horizon.utils.urlresolvers import reverse # noqa
from sahara_dashboard.api import sahara as saharaclient

View File

@ -11,13 +11,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import tables
from horizon import tabs
from horizon.utils import memoized
from horizon.utils.urlresolvers import reverse # noqa
from sahara_dashboard.api import sahara as saharaclient

View File

@ -13,6 +13,7 @@
import json
from django.core.urlresolvers import reverse
from django import http
from django.utils.translation import ugettext_lazy as _
@ -20,7 +21,6 @@ from horizon import exceptions
from horizon import tables
from horizon import tabs
from horizon.utils import memoized
from horizon.utils.urlresolvers import reverse # noqa
from horizon import workflows
from sahara_dashboard.api import sahara as saharaclient

View File

@ -11,13 +11,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import tables
from horizon import tabs
from horizon.utils import memoized
from horizon.utils.urlresolvers import reverse # noqa
from horizon import workflows
from sahara_dashboard.api import sahara as saharaclient

View File

@ -12,6 +12,7 @@ discover # BSD
mock>=1.2 # BSD
mox3>=0.7.0 # Apache-2.0
netifaces>=0.10.4 # MIT
nose-exclude # LGPL
python-subunit>=0.0.18 # Apache-2.0/BSD
selenium # Apache-2.0
sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2 # BSD