File tree Expand file tree Collapse file tree 3 files changed +38
-3
lines changed Expand file tree Collapse file tree 3 files changed +38
-3
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,16 @@ code change.
136
136
This can be used for CI/CD purposes since it generates report files in the ` /python/reports `
137
137
folder.
138
138
139
+ Options:\
140
+ ` -h ` Print help menu.
141
+ ```
142
+ validatecodeonce -h
143
+ ```
144
+ ` -k ` Invoke Pytest option ` -k ` to run specific tests based on a substring match to the test name.
145
+ ```
146
+ validatecodeonce -k test_get_products
147
+ ```
148
+
139
149
### ` runtests ` (DEPRECATED)
140
150
141
151
** DEPRECATED** : Use ` validatecodeonce ` instead
Original file line number Diff line number Diff line change @@ -52,10 +52,29 @@ validatecode() {
52
52
}
53
53
54
54
validatecodeonce () {
55
+ help () {
56
+ echo
57
+ echo " Usage: validatecodeonce [-h|k]"
58
+ echo
59
+ echo " Trigger a single run of code validation."
60
+ echo
61
+ echo " Options:"
62
+ echo " h Print this help menu."
63
+ echo " k Invoke Pytest option -k to run specific tests based on a substring match to the test name."
64
+ echo
65
+ }
66
+
67
+ while getopts " :h" option; do
68
+ case $option in
69
+ h)
70
+ help
71
+ exit ;;
72
+ esac
73
+ done
74
+
55
75
echo -e " \nTriggering single run of code validation."
56
-
57
76
loadconfig
58
- ../test_suite.sh reports
77
+ ../test_suite.sh $@ reports
59
78
}
60
79
61
80
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
checkuser () {
8
14
WHOAMI=` whoami`
35
41
fi
36
42
37
43
echo -ne " $SECTION_PREFIX RUN TESTS:\n\n"
38
- python -m pytest -vv --durations=3 --cov ./ --cov-report term-missing $PYTEST_REPORTS ; STATUS1=$?
44
+ python -m pytest -vv --durations=3 --cov ./ --cov-report term-missing $PYTEST_REPORTS $SPECIFIC_TESTS ; STATUS1=$?
39
45
40
46
echo -ne " $SECTION_PREFIX CHECK DOCKER USER IS PYTHON: "
41
47
USEROUT=` checkuser`
You can’t perform that action at this time.
0 commit comments