Skip to content

Commit

Permalink
checkout: reduce noise by removing duplicated output
Browse files Browse the repository at this point in the history
The checkout command in printing the same information multiple
times before the nodes change again. Let's print it once.

Signed-off-by: Gustavo Padovan <[email protected]>
  • Loading branch information
padovan committed Jan 16, 2025
1 parent b2bab84 commit c37610b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions kcidev/subcommands/checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def watch_jobs(baseurl, token, treeid, jobfilter, test):
# we need to add to jobfilter "checkout" node
jobfilter = list(jobfilter)
jobfilter.append("checkout")
previous_nodes = None
while True:
inprogress = 0
joblist = jobfilter.copy()
Expand All @@ -119,8 +120,13 @@ def watch_jobs(baseurl, token, treeid, jobfilter, test):
click.secho("No nodes found. Retrying...", fg="yellow")
time.sleep(5)
continue
if previous_nodes == nodes:
kci_msg_nonl(".")
time.sleep(30)
continue

time_local = time.localtime()
click.echo(f"Current time: {time.strftime('%Y-%m-%d %H:%M:%S', time_local)}")
click.echo(f"\nCurrent time: {time.strftime('%Y-%m-%d %H:%M:%S', time_local)}")
click.secho(
f"Total tree nodes {len(nodes)} found. Jobfilter: {jobfilter}", fg="green"
)
Expand Down Expand Up @@ -175,7 +181,8 @@ def watch_jobs(baseurl, token, treeid, jobfilter, test):
kci_err(f"Test {test} failed: {test_result}")
sys.exit(1)

click.echo(f"\rRefresh in 30s...", nl=False)
kci_msg_nonl(f"\rRefresh every 30s...")
previous_nodes = nodes
time.sleep(30)


Expand Down

0 comments on commit c37610b

Please sign in to comment.