summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Dent <chdent@redhat.com>2015-03-26 16:58:09 +0000
committerChris Dent <chdent@redhat.com>2015-03-30 11:51:06 +0000
commit823e1992b410f39a8d1a820509cb1d464e40a0ee (patch)
tree18af64daf3c4c4b0756661a7d4f9fe673ea88439
parent06c4740636fd0a42a60002ebfbcb9efa94566557 (diff)
downloadceilometer-823e1992b410f39a8d1a820509cb1d464e40a0ee.tar.gz
Stop using PYTHONHASHSEED=0 in ceilometer tests
Otherwise we have tests that rely on ordering (for example the one fixed in this patchset). Note that this moves the hash seed setting to only be used in docs and venv tox targets. For some reason there is an issue in the tooling used by the docs build that tickles a bug in those tools. Tools which are not part of Ceilometer. To avoid tickling the problem and to move ceilometer along on this bug, we're just going to mask that. The venv target is used by the jenkins job that builds docs. It runs the same build_sphinx setup.py target that the docs target does. Change-Id: If93ec7934ad59515b821f056ca534d3676ee7e03 Closes-Bug: #1348818
-rw-r--r--ceilometer/tests/api/v2/test_alarm_scenarios.py11
-rw-r--r--tox.ini3
2 files changed, 10 insertions, 4 deletions
diff --git a/ceilometer/tests/api/v2/test_alarm_scenarios.py b/ceilometer/tests/api/v2/test_alarm_scenarios.py
index f0341678..c895b154 100644
--- a/ceilometer/tests/api/v2/test_alarm_scenarios.py
+++ b/ceilometer/tests/api/v2/test_alarm_scenarios.py
@@ -914,9 +914,14 @@ class TestAlarms(v2.FunctionalTest,
status=400, headers=self.auth_headers)
alarms = list(self.alarm_conn.get_alarms())
self.assertEqual(7, len(alarms))
- self.assertEqual('threshold_rule and combination_rule cannot '
- 'be set at the same time',
- resp.json['error_message']['faultstring'])
+
+ # threshold_rule and combination_rule order is not
+ # predictable so it is not possible to do an exact match
+ # here
+ error_faultstring = resp.json['error_message']['faultstring']
+ for expected_string in ['threshold_rule', 'combination_rule',
+ 'cannot be set at the same time']:
+ self.assertIn(expected_string, error_faultstring)
def test_post_invalid_alarm_timestamp_in_threshold_rule(self):
date_time = datetime.datetime(2012, 7, 2, 10, 41)
diff --git a/tox.ini b/tox.ini
index 9db7fd57..53792685 100644
--- a/tox.ini
+++ b/tox.ini
@@ -10,7 +10,6 @@ install_command = pip install -U {opts} {packages}
usedevelop = True
setenv = VIRTUAL_ENV={envdir}
EVENTLET_NO_GREENDNS=yes
- PYTHONHASHSEED=0
commands =
bash -x {toxinidir}/setup-test-env-mongodb.sh python setup.py testr --slowest --testr-args="{posargs}"
downloadcache = {toxworkdir}/_download
@@ -72,12 +71,14 @@ commands =
[testenv:docs]
commands = python setup.py build_sphinx
+setenv = PYTHONHASHSEED=0
[testenv:pylint]
commands = bash tools/lintstack.sh
[testenv:venv]
commands = {posargs}
+setenv = PYTHONHASHSEED=0
[testenv:debug]
commands = bash -x {toxinidir}/setup-test-env-mongodb.sh oslo_debug_helper {posargs}