avocado-framework/avocado

Improve Avocado jobs command

v1siuol opened this issue · 3 comments

Describe the bug
A clear and concise description of what the bug is.

  1. avocado jobs list returns unsorted list of job results. One improvement is to sort the list by mtime. This help find the recent jobs.
  2. avocado jobs show shows weird end time because we don't have the end attribute in the results.json any more.

I have a fix on the first issue, but looking for inputs for the second one. One feasible fix is to replace the end time with the start time.

Steps to reproduce
Steps to reproduce the behavior with a reproducible whenever possible.

# run a few tests
avocado run /bin/true
avocado run /bin/true
avocado run /bin/true
# 1. list
avocado jobs list
# 2. show
avocado jobs show

Expected behavior

b36e709ed01af2567e4df81842b678fb9dca51eb 2023-09-08 03:04:52.701753   1 (1/0/0/0)
11861a8dd228a86e7c0f2b3583fe6ca7011af99c 2023-09-08 03:00:01.887965   1 (1/0/0/0)
6a29261e8d23e963270c42c9147781fed3ca6118 2023-09-08 02:55:27.117886   1 (1/0/0/0)
JOB ID      : latest

Test ID     End Time            Run Time Status
1-/bin/true <correct time> 0.012107 PASS

Current behavior

b36e709ed01af2567e4df81842b678fb9dca51eb 2023-09-08 03:04:52.701753   1 (1/0/0/0)
6a29261e8d23e963270c42c9147781fed3ca6118 2023-09-08 02:55:27.117886   1 (1/0/0/0)
11861a8dd228a86e7c0f2b3583fe6ca7011af99c 2023-09-08 03:00:01.887965   1 (1/0/0/0)
JOB ID      : latest

Test ID     End Time            Run Time Status
1-/bin/true 1970/01/01 01:51:03 01:51:03 0.012107 PASS

System information (please complete the following information):

  • OS: Ubuntu 18.04.6 LTS
  • Avocado version: Avocado 102.0
  • Avocado installation method: reproduce on github & pip installation

Hi @v1siuol, thank you for finding this and even start working on this. Any contribution is welcome.

About the second issue, I think the best approach would be to compute the end time from start time and time. With such approach, we won't change the overall behavior.

@v1siuol If you don't mind, I will assign this to you, since you're already working on the first problem.

Thanks! No problem, I am happy to work on it.