Repository: phpbench/phpbench (php)

Issue:
Rename `--uuid` option to `ref`
The `--uuid` is misleading as you can also supply `--uuid=tag:foobar`. `--ref=` makes more sense in context.

It would also to remove the `tag:` prefix. A (PHPBench) UUID is of a fixed length and can be identified easily, and using a tag is the most common use case. 

So for example:

```
phpbench run --tag=foobar
phpbench run --ref=foobar
```

vs

```
phpbench run --tag=foobar
phpbench run --uuid=tag:foobar
```

Pull request description:
Rename --uuid option to ref and remove `tag:` prefix
Fixes #733 

This PR removes the `--uuid` option and replaces it with `--ref`, and removes the `tag:` prefix from references.

The UUID option originally only accepted PHPBench UUIDs, but in practice you rarely pass these, instead specifying a `tag:foobar`.

The `--ref` option now accepts a UUID, tag or special word (e.g. `latest`) 

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3c2b6d5d..b1f83f46 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,13 @@
 CHANGELOG
 =========
 
+develop
+-------
+
+Backward compatiblity breaks:
+
+- `--uuid` renamed to `--ref` and `tag:` prefix removed #740
+
 1.0.0-alpha-4
 -------------
 
diff --git a/docs/benchmark-runner.rst b/docs/benchmark-runner.rst
index 2894ac39..0dc03d3b 100644
--- a/docs/benchmark-runner.rst
+++ b/docs/benchmark-runner.rst
@@ -172,7 +172,7 @@ Then generate reports:
 
 .. code-block:: bash
 
-    $ phpbench report --uuid=tag:foobar --report=aggregate
+    $ phpbench report --ref=foobar --report=aggregate
 
 To dump the benchmark results to an XML file use the ``--dump-file`` option:
 
diff --git a/docs/reports.rst b/docs/reports.rst
index afd29a4e..239a365b 100644
--- a/docs/reports.rst
+++ b/docs/reports.rst
@@ -28,7 +28,7 @@ Multiple reports can be specified::
 The report command operates in a similar way but requires you to provide some
 data, either from XML dumps or by using a :doc:`storage <storage>` UUID or tag::
 
-    $ phpbench report --uuid=latest --report=aggregate
+    $ phpbench report --ref=latest --report=aggregate
 
 For more information on storage see :doc:`storage <storage>`.
 
diff --git a/docs/storage.rst b/docs/storage.rst
index acd9b087..fbd0c296 100644
--- a/docs/storage.rst
+++ b/docs/storage.rst
@@ -79,16 +79,15 @@ You may also specify a different report with the ``--report`` option. In order
 to compare two or more reports, you should use the ``report`` command as
 detailed in the following section.
 
-Pseudo UUIDs
-------------
+Tags
+----
 
-UUIDs are difficult to work with. Phpbench allows you to use a number of
-"pseudo" uuids.
+UUIDs are difficult to work with, but you can use tags
 
 ``latest``
 ~~~~~~~~~~
 
-It is possible to specify "meta" UUIDs, such as ``latest``:
+Latest is a special tag which always returns the latest benchmark.
 
 .. code-block:: bash
 
@@ -106,55 +105,23 @@ would normally specify a UUID, including queries.
 
 .. _storage_tags:
 
-``tag:``
-~~~~~~~~
+tags
+~~~~
 
-Allows you to reference a tagged run. If you store a suite:
+Reference a tagged run. If you store a suite:
 
 .. code-block:: bash
 
     $ phpbench run --tag=my_tag
 
-Then you can reference it with ``tag:my_tag``
+Then you can reference it with ``my_tag``
 
 .. code-block:: bash
 
-    $ phpbench show tag:my_tag
+    $ phpbench show my_tag
 
 Or report on it:
 
 .. code-block:: bash
 
-    $ phpbench report --uuid=tag:my_tag --report=aggregate
-
-.. _archive:
-
-Archiving
----------
-
-Archiving provides a way to export and reimport data from and to the
-configured storage. This allows you to:
-
-- Backup your results (for example to a GIT repository).
-- Migrate to other storage drivers.
-
-By default PHPBench is configured to use an ``XML`` archiver, which will dump
-results to a directory in the current working directory, ``_archive``.
-
-To archive::
-
-    $ phpbench archive
-
-To restore::
-
-    $ phpbench archive --restore 
-
-Both operations are idempotent - they will skip any existing records.
-
-You may configure a different archiver in the configuration:
-
-.. code-block:: json
-
-    {
-        "archiver": "xml"
-    }
+    $ phpbench report --ref=my_tag --report=aggregate
diff --git a/lib/Console/Command/Handler/SuiteCollectionHandler.php b/lib/Console/Command/Handler/SuiteCollectionHandler.php
index 57cf2242..50b0d5b2 100644
--- a/lib/Console/Command/Handler/SuiteCollectionHandler.php
+++ b/lib/Console/Command/Handler/SuiteCollectionHandler.php
@@ -13,43 +13,57 @@
 namespace PhpBench\Console\Command\Handler;
 
 use PhpBench\Model\SuiteCollection;
-use PhpBench\Registry\Registry;
 use PhpBench\Serializer\XmlDecoder;
-use PhpBench\Storage\UuidResolverInterface;
+use PhpBench\Storage\StorageRegistry;
+use PhpBench\Storage\UuidResolver;
 use Symfony\Component\Console\Command\Command;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Input\InputOption;
+use Webmozart\Assert\Assert;
 
 class SuiteCollectionHandler
 {
+    /**
+     * @var XmlDecoder
+     */
     private $xmlDecoder;
+
+    /**
+     * @var StorageRegistry
+     */
     private $storage;
-    private $uuidResolver;
+
+    /**
+     * @var UuidResolver
+     */
+    private $refResolver;
 
     public function __construct(
         XmlDecoder $xmlDecoder,
-        Registry $storage,
-        UuidResolverInterface $uuidResolver
+        StorageRegistry $storage,
+        UuidResolver $refResolver
     ) {
         $this->xmlDecoder = $xmlDecoder;
         $this->storage = $storage;
-        $this->uuidResolver = $uuidResolver;
+        $this->refResolver = $refResolver;
     }
 
     public static function configure(Command $command): void
     {
-        $command->addOption('uuid', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Run UUID');
+        $command->addOption('ref', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Reference to an existing run - can be a UUID or tag or special word (e.g. latest)');
         $command->addOption('file', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Report XML file');
     }
 
     public function suiteCollectionFromInput(InputInterface $input): SuiteCollection
     {
         $files = $input->getOption('file');
-        $uuids = $input->getOption('uuid');
+        $refs = $input->getOption('ref');
+        assert(is_array($files));
+        assert(is_array($refs));
 
-        if (!$files && !$uuids) {
+        if (!$files && !$refs) {
             throw new \InvalidArgumentException(
-                'You must specify at least one of `--file` and/or `--uuid`'
+                'You must specify at least one of `--file` and/or `--ref`'
             );
         }
 
@@ -61,12 +75,11 @@ class SuiteCollectionHandler
             );
         }
 
-        if ($uuids) {
-            foreach ($uuids as $uuid) {
-                $uuid = $this->uuidResolver->resolve($uuid);
-                $collection->mergeCollection(
-                    $this->storage->getService()->fetch($uuid)
-                );
+        if ($refs) {
+            foreach ($refs as $ref) {
+                $collection->mergeCollection($this->storage->getService()->fetch(
+                    $this->refResolver->resolve($ref)
+                ));
             }
         }
 
diff --git a/lib/Console/Command/ReportCommand.php b/lib/Console/Command/ReportCommand.php
index 06bdc453..e5f36b1a 100644
--- a/lib/Console/Command/ReportCommand.php
+++ b/lib/Console/Command/ReportCommand.php
@@ -62,15 +62,15 @@ class ReportCommand extends Command
         $this->setHelp(<<<'EOT'
 Generate report from the latest stored suite:
 
-    $ %command.full_name% --uuid=latest --report=aggregate
+    $ %command.full_name% --ref=latest --report=aggregate
 
 Generate report from a tag:
 
-    $ %command.full_name% --uuid=tag:foobar --report=aggregate
+    $ %command.full_name% --ref=foobar-tag --report=aggregate
 
 Generate report from a UUID (as determined from the <info>log</info> command:
 
-    $ %command.full_name% --uuid=133a2605fac74edabf046edeb9c5f7c4dc1a3aac --report=aggregate
+    $ %command.full_name% --ref=133a2605fac74edabf046edeb9c5f7c4dc1a3aac --report=aggregate
 
 Generate from an XML file:
 
diff --git a/lib/Console/Command/RunCommand.php b/lib/Console/Command/RunCommand.php
index adcec41b..abb77ee9 100644
--- a/lib/Console/Command/RunCommand.php
+++ b/lib/Console/Command/RunCommand.php
@@ -169,7 +169,7 @@ EOT
 
     private function resolveBaselines(InputInterface $input): SuiteCollection
     {
-        if ($input->getOption('uuid') || $input->getOption('file')) {
+        if ($input->getOption('ref') || $input->getOption('file')) {
             return $this->suiteCollectionHandler->suiteCollectionFromInput($input);
         }
 
diff --git a/lib/Console/Command/ShowCommand.php b/lib/Console/Command/ShowCommand.php
index 0f2bbf82..911ad20f 100644
--- a/lib/Console/Command/ShowCommand.php
+++ b/lib/Console/Command/ShowCommand.php
@@ -16,7 +16,7 @@ use PhpBench\Console\Command\Handler\DumpHandler;
 use PhpBench\Console\Command\Handler\ReportHandler;
 use PhpBench\Console\Command\Handler\TimeUnitHandler;
 use PhpBench\Registry\Registry;
-use PhpBench\Storage\UuidResolverInterface;
+use PhpBench\Storage\UuidResolver;
 use Symfony\Component\Console\Command\Command;
 use Symfony\Component\Console\Input\InputArgument;
 use Symfony\Component\Console\Input\InputInterface;
@@ -31,21 +31,21 @@ class ShowCommand extends Command
     private $reportHandler;
     private $timeUnitHandler;
     private $dumpHandler;
-    private $uuidResolver;
+    private $refResolver;
 
     public function __construct(
         Registry $storage,
         ReportHandler $reportHandler,
         TimeUnitHandler $timeUnitHandler,
         DumpHandler $dumpHandler,
-        UuidResolverInterface $uuidResolver
+        UuidResolver $refResolver
     ) {
         parent::__construct();
         $this->storage = $storage;
         $this->reportHandler = $reportHandler;
         $this->timeUnitHandler = $timeUnitHandler;
         $this->dumpHandler = $dumpHandler;
-        $this->uuidResolver = $uuidResolver;
+        $this->refResolver = $refResolver;
     }
 
     /**
@@ -82,7 +82,7 @@ EOT
         }
 
         $storage = $this->storage->getService();
-        $collection = $storage->fetch($this->uuidResolver->resolve($input->getArgument('run_id')));
+        $collection = $storage->fetch($this->refResolver->resolve($input->getArgument('run_id')));
         $this->timeUnitHandler->timeUnitFromInput($input);
         $this->dumpHandler->dumpFromInput($input, $output, $collection);
         $this->reportHandler->reportsFromInput($input, $output, $collection);
diff --git a/lib/Extension/CoreExtension.php b/lib/Extension/CoreExtension.php
index 8aa8e658..b3035f22 100644
--- a/lib/Extension/CoreExtension.php
+++ b/lib/Extension/CoreExtension.php
@@ -77,10 +77,10 @@ use PhpBench\Serializer\XmlDecoder;
 use PhpBench\Serializer\XmlEncoder;
 use PhpBench\Storage\Driver\Xml\XmlDriver;
 use PhpBench\Storage\StorageRegistry;
+use PhpBench\Storage\UuidResolver;
 use PhpBench\Storage\UuidResolver\ChainResolver;
 use PhpBench\Storage\UuidResolver\LatestResolver;
 use PhpBench\Storage\UuidResolver\TagResolver;
-use PhpBench\Storage\UuidResolverInterface;
 use PhpBench\Util\TimeUnit;
 use Symfony\Component\Console\Formatter\OutputFormatterStyle;
 use Symfony\Component\Console\Input\ArgvInput;
@@ -398,7 +398,7 @@ class CoreExtension implements ExtensionInterface
             return new SuiteCollectionHandler(
                 $container->get(XmlDecoder::class),
                 $container->get(self::SERVICE_REGISTRY_DRIVER),
-                $container->get(UuidResolverInterface::class)
+                $container->get(UuidResolver::class)
             );
         });
 
@@ -448,7 +448,7 @@ class CoreExtension implements ExtensionInterface
                 $container->get(ReportHandler::class),
                 $container->get(TimeUnitHandler::class),
                 $container->get(DumpHandler::class),
-                $container->get(UuidResolverInterface::class)
+                $container->get(UuidResolver::class)
             );
         }, [
             self::TAG_CONSOLE_COMMAND => []
@@ -697,14 +697,14 @@ class CoreExtension implements ExtensionInterface
             );
         }, [self::TAG_STORAGE_DRIVER => ['name' => 'xml']]);
 
-        $container->register(UuidResolverInterface::class, function (Container $container) {
+        $container->register(UuidResolver::class, function (Container $container) {
             $resolvers = [];
 
             foreach (array_keys($container->getServiceIdsForTag(self::TAG_UUID_RESOLVER)) as $serviceId) {
                 $resolvers[] = $container->get($serviceId);
             }
 
-            return new ChainResolver($resolvers);
+            return new UuidResolver(new ChainResolver($resolvers));
         });
 
         $container->register(LatestResolver::class, function (Container $container) {
diff --git a/lib/Registry/Registry.php b/lib/Registry/Registry.php
index b22fd54b..4daa527f 100644
--- a/lib/Registry/Registry.php
+++ b/lib/Registry/Registry.php
@@ -24,13 +24,31 @@ use Psr\Container\ContainerInterface;
  * $reg->getService($config['renderer']);
  * $reg->render($something, $config);
  * ```
+ *
+ * @template T of object
  */
 class Registry
 {
     protected $serviceType;
+
+    /**
+     * @var array<string,T|null>
+     */
     protected $services = [];
+
+    /**
+     * @var array<string, string>
+     */
     private $serviceMap = [];
+
+    /**
+     * @var ContainerInterface
+     */
     private $container;
+
+    /**
+     * @var string
+     */
     private $defaultService;
 
     public function __construct(
@@ -63,6 +81,7 @@ class Registry
     /**
      * Directly set a named service.
      *
+     * @param T $object
      */
     public function setService(string $name, object $object): void
     {
@@ -83,9 +102,9 @@ class Registry
      *
      * @param string $name
      *
-     * @return object
+     * @return T
      */
-    public function getService(string $name = null)
+    public function getService(string $name = null): object
     {
         $name = $name ?: $this->defaultService;
 
diff --git a/lib/Storage/DriverInterface.php b/lib/Storage/DriverInterface.php
index d5794247..f665c1b9 100644
--- a/lib/Storage/DriverInterface.php
+++ b/lib/Storage/DriverInterface.php
@@ -33,7 +33,6 @@ interface DriverInterface
      * Return the suite collection with the given run ID.
      * If no suite is found an exception will be thrown.
      *
-     *
      * @throws \InvalidArgumentException
      */
     public function fetch(string $runId): SuiteCollection;
diff --git a/lib/Storage/StorageRegistry.php b/lib/Storage/StorageRegistry.php
index eb1383ff..6f73b7cc 100644
--- a/lib/Storage/StorageRegistry.php
+++ b/lib/Storage/StorageRegistry.php
@@ -17,6 +17,7 @@ use Psr\Container\ContainerInterface;
 
 /**
  * @method DriverInterface getService()
+ * @extends Registry<DriverInterface>
  */
 class StorageRegistry extends Registry
 {
diff --git a/lib/Storage/UuidResolver.php b/lib/Storage/UuidResolver.php
new file mode 100644
index 00000000..fb9f4808
--- /dev/null
+++ b/lib/Storage/UuidResolver.php
@@ -0,0 +1,25 @@
+<?php
+
+namespace PhpBench\Storage;
+
+/**
+ * Wrapper class for the UUID resolver interface which will always return the
+ * UUID
+ */
+final class UuidResolver
+{
+    /**
+     * @var UuidResolverInterface
+     */
+    private $innerResolver;
+
+    public function __construct(UuidResolverInterface $innerResolver)
+    {
+        $this->innerResolver = $innerResolver;
+    }
+
+    public function resolve(string $ref): string
+    {
+        return $this->innerResolver->resolve($ref) ?? $ref;
+    }
+}
diff --git a/lib/Storage/UuidResolver/ChainResolver.php b/lib/Storage/UuidResolver/ChainResolver.php
index 0246579e..36d833e6 100644
--- a/lib/Storage/UuidResolver/ChainResolver.php
+++ b/lib/Storage/UuidResolver/ChainResolver.php
@@ -26,20 +26,19 @@ class ChainResolver implements UuidResolverInterface
         $this->resolvers = $resolvers;
     }
 
-    public function supports(string $reference): bool
-    {
-        return true;
-    }
-
-    public function resolve(string $reference): string
+    public function resolve(string $reference): ?string
     {
         /** @var UuidResolverInterface $resolver */
         foreach ($this->resolvers as $resolver) {
-            if ($resolver->supports($reference)) {
-                return $resolver->resolve($reference);
+            $ref = $resolver->resolve($reference);
+
+            if (null === $ref) {
+                continue;
             }
+
+            return $ref;
         }
 
-        return $reference;
+        return null;
     }
 }
diff --git a/lib/Storage/UuidResolver/TagResolver.php b/lib/Storage/UuidResolver/TagResolver.php
index ef60e811..e7023548 100644
--- a/lib/Storage/UuidResolver/TagResolver.php
+++ b/lib/Storage/UuidResolver/TagResolver.php
@@ -14,15 +14,12 @@ namespace PhpBench\Storage\UuidResolver;
 
 use PhpBench\Model\Tag;
 use PhpBench\Storage\Exception\InvalidTagException;
-use PhpBench\Storage\Exception\TagNotFoundException;
 use PhpBench\Storage\HistoryEntry;
 use PhpBench\Storage\StorageRegistry;
 use PhpBench\Storage\UuidResolverInterface;
 
 class TagResolver implements UuidResolverInterface
 {
-    const PREFIX = 'tag:';
-
     /**
      * @var StorageRegistry
      */
@@ -32,21 +29,7 @@ class TagResolver implements UuidResolverInterface
     {
         $this->storageRegistry = $storageRegistry;
     }
-
-    public function supports(string $reference): bool
-    {
-        if (0 === strpos($reference, self::PREFIX)) {
-            if (strlen($reference) === 4) {
-                return false;
-            }
-
-            return true;
-        }
-
-        return false;
-    }
-
-    public function resolve(string $reference): string
+    public function resolve(string $reference): ?string
     {
         $history = $this->storageRegistry->getService()->history();
 
@@ -64,15 +47,7 @@ class TagResolver implements UuidResolverInterface
             }
         }
 
-        if ($offset > 0) {
-            throw new TagNotFoundException(sprintf(
-                'Could not find entry %s entries before tag "%s"', $offset, $tag
-            ));
-        }
-
-        throw new TagNotFoundException(sprintf(
-            'Could not find entry for tag "%s"', $tag
-        ));
+        return null;
     }
 
     /**
@@ -80,7 +55,7 @@ class TagResolver implements UuidResolverInterface
      */
     private function tagAndOffset(string $reference): array
     {
-        if (!preg_match(sprintf('{^tag:(%s)?-?([0-9]+)?$}', Tag::REGEX_PATTERN), $reference, $matches)) {
+        if (!preg_match(sprintf('{^(%s)?-?([0-9]+)?$}', Tag::REGEX_PATTERN), $reference, $matches)) {
             throw new InvalidTagException(sprintf(
                 'Could not parse tag "%s"', $reference
             ));
diff --git a/lib/Storage/UuidResolverInterface.php b/lib/Storage/UuidResolverInterface.php
index 718826d1..10aa3ef3 100644
--- a/lib/Storage/UuidResolverInterface.php
+++ b/lib/Storage/UuidResolverInterface.php
@@ -14,7 +14,5 @@ namespace PhpBench\Storage;
 
 interface UuidResolverInterface
 {
-    public function supports(string $reference): bool;
-
-    public function resolve(string $reference): string;
+    public function resolve(string $reference): ?string;
 }


Test patch:
diff --git a/docs/regression-testing.rst b/docs/regression-testing.rst
index db1d171a..e965ad7a 100644
--- a/docs/regression-testing.rst
+++ b/docs/regression-testing.rst
@@ -32,12 +32,12 @@ Switch to the new version of your code and run PHPBench again:
 
 .. code-block:: bash
 
-    $ phpbench run tests/Benchmark/MyBenchmark.php --report=aggregate --uuid=tag:original --retry-threshold=5 --iterations=10
+    $ phpbench run tests/Benchmark/MyBenchmark.php --report=aggregate --ref=original --retry-threshold=5 --iterations=10
 
 
 Note that:
 
-- ``--uuid`` is used to reference the previous, tagged, run, which will merge
+- ``--ref`` is used to reference the previous, tagged, run, which will merge
   the previous benchmarks into the results.  - ``--report=aggregate`` shows
   the aggregate report, and if a baseline is present it will show differences.
 
@@ -55,7 +55,7 @@ You can compare against baselines in assertions, e.g.
 
 .. code-block:: bash
 
-    $ phpbench run tests/Benchmark/MyBenchmark.php --uuid=tag:original --retry-threshold=5 --iterations=10 --assert="variant.mode <= baseline.mode +/- 5%"
+    $ phpbench run tests/Benchmark/MyBenchmark.php --ref=original --retry-threshold=5 --iterations=10 --assert="variant.mode <= baseline.mode +/- 5%"
 
 We assert the current run's ``mode`` is less than or equal to the baseline
 ``mode`` and tolerate a variance within 5% of the baseline ``mode``.
diff --git a/lib/Storage/UuidResolver/LatestResolver.php b/lib/Storage/UuidResolver/LatestResolver.php
index b5966fb9..5a70f71b 100644
--- a/lib/Storage/UuidResolver/LatestResolver.php
+++ b/lib/Storage/UuidResolver/LatestResolver.php
@@ -27,23 +27,22 @@ class LatestResolver implements UuidResolverInterface
         $this->driverRegistry = $driver;
     }
 
-    public function supports(string $reference): bool
+    public function resolve(string $ref): ?string
     {
-        return 0 === strpos($reference, self::LATEST_KEYWORD);
-    }
+        if (0 !== strpos($ref, self::LATEST_KEYWORD)) {
+            return null;
+        }
 
-    public function resolve(string $uuid): string
-    {
-        if (strtolower($uuid) === self::LATEST_KEYWORD) {
+        if (strtolower($ref) === self::LATEST_KEYWORD) {
             return $this->getLatestUuid();
         }
 
-        if (preg_match('{' . self::LATEST_KEYWORD . '-([0-9]+)}', $uuid, $matches)) {
+        if (preg_match('{' . self::LATEST_KEYWORD . '-([0-9]+)}', $ref, $matches)) {
             return $this->getNthUuid($matches[1]);
         }
 
         throw new RuntimeException(sprintf(
-            'Could not resolve UUID "%s"', $uuid
+            'Could not resolve ref "%s"', $ref
         ));
     }
 
diff --git a/tests/System/ReportTest.php b/tests/System/ReportTest.php
index 3653dc36..19f9b89e 100644
--- a/tests/System/ReportTest.php
+++ b/tests/System/ReportTest.php
@@ -31,14 +31,14 @@ class ReportTest extends SystemTestCase
     }
 
     /**
-     * It should generate a report when given the --uuid option.
+     * It should generate a report when given the --ref option.
      */
     public function testGenerateReportFromUuid()
     {
         $document = $this->getResult(null, ' --store');
-        $uuid = $document->evaluate('string(./suite/@uuid)');
+        $ref = $document->evaluate('string(./suite/@uuid)');
         $process = $this->phpbench(
-            'report --uuid=' . $uuid . ' --report=default'
+            'report --ref=' . $ref . ' --report=default'
         );
         $this->assertEquals(0, $process->getExitCode());
         $output = $process->getOutput();
diff --git a/tests/System/RunTest.php b/tests/System/RunTest.php
index ff2220ee..2ba26d46 100644
--- a/tests/System/RunTest.php
+++ b/tests/System/RunTest.php
@@ -516,7 +516,7 @@ class RunTest extends SystemTestCase
         $this->assertExitCode(0, $process);
 
         $process = $this->phpbench(
-            'report --report=aggregate --uuid=tag:foobar'
+            'report --report=aggregate --ref=foobar'
         );
 
         $this->assertExitCode(0, $process);
diff --git a/tests/Unit/Storage/UuidResolver/ChainResolverTest.php b/tests/Unit/Storage/UuidResolver/ChainResolverTest.php
index 85a4a3db..a3591806 100644
--- a/tests/Unit/Storage/UuidResolver/ChainResolverTest.php
+++ b/tests/Unit/Storage/UuidResolver/ChainResolverTest.php
@@ -15,6 +15,7 @@ namespace PhpBench\Tests\Unit\Storage\UuidResolver;
 use PhpBench\Storage\UuidResolver\ChainResolver;
 use PhpBench\Storage\UuidResolverInterface;
 use PhpBench\Tests\TestCase;
+use Prophecy\Prophecy\ObjectProphecy;
 
 class ChainResolverTest extends TestCase
 {
@@ -31,16 +32,15 @@ class ChainResolverTest extends TestCase
         $this->resolver = $this->prophesize(UuidResolverInterface::class);
     }
 
-    public function testReturnsUuidIfNoResolverIntervened()
+    public function testNullIfNoResolverIntervened(): void
     {
         $chainResolver = new ChainResolver([]);
-        $this->assertEquals(self::TEST_REFERENCE, $chainResolver->resolve(self::TEST_REFERENCE));
+        $this->assertEquals(null, $chainResolver->resolve(self::TEST_REFERENCE));
     }
 
-    public function testChainResolve()
+    public function testChainResolve(): void
     {
         $chainResolver = new ChainResolver([$this->resolver->reveal()]);
-        $this->resolver->supports(self::TEST_REFERENCE)->willReturn(true);
         $this->resolver->resolve(self::TEST_REFERENCE)->willReturn(self::TEST_UUID);
 
         $uuid = $chainResolver->resolve(self::TEST_REFERENCE);
@@ -48,14 +48,13 @@ class ChainResolverTest extends TestCase
         $this->assertEquals(self::TEST_UUID, $uuid);
     }
 
-    public function testChainResolveNoSupport()
+    public function testNullWhenChainResolveNoSupport(): void
     {
         $chainResolver = new ChainResolver([$this->resolver->reveal()]);
-        $this->resolver->supports(self::TEST_REFERENCE)->willReturn(false);
-        $this->resolver->resolve(self::TEST_REFERENCE)->shouldNotBeCalled();
+        $this->resolver->resolve(self::TEST_REFERENCE)->willReturn(null);
 
         $uuid = $chainResolver->resolve(self::TEST_REFERENCE);
 
-        $this->assertEquals(self::TEST_REFERENCE, $uuid);
+        $this->assertEquals(null, $uuid);
     }
 }
diff --git a/tests/Unit/Storage/UuidResolver/LatestResolverTest.php b/tests/Unit/Storage/UuidResolver/LatestResolverTest.php
index adf7bbe6..07b28ade 100644
--- a/tests/Unit/Storage/UuidResolver/LatestResolverTest.php
+++ b/tests/Unit/Storage/UuidResolver/LatestResolverTest.php
@@ -51,14 +51,24 @@ class LatestResolverTest extends TestCase
         $this->history->current()->willReturn($this->historyEntry->reveal());
         $this->historyEntry->getRunId()->willReturn(1234);
 
-        $uuid = $this->resolver->resolve('latest');
-        $this->assertEquals(1234, $uuid);
+        $ref = $this->resolver->resolve('latest');
+        $this->assertEquals(1234, $ref);
+    }
+
+    public function testNullWhenNotBeginningWithLatest(): void
+    {
+        $this->storage->history()->willReturn($this->history->reveal());
+        $this->history->current()->willReturn($this->historyEntry->reveal());
+        $this->historyEntry->getRunId()->willReturn(1234);
+
+        $ref = $this->resolver->resolve('foobar');
+        $this->assertEquals(null, $ref);
     }
 
     public function testResolveCantResolve()
     {
         $this->expectException(RuntimeException::class);
-        $this->resolver->resolve('nutbar');
+        $this->resolver->resolve('latest-nutbar');
     }
 
     /**
@@ -77,8 +87,8 @@ class LatestResolverTest extends TestCase
 
         $this->history->next()->shouldBeCalledTimes(3);
 
-        $uuid = $this->resolver->resolve('latest-2');
-        $this->assertEquals(4321, $uuid);
+        $ref = $this->resolver->resolve('latest-2');
+        $this->assertEquals(4321, $ref);
     }
 
     /**
diff --git a/tests/Unit/Storage/UuidResolver/TagResolverTest.php b/tests/Unit/Storage/UuidResolver/TagResolverTest.php
index 92737ccb..8ef280df 100644
--- a/tests/Unit/Storage/UuidResolver/TagResolverTest.php
+++ b/tests/Unit/Storage/UuidResolver/TagResolverTest.php
@@ -15,7 +15,6 @@ namespace PhpBench\Tests\Unit\Storage\UuidResolver;
 use PhpBench\Model\Tag;
 use PhpBench\Storage\Driver\Fake\FakeHistoryIterator;
 use PhpBench\Storage\DriverInterface;
-use PhpBench\Storage\Exception\TagNotFoundException;
 use PhpBench\Storage\HistoryEntry;
 use PhpBench\Storage\StorageRegistry;
 use PhpBench\Storage\UuidResolver\TagResolver;
@@ -64,18 +63,9 @@ class TagResolverTest extends TestCase
         $this->resolver = new TagResolver($registry->reveal());
     }
 
-    public function testSupportsReferencesWithTagPrefix()
+    public function testThrowsExceptionWhenNoTagFound(): void
     {
-        $this->assertTrue($this->resolver->supports('tag:asdf'));
-        $this->assertFalse($this->resolver->supports('tag:'));
-        $this->assertFalse($this->resolver->supports('test'));
-    }
-
-    public function testThrowsExceptionWhenNoTagFound()
-    {
-        $this->expectException(TagNotFoundException::class);
-
-        $this->resolver->resolve('tag:1asd3foobar123');
+        self::assertNull($this->resolver->resolve('1asd3foobar123'));
     }
 
     /**
@@ -86,7 +76,7 @@ class TagResolverTest extends TestCase
         $this->historyEntry->getTag()->willReturn(new Tag($tag));
         $this->historyEntry->getRunId()->willReturn(1234);
 
-        $uuid = $this->resolver->resolve('tag:' . $tag);
+        $uuid = $this->resolver->resolve($tag);
         $this->assertEquals(1234, $uuid);
     }
 
@@ -105,7 +95,7 @@ class TagResolverTest extends TestCase
         $this->historyEntry1->getTag()->willReturn(new Tag('foobar'));
         $this->historyEntry1->getRunId()->willReturn(1234);
 
-        $uuid = $this->resolver->resolve('tag:foobar-1');
+        $uuid = $this->resolver->resolve('foobar-1');
         $this->assertEquals(1234, $uuid);
     }
 }