From ee2eb67b99b9b3a45d39a3641a0591151461a0f9 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 13 May 2016 10:14:50 +0200 Subject: [PATCH] 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 --- doc/source/rest.yaml | 8 ++++---- gnocchi/gendoc.py | 1 - gnocchi/tests/base.py | 14 ++++++-------- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/doc/source/rest.yaml b/doc/source/rest.yaml index 98793a858..9db1d8bab 100644 --- a/doc/source/rest.yaml +++ b/doc/source/rest.yaml @@ -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 diff --git a/gnocchi/gendoc.py b/gnocchi/gendoc.py index 880806547..63a4e9b13 100644 --- a/gnocchi/gendoc.py +++ b/gnocchi/gendoc.py @@ -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 diff --git a/gnocchi/tests/base.py b/gnocchi/tests/base.py index 472afeb0c..283e18d38 100644 --- a/gnocchi/tests/base.py +++ b/gnocchi/tests/base.py @@ -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(