Пример #1
0
    def list_benchmark_scenarios():
        """Lists all the existing methods in the benchmark scenario classes.

        Returns the method names in format <Class name>.<Method name>, which
        is used in the test config.

        :returns: List of strings
        """
        utils.import_modules_from_package("rally.benchmark.scenarios")
        benchmark_scenarios = [
            ["%s.%s" % (scenario.__name__, method) for method in dir(scenario) if not method.startswith("_")]
            for scenario in utils.itersubclasses(Scenario)
        ]
        benchmark_scenarios_flattened = list(itertools.chain.from_iterable(benchmark_scenarios))
        return benchmark_scenarios_flattened
Пример #2
0
# vim: tabstop=4 shiftwidth=4 softtabstop=4

# Copyright 2013: Mirantis Inc.
# All Rights Reserved.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

from rally.deploy.engine import *  # noqa
from rally import utils


utils.import_modules_from_package('rally.deploy.engines')
Пример #3
0
 def test_import_modules_from_package(self):
     utils.import_modules_from_package('tests.fixtures.import.package')
     self.assertTrue('tests.fixtures.import.package.a' in sys.modules)
     self.assertTrue('tests.fixtures.import.package.b' in sys.modules)
Пример #4
0
 def test_import_modules_from_package(self):
     utils.import_modules_from_package("tests.fixtures.import.package")
     self.assertTrue("tests.fixtures.import.package.a" in sys.modules)
     self.assertTrue("tests.fixtures.import.package.b" in sys.modules)
Пример #5
0
 def test_import_modules_from_package(self):
     utils.import_modules_from_package('tests.fixtures.import.package')
     self.assertTrue('tests.fixtures.import.package.a' in sys.modules)
     self.assertTrue('tests.fixtures.import.package.b' in sys.modules)
Пример #6
0
# Copyright 2014: Mirantis Inc.
# All Rights Reserved.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

from rally import utils as rutils


rutils.import_modules_from_package('rally.benchmark.context')
rutils.import_modules_from_package('rally.benchmark.runners')
rutils.import_modules_from_package("rally.benchmark.scenarios")
Пример #7
0
 def test_import_modules_from_package(self):
     utils.import_modules_from_package('tests.unit.fixtures.import.package')
     self.assertIn('tests.unit.fixtures.import.package.a', sys.modules)
     self.assertIn('tests.unit.fixtures.import.package.b', sys.modules)
Пример #8
0
# Copyright 2014: Mirantis Inc.
# All Rights Reserved.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

from rally import utils as rutils

rutils.import_modules_from_package("rally.benchmark.context")
rutils.import_modules_from_package("rally.benchmark.runners")
rutils.import_modules_from_package("rally.benchmark.scenarios")
Пример #9
0
# Copyright 2013: Mirantis Inc.
# All Rights Reserved.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

from rally.serverprovider.provider import *  # noqa
from rally import utils


utils.import_modules_from_package('rally.serverprovider.providers')
Пример #10
0
 def register():
     if not Scenario.registred:
         utils.import_modules_from_package("rally.benchmark.scenarios")
         Scenario.registred = True
Пример #11
0
# Copyright 2013: Mirantis Inc.
# All Rights Reserved.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

from rally.deploy.engine import *  # noqa
from rally import utils

utils.import_modules_from_package('rally.deploy.engines')
Пример #12
0
# Copyright 2013: Mirantis Inc.
# All Rights Reserved.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

from rally.deploy.serverprovider.provider import *  # noqa
from rally import utils

utils.import_modules_from_package('rally.deploy.serverprovider.providers')