action #60908
closedaction #47894: [qe-core][functional] Continuous check for used/unused test modules within os-autoinst-distri-opensuse in the "functional" domain
[functional][u] Fix the detect_unused_modules and update to also check in the yaml schedule files
0%
Description
While we have this automated check for test modules that are in the test repository, since the YAML schedule files have been introduced, that check is becoming less and less useful, or rather we're losing some part of the view here.
It currently searches with git ls-files "*tests/*.pm"
to find all the test modules, and then uses the filename to search with: git grep -qE "($t|load_testdir.*$t_dir)"
And this is wrong, this means that if there's the mention to $t
in any file, then the check passes.
A quick fix could be:
- git grep -qE "($t|load_testdir.*$t_dir)" || echo $test
# remove the -q from grep to see verbose output
+ git grep -qE "(loadtest.*$t|load_testdir.*$t_dir)" || echo $test
But we also need to take into account the YAML Schedule, and that commented lines will not be taken into account.