Repository: avocado-framework/avocado

Issue:
avocado list --resolver doesn't show the reason of failed resolutions
While the functionality of exposing the resolver was living inside the "avocado nlist" command, the reasons would be displayed on failed resolutions, such as:

```
  avocado-instrumented  /my/file   File "/my/file" does not end with ".py"
  python-unittest       /my/file   File "/my/file" does not end with ".py"
  exec-test             /my/file   File "/my/file" does not exist or is not executable
  tap                   /my/file   File "/my/file" does not exist or is not executable
```

This is very useful, and should be brought back.


Discussion:

Resolving patch:
diff --git a/avocado/plugins/list.py b/avocado/plugins/list.py
--- a/avocado/plugins/list.py
+++ b/avocado/plugins/list.py
@@ -46,7 +46,7 @@ class List(CLICmd):
     name = 'list'
     description = 'List available tests'
 
-    def _display(self, suite, matrix, resolution=None):
+    def _display(self, suite, matrix):
         header = None
         verbose = suite.config.get('core.verbose')
         if verbose:
@@ -60,6 +60,32 @@ def _display(self, suite, matrix, resolution=None):
             LOG_UI.debug(line)
 
         if verbose:
+            if suite.resolutions:
+                resolution_header = (TERM_SUPPORT.header_str('Resolver'),
+                                     TERM_SUPPORT.header_str('Reference'),
+                                     TERM_SUPPORT.header_str('Info'))
+                LOG_UI.info("")
+
+                mapping = {
+                  ReferenceResolutionResult.SUCCESS: TERM_SUPPORT.healthy_str,
+                  ReferenceResolutionResult.NOTFOUND: TERM_SUPPORT.fail_header_str,
+                  ReferenceResolutionResult.ERROR: TERM_SUPPORT.fail_header_str
+                }
+                resolution_matrix = []
+                for r in suite.resolutions:
+                    decorator = mapping.get(r.result,
+                                            TERM_SUPPORT.warn_header_str)
+                    if r.result == ReferenceResolutionResult.SUCCESS:
+                        continue
+                    resolution_matrix.append((decorator(r.origin),
+                                              r.reference,
+                                              r.info or ''))
+
+                for line in iter_tabular_output(resolution_matrix,
+                                                header=resolution_header,
+                                                strip=True):
+                    LOG_UI.info(line)
+
             LOG_UI.info("")
             LOG_UI.info("TEST TYPES SUMMARY")
             LOG_UI.info("==================")
@@ -73,16 +99,6 @@ def _display(self, suite, matrix, resolution=None):
                 for key in sorted(suite.tags_stats):
                     LOG_UI.info("%s: %s", key, suite.tags_stats[key])
 
-            if resolution:
-                resolution_header = (TERM_SUPPORT.header_str('Resolver'),
-                                     TERM_SUPPORT.header_str('Reference'),
-                                     TERM_SUPPORT.header_str('Info'))
-                LOG_UI.info("")
-                for line in iter_tabular_output(resolution,
-                                                header=resolution_header,
-                                                strip=True):
-                    LOG_UI.info(line)
-
     @staticmethod
     def _get_test_matrix(suite):
         """Used for loader."""


Test patch: