File tree 3 files changed +38
-2
lines changed 3 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,16 @@ code change.
145
145
This can be used for CI/CD purposes since it generates report files in the ` /python/reports `
146
146
folder.
147
147
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
+
148
158
### ` runtests ` (DEPRECATED)
149
159
150
160
** DEPRECATED** : Use ` validatecodeonce ` instead
Original file line number Diff line number Diff line change @@ -71,10 +71,30 @@ validatecode() {
71
71
}
72
72
73
73
validatecodeonce () {
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
+
74
94
echo -e " \nTriggering single run of code validation."
75
95
76
96
loadconfig
77
- ../test_suite.sh reports
97
+ ../test_suite.sh $@ reports
78
98
}
79
99
80
100
Original file line number Diff line number Diff line change 3
3
REPORTS_FOLDER=" /python/reports/"
4
4
SECTION_PREFIX=" \n#########"
5
5
6
+ while getopts " :k:" option; do
7
+ case $option in
8
+ k)
9
+ SPECIFIC_TESTS=" -k ${OPTARG} "
10
+ esac
11
+ done
6
12
7
13
reportvalidation () {
8
14
if [ -z " $1 " ]
26
32
27
33
28
34
echo -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=$?
30
36
31
37
echo -ne " $SECTION_PREFIX CHECK TYPING: "
32
38
MYPYOUT=` mypy --no-error-summary . $MYPY_REPORTS `
You can’t perform that action at this time.
0 commit comments