Skip to content

Commit 730991b

Browse files
Merge tag 'tags/202112.2-rc1' into HEAD
2 parents de3b22e + bda1bfa commit 730991b

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,16 @@ code change.
145145
This can be used for CI/CD purposes since it generates report files in the `/python/reports`
146146
folder.
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

entrypoint.sh

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,30 @@ validatecode() {
7171
}
7272

7373
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+
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

test_suite.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
REPORTS_FOLDER="/python/reports/"
44
SECTION_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

713
reportvalidation() {
814
if [ -z "$1" ]
@@ -26,7 +32,7 @@ fi
2632

2733

2834
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=$?
3036

3137
echo -ne "$SECTION_PREFIX CHECK TYPING: "
3238
MYPYOUT=`mypy --no-error-summary . $MYPY_REPORTS`

0 commit comments

Comments
 (0)