File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -145,6 +145,16 @@ code change.
145145This can be used for CI/CD purposes since it generates report files in the ` /python/reports `
146146folder.
147147
148+ Options:\
149+ ` -h ` Print help menu.
150+ ```
151+ validatecodeonce -h
152+ ```
153+ ` -k ` Invoke Pytest option ` -k ` to run specific tests based on a substring match to the test name.
154+ ```
155+ validatecodeonce -k test_get_products
156+ ```
157+
148158### ` runtests ` (DEPRECATED)
149159
150160** DEPRECATED** : Use ` validatecodeonce ` instead
Original file line number Diff line number Diff line change @@ -71,10 +71,30 @@ validatecode() {
7171}
7272
7373validatecodeonce () {
74+ help () {
75+ echo
76+ echo " Usage: validatecodeonce [-h|k]"
77+ echo
78+ echo " Trigger a single run of code validation."
79+ echo
80+ echo " Options:"
81+ echo " h Print this help menu."
82+ echo " k Invoke Pytest option -k to run specific tests based on a substring match to the test name."
83+ echo
84+ }
85+
86+ while getopts " :h" option; do
87+ case $option in
88+ h)
89+ help
90+ exit ;;
91+ esac
92+ done
93+
7494 echo -e " \nTriggering single run of code validation."
7595
7696 loadconfig
77- ../test_suite.sh reports
97+ ../test_suite.sh $@ reports
7898}
7999
80100
Original file line number Diff line number Diff line change 33REPORTS_FOLDER=" /python/reports/"
44SECTION_PREFIX=" \n#########"
55
6+ while getopts " :k:" option; do
7+ case $option in
8+ k)
9+ SPECIFIC_TESTS=" -k ${OPTARG} "
10+ esac
11+ done
612
713reportvalidation () {
814 if [ -z " $1 " ]
2632
2733
2834echo -ne " $SECTION_PREFIX RUN TESTS:\n\n"
29- python -m pytest -vv --durations=3 --cov ./ --cov-report term-missing $PYTEST_REPORTS ; STATUS1=$?
35+ python -m pytest -vv --durations=3 --cov ./ --cov-report term-missing $PYTEST_REPORTS $SPECIFIC_TESTS ; STATUS1=$?
3036
3137echo -ne " $SECTION_PREFIX CHECK TYPING: "
3238MYPYOUT=` mypy --no-error-summary . $MYPY_REPORTS `
You can’t perform that action at this time.
0 commit comments