def setUp(self): """Setup cache as well as request and result.""" self.storage = Storage.create(in_memory=True) self.cache = Cache.create(storage=self.storage) request = StepRequest(step_id=123, node='some node', dependencies={'some dep': 'some state', 'another dep': 'another state'}, project_tree='some project tree') self.result = StepResult(state='something') self.keyed_request = self.storage.key_for_request(request)
def setUp(self): """Setup cache as well as request and result.""" self.storage = Storage.create(in_memory=True) self.cache = Cache.create(storage=self.storage) request = StepRequest(step_id=123, node='some node', dependencies={ 'some dep': 'some state', 'another dep': 'another state' }, project_tree='some project tree') self.result = StepResult(state='something') self.keyed_request = self.storage.key_for_request(request)
def __init__(self, scheduler, storage=None, cache=None): """ :param scheduler: The local scheduler for creating execution graphs. :type scheduler: :class:`pants.engine.exp.scheduler.LocalScheduler` :param storage: The storage instance for serializables keyed by their hashes. :type storage: :class:`pants.engine.exp.storage.Storage` :param cache: The cache instance for storing execution results, by default it uses the same Storage instance if not specified. :type cache: :class:`pants.engine.exp.storage.Cache` """ self._scheduler = scheduler self._storage = storage or Storage.create() self._cache = cache or Cache.create(storage)
def setUp(self): build_root = os.path.join(os.path.dirname(__file__), 'examples', 'scheduler_inputs') self.scheduler, self.storage = setup_json_scheduler(build_root, debug=True) self.cache = Cache.create(Storage.create()) self.java = Address.parse('src/java/codegen/simple')