private DescriptiveStatistics runTest(AbstractTest test, Repository repository) throws Exception {
    DescriptiveStatistics statistics = new DescriptiveStatistics();

    test.setUp(repository, credentials);
    try {
      // Run a few iterations to warm up the system
      long warmupEnd = System.currentTimeMillis() + warmup * 1000;
      while (System.currentTimeMillis() < warmupEnd) {
        test.execute();
      }

      // Run test iterations, and capture the execution times
      long runtimeEnd = System.currentTimeMillis() + runtime * 1000;
      while (System.currentTimeMillis() < runtimeEnd) {
        statistics.addValue(test.execute());
      }
    } finally {
      test.tearDown();
    }

    return statistics;
  }