tests: remove skip_archive_policies_creation

This is not a problem for gnocchi.gendoc anymore, we trying to create
existing archive policies. This also shows the default existing archive
policies in the doc.

Change-Id: I462fff88a060f88d0353a902996624ab2884ebed
This commit is contained in:
Julien Danjou 2016-05-13 10:14:50 +02:00
parent 955591a042
commit ee2eb67b99
3 changed files with 10 additions and 13 deletions

View File

@ -4,7 +4,7 @@
Content-Type: application/json
{
"name": "low",
"name": "short",
"back_window": 0,
"definition": [
{
@ -24,7 +24,7 @@
Content-Type: application/json
{
"name": "low-without-max",
"name": "short-without-max",
"aggregation_methods": ["-max", "-min"],
"back_window": 0,
"definition": [
@ -69,7 +69,7 @@
Content-Type: application/json
{
"name": "medium",
"name": "some-archive-policy",
"back_window": 0,
"definition": [
{
@ -92,7 +92,7 @@
Content-Type: application/json
{
"archive_policy_name": "low"
"archive_policy_name": "high"
}
- name: create-metric-2

View File

@ -31,7 +31,6 @@ _RUN = False
def _setup_test_app():
t = test_rest.RestTest()
t.skip_archive_policies_creation = True
t.auth = True
t.setUp()
return t.app

View File

@ -403,14 +403,12 @@ class TestCase(base.BaseTestCase):
self.archive_policies = self.ARCHIVE_POLICIES.copy()
self.archive_policies.update(archive_policy.DEFAULT_ARCHIVE_POLICIES)
# Used in gnocchi.gendoc
if not getattr(self, "skip_archive_policies_creation", False):
for name, ap in six.iteritems(self.archive_policies):
# Create basic archive policies
try:
self.index.create_archive_policy(ap)
except indexer.ArchivePolicyAlreadyExists:
pass
for name, ap in six.iteritems(self.archive_policies):
# Create basic archive policies
try:
self.index.create_archive_policy(ap)
except indexer.ArchivePolicyAlreadyExists:
pass
if swexc:
self.useFixture(mockpatch.Patch(