Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print a list of failed tests at the end of test summary #5200

Closed
eskultety opened this issue Dec 17, 2021 · 5 comments
Closed

Print a list of failed tests at the end of test summary #5200

eskultety opened this issue Dec 17, 2021 · 5 comments
Assignees

Comments

@eskultety
Copy link

Is your feature request related to a problem? Please describe.
Consider the following execution

$ avocado run /bin/false /bin/true /bin/false
JOB ID      : latest
JOB LOG     : /home/gitlab-runner/avocado/job-results/job-2021-12-17T16.52-9b59568/job.log
SPAWNER     : process

Test ID      End Time            Run Time Status
2-/bin/true  1970/01/01 00:00:49 0.010845 PASS
3-/bin/false 1970/01/01 00:00:49 0.010837 FAIL
1-/bin/false 1970/01/01 00:00:49 0.011155 FAIL
RESULTS     : PASS 1 | ERROR 0 | FAIL 2 | SKIP 0 |WARN 0 | INTERRUPT 0 | CANCEL 0

From an output like ^this it is very simple to tell which tests passed and which failed, but do it for hundreds of tests and then one has to take scrollback and look for a needle in the haystack to find which tests have failed.

Describe the solution you'd like
Since failed tests is all everyone cares about when looking at the results, it would be both very convenient and fast to just look at a summary which might look like this:

...
RESULTS     : PASS 1 | ERROR 0 | FAIL 2 | SKIP 0 |WARN 0 | INTERRUPT 0 | CANCEL 0
Failed tests:
   3-/bin/false
   1-/bin/false

Describe alternatives you've considered

  1. Having the following the config file:
[job.output.testlogs]
statuses = ['FAIL', 'ERROR']

Avocado will tell me what the logfile for a given failed tests contained which can be very verbose as the developer is primarily interested in the list of failed tests so that they can go and investigate on their own not mentioning the fact the the log files may not contain all the necessary data for an analysis.

  1. grepping jobs
$ avocado jobs show | grep FAIL

This could be a somewhat satisfactory workaround, but you have to run 2 commands (run, jobs) which will produce 2 summaries with the latter being slightly confusing (naturally because of using grep):

$ avocado run /bin/false /bin/true /bin/false
...
RESULTS    : PASS 1 | ERROR 0 | FAIL 2 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0

$ avocado jobs show | grep FAIL
1-/bin/false 1970/01/01 00:13:55 0.010567 FAIL
3-/bin/false 1970/01/01 00:13:55 0.010627 FAIL
RESULTS     : PASS 1 | ERROR 0 | FAIL 2 | SKIP 0 |WARN 0 | INTERRUPT 0 | CANCEL 0

I think we can definitely do better (by just using a single command) and just place the list of failed test at the end of the existing job summary.

@beraldoleal beraldoleal self-assigned this Dec 17, 2021
@beraldoleal beraldoleal added this to the #95(TBD) milestone Dec 17, 2021
@beraldoleal beraldoleal added this to Long Term Backlog in Avocado Kanban via automation Dec 17, 2021
@richtja richtja moved this from Long Term Backlog to Short Term Backlog in Avocado Kanban Dec 20, 2021
@beraldoleal
Copy link
Member

Since we are in Feature Freeze this week, moving this to the next sprint.

beraldoleal added a commit to beraldoleal/avocado that referenced this issue Feb 1, 2022
This will improve the readability when running multiple tests inside a
CI job without the need to run a second command or grep to find failed
tests. This is related to: avocado-framework#5200

Signed-off-by: Beraldo Leal <bleal@redhat.com>
@beraldoleal
Copy link
Member

Hi @eskultety let me know what you think of #5249 for this feature.

beraldoleal added a commit to beraldoleal/avocado that referenced this issue Feb 2, 2022
This will improve the readability when running multiple tests inside a
CI job without the need to run a second command or grep to find failed
tests. This is related to: avocado-framework#5200

Signed-off-by: Beraldo Leal <bleal@redhat.com>
beraldoleal added a commit to beraldoleal/avocado that referenced this issue Feb 4, 2022
This will introduce the new configuration option
'job.output.testlogs.summary_statuses' that will improve the readability
when running multiple tests inside a CI job without the need to run a
second command or grep to find failed tests. This is related to: avocado-framework#5200

Signed-off-by: Beraldo Leal <bleal@redhat.com>
beraldoleal added a commit to beraldoleal/avocado that referenced this issue Feb 10, 2022
This will introduce the new configuration option
'job.output.testlogs.summary_statuses' that will improve the readability
when running multiple tests inside a CI job without the need to run a
second command or grep to find failed tests. This is related to: avocado-framework#5200

Signed-off-by: Beraldo Leal <bleal@redhat.com>
@ozer550
Copy link

ozer550 commented Feb 12, 2022

Hi there, I would like to help with this issue, The avocado project is very overwhelming for me and I would love to help in any way possible. Can someone guide me?

@richtja
Copy link
Contributor

richtja commented Feb 14, 2022

Hi @ozer550, thank you for your interest in Avocado and welcome to the Avocado community. I think this issue is already solved by @beraldoleal in #5249. But you can pick some of our low-hanging-fruit which are good for new contributors to get familiar with Avocado. Also, please read our Contributor’s Guide to get more information about contribution to Avocado project. If you need any help, don't hesitated to ask on our communication channels.

@richtja richtja moved this from Short Term Backlog to In progress in Avocado Kanban Feb 14, 2022
@ozer550
Copy link

ozer550 commented Feb 14, 2022

Thanks for your guidance @richtja I would like to start with PR #5219.

beraldoleal added a commit to beraldoleal/avocado that referenced this issue Feb 16, 2022
This will introduce the new configuration option
'job.output.testlogs.summary_statuses' that will improve the readability
when running multiple tests inside a CI job without the need to run a
second command or grep to find failed tests. This is related to: avocado-framework#5200

Signed-off-by: Beraldo Leal <bleal@redhat.com>
Avocado Kanban automation moved this from In progress to Done #96 (TBD) Mar 16, 2022
AbeLab404 pushed a commit to AbeLab404/avocado that referenced this issue Mar 30, 2022
This will introduce the new configuration option
'job.output.testlogs.summary_statuses' that will improve the readability
when running multiple tests inside a CI job without the need to run a
second command or grep to find failed tests. This is related to: avocado-framework#5200

Signed-off-by: Beraldo Leal <bleal@redhat.com>
AbeLab404 pushed a commit to AbeLab404/avocado that referenced this issue Mar 30, 2022
This will introduce the new configuration option
'job.output.testlogs.summary_statuses' that will improve the readability
when running multiple tests inside a CI job without the need to run a
second command or grep to find failed tests. This is related to: avocado-framework#5200

Signed-off-by: Beraldo Leal <bleal@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants