evaluatePreconditions method

Future<Iterable<Precondition>> evaluatePreconditions({
  1. bool ignoreCache = false,
})

Run evaluation of all preconditions registered in this repository. Run order respects dependencies but when possible, tests are evaluated in parallel.

In case the previous evaluation is still running, only the already finished tests are evaluated again. The registerPrecondition.staySatisfiedCacheDuration and registerPrecondition.stayFailedCacheDuration allow usage of previously obtained result of evaluation.

Implementation

Future<Iterable<Precondition>> evaluatePreconditions({bool ignoreCache = false}) async {
  var list = _known.values.toList();
  _log.info("Evaluating ${list.length} preconditions");
  try {
    await _semaphore.acquire();
    _log.info("Semaphore acquired");
    notifyListeners();
    _Runner _context = _Runner();
    var result = await _context.runAll(list, ignoreCache);
    await _context.waitForFinish();
    return List.unmodifiable(result);
  } finally {
    _semaphore.release();
    notifyListeners();
  }
}