Actions
action #62741
closedcoordination #56477: Implement notifications in case specific files were changed in PR
[functional][y] Check if renamed/deleted modules are not mentioned in any of schedules
Start date:
2020-01-28
Due date:
% Done:
0%
Estimated time:
5.00 h
Description
Motivation¶
yaml schedules are error prone as we deal with many files and modules. So we continue improving our automated checks to catch these.
Next step will be to check that if we rename module or remove it, that it's not mentioned in any of the yaml schedules and not in main.pm/main_common.pm files
Acceptance criteria¶
- CI reports clear error if renamed/removed test module is referenced in any yaml schedule or with loadtest calls in main.pm files or main_common.pm
Suggestion¶
sh is preferable over bash as it's more scalable.
Updated by oorlov almost 5 years ago
I've created the scripts using bash, but in order to be consistent we should use sh here (as we are using it in all other CI scripts and it is compatible with more systems). Maybe it will be useful for the one who will pick up the ticket:
Detect deleted files:
#! /bin/bash
# Add all changed files under 'test/' folder to the array in the format how they are used in scheduling files (excluding 'tests/' and file extension).
readarray -t deleted_modules < <(git diff origin/master $TRAVIS_BRANCH --name-only --diff-filter=D --exit-code | cut -f 2- -d '/' | cut -f 1 -d '.')
for module in "${deleted_modules[@]}"
do
if matched_scheduling_files="$(grep --recursive --ignore-case --files-with-matches $module schedule/)"
then
printf "\"$module\" test module was removed, but it is still used in the following YAML schedule files:\n$matched_scheduling_files\n"
exit 1
fi
done
Detect renamed files:
#! /bin/bash
# Add all changed files under 'test/' folder to the array in the format how they are used in scheduling files (excluding 'tests/' and file extension).
readarray -t renamed_modules < <(git diff origin/master $TRAVIS_BRANCH --diff-filter=R --exit-code | grep 'rename from' | cut -f 2- -d '/' | cut -f 1 -d '.')
for module in "${renamed_modules[@]}"
do
if matched_scheduling_files="$(grep --recursive --ignore-case --files-with-matches $module schedule/)"
then
printf "\"$module\" test module was renamed, but it was not modified in the following YAML schedule files:\n$matched_scheduling_files\n"
fi
done
Updated by riafarov almost 5 years ago
- Description updated (diff)
- Status changed from New to Workable
- Estimated time set to 5.00 h
Updated by JERiveraMoya almost 5 years ago
- Status changed from Workable to Feedback
Updated by JERiveraMoya almost 5 years ago
- Status changed from Feedback to Resolved
Actions