blob: e9373004b1f699042f802680c1536acea02ab40c [file] [log] [blame]
koder aka kdanilov22d134e2016-11-08 11:33:19 +02001from typing import List, Callable, Any, Dict, Optional
2from concurrent.futures import ThreadPoolExecutor
3
4
5from .timeseries import SensorDatastore
6from . import inode
7from .start_vms import OSCreds
8from .storage import IStorage
9from .config import Config
10
11
koder aka kdanilov3b4da8b2016-10-17 00:17:53 +030012class TestRun:
13 """Test run information"""
koder aka kdanilov22d134e2016-11-08 11:33:19 +020014 def __init__(self, config: Config, storage: IStorage):
koder aka kdanilov3b4da8b2016-10-17 00:17:53 +030015 # NodesInfo list
koder aka kdanilov22d134e2016-11-08 11:33:19 +020016 self.nodes_info = [] # type: List[inode.NodeInfo]
koder aka kdanilov3b4da8b2016-10-17 00:17:53 +030017
18 # Nodes list
koder aka kdanilov22d134e2016-11-08 11:33:19 +020019 self.nodes = [] # type: List[inode.INode]
koder aka kdanilov3b4da8b2016-10-17 00:17:53 +030020
koder aka kdanilov22d134e2016-11-08 11:33:19 +020021 self.build_meta = {} # type: Dict[str,Any]
22 self.clear_calls_stack = [] # type: List[Callable[['TestRun'], None]]
koder aka kdanilov3b4da8b2016-10-17 00:17:53 +030023
24 # created openstack nodes
koder aka kdanilov22d134e2016-11-08 11:33:19 +020025 self.openstack_nodes_ids = [] # type: List[str]
koder aka kdanilov3b4da8b2016-10-17 00:17:53 +030026 self.sensors_mon_q = None
27
28 # openstack credentials
koder aka kdanilov22d134e2016-11-08 11:33:19 +020029 self.fuel_openstack_creds = None # type: Optional[OSCreds]
koder aka kdanilov3b4da8b2016-10-17 00:17:53 +030030
koder aka kdanilov22d134e2016-11-08 11:33:19 +020031 self.storage = storage
32 self.config = config
33 self.sensors_data = SensorDatastore()
34
35 def get_pool(self):
36 return ThreadPoolExecutor(self.config.get('worker_pool_sz', 32))
koder aka kdanilov3b4da8b2016-10-17 00:17:53 +030037