diff mbox series

[v2,8/9] gitr: add makefile target to show test results

Message ID 20250312214232.955450-9-smayhew@redhat.com (mailing list archive)
State New
Headers show
Series tweak results organization and reporting | expand

Commit Message

Scott Mayhew March 12, 2025, 9:42 p.m. UTC
Under the hood, it more or less just does 'find ... | xargs cat'.

By default, the summary files will be shown for the most recent kernel
run.  You can show the results for a different kernel by overriding the
LAST_KERNEL variable, e.g.

$ LAST_KERNEL=6.13.4-100.fc40.x86_64 make gitr-show-results

You can change the files being shown by overriding the PATTERN variable.
For example, to just see the rpc and xprt statisics:

$ PATTERN="\( -name \"*.rpc\" -o -name \"*.xprt\" \)" make gitr-show-results

Note that since the gitr log files have a date and timestamp in the
filename, it's possible to accumulate logs from multiple test runs.  If
you're showing the results from the most recent kernel, then we'll only
show the logs from the most recent run (i.e. logs that are in the
last-run directory). But if you're showing the results from an older
kernel, then we'll show all the logs in that directory (but you can
override that too if you get creative with the PATTERN variable).

Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
 workflows/gitr/Makefile | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
diff mbox series

Patch

diff --git a/workflows/gitr/Makefile b/workflows/gitr/Makefile
index 5432f42..59c6dd5 100644
--- a/workflows/gitr/Makefile
+++ b/workflows/gitr/Makefile
@@ -70,6 +70,24 @@  GITR_KERNEL_CI_LOOP      := scripts/workflows/gitr/run_kernel_ci.sh
 GITR_KERNEL_CI_LOOP_KOTD := scripts/workflows/gitr/run_kernel_ci_kotd.sh
 endif # CONFIG_KERNEL_CI
 
+ifndef LAST_KERNEL
+LAST_KERNEL := $(shell cat workflows/gitr/results/last-kernel.txt 2>/dev/null)
+endif
+
+ifeq ($(LAST_KERNEL), $(shell cat workflows/gitr/results/last-kernel.txt 2>/dev/null))
+FIND_PATH := workflows/gitr/results/last-run
+else
+FIND_PATH := workflows/gitr/results/$(LAST_KERNEL)
+endif
+
+ifndef PATTERN
+PATTERN := -name "*.summary"
+endif
+
+ifndef XARGS_ARGS
+XARGS_ARGS := -I {} bash -c 'echo "{}:"; cat {}; echo;'
+endif
+
 gitr:
 	$(Q)ansible-playbook $(ANSIBLE_VERBOSE) -l baseline,dev \
 		-f 30 -i hosts playbooks/gitr.yml \
@@ -103,6 +121,11 @@  gitr-dev-reset:
 	$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
 		-f 30 -i hosts -l dev playbooks/gitr.yml --tags vars,reset --extra-vars=@./extra_vars.yaml
 
+gitr-show-results:
+	@find $(FIND_PATH) -type f $(PATTERN) \
+		| xargs $(XARGS_ARGS) \
+		| sed '$${/^$$/d;}'
+
 gitr-help-menu:
 	@echo "gitr options:"
 	@echo "gitr                              - Git clone git, build and install it"