Skip to content

Commit 494cbfb

Browse files
committed
fstests: add makefile target to show test results
Add 'fstests-show-results' makefile target to show test results. Under the hood, it more or less just does 'find ... | xargs cat'. By default, the xunit_result.txt file 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-300.fc41.x86_64 make fstests-show-results You can change the files being shown by overriding the PATTERN variable. For example, to just see the xml output files: $ PATTERN="-name \"*.xml\"" make fstests-show-results or to see the xunit_results.txt and the bad results: $ PATTERN="\( -name xunit_results.txt -o -name \"*.bad\" \)" make fstests-show-results or you can do any combination thereof, e.g. $ LAST_KERNEL=6.13.4-300.fc41.x86_64 PATTERN="-name \"*.bad\"" make fstests-show-results Finally, note that if you override the PATTERN variable, then the output will also include the filename... otherwise it the output will not include the filename. The reason I did it this way for this workflow specifically is so that Luis can use 'make fstests-show-results' in his github workflow and he should get exactly the same output as he does today. Reviewed-by: Luis Chamberlain <[email protected]> Signed-off-by: Scott Mayhew <[email protected]>
1 parent e7ee1ef commit 494cbfb

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

workflows/fstests/Makefile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,28 @@ ifneq (,$(COUNT))
115115
FSTESTS_DYNAMIC_RUNTIME_VARS += , "oscheck_extra_args": "-I $(COUNT)"
116116
endif
117117

118+
ifndef LAST_KERNEL
119+
LAST_KERNEL := $(shell cat workflows/fstests/results/last-kernel.txt 2>/dev/null)
120+
endif
121+
122+
ifeq ($(LAST_KERNEL), $(shell cat workflows/fstests/results/last-kernel.txt 2>/dev/null))
123+
FIND_PATH := workflows/fstests/results/last-run
124+
else
125+
FIND_PATH := workflows/fstests/results/$(LAST_KERNEL)
126+
endif
127+
128+
ifndef PATTERN
129+
PATTERN := -name xunit_results.txt
130+
endif
131+
132+
ifndef XARGS_ARGS
133+
ifeq (-name xunit_results.txt,$(PATTERN))
134+
XARGS_ARGS := cat
135+
else
136+
XARGS_ARGS := -I {} bash -c 'echo "{}:"; cat {}; echo;'
137+
endif
138+
endif
139+
118140
fstests: $(FSTESTS_BASELINE_EXTRA)
119141
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) -l localhost,baseline,dev \
120142
-f 30 -i hosts playbooks/fstests.yml --skip-tags run_tests,copy_results $(LIMIT_HOSTS)
@@ -218,6 +240,11 @@ fstests-dev-results: $(KDEVOPS_EXTRA_VARS)
218240
--extra-vars=@./extra_vars.yaml \
219241
$(LIMIT_HOSTS)
220242

243+
fstests-show-results:
244+
@find $(FIND_PATH) -type f $(PATTERN) \
245+
| xargs $(XARGS_ARGS) \
246+
| sed '$${/^$$/d;}'
247+
221248
fstests-help-menu:
222249
@echo "fstests options:"
223250
@echo "fstests - Git clones fstests, builds and install it"

0 commit comments

Comments
 (0)