File tree Expand file tree Collapse file tree 3 files changed +36
-7
lines changed
Expand file tree Collapse file tree 3 files changed +36
-7
lines changed Original file line number Diff line number Diff line change @@ -15,11 +15,11 @@ ENTRYPOINT ["/python/entrypoint.sh"]
1515
1616# Add convenient aliases
1717# Install python packages
18- RUN echo "#!/bin/bash\n /python/entrypoint.sh startapp" >> /bin/startapp && chmod a+x /bin/startapp \
19- && echo "#!/bin/bash\n /python/entrypoint.sh developapp" >> /bin/developapp && chmod a+x /bin/developapp \
20- && echo "#!/bin/bash\n /python/entrypoint.sh validatecode" >> /bin/validatecode && chmod a+x /bin/validatecode \
21- && echo "#!/bin/bash\n /python/entrypoint.sh validatecodeonce" >> /bin/validatecodeonce && chmod a+x /bin/validatecodeonce \
22- && echo "#!/bin/bash\n /python/entrypoint.sh runtests" >> /bin/runtests && chmod a+x /bin/runtests
18+ RUN echo "#!/bin/bash\n /python/entrypoint.sh startapp \$ @ " >> /bin/startapp && chmod a+x /bin/startapp \
19+ && echo "#!/bin/bash\n /python/entrypoint.sh developapp \$ @ " >> /bin/developapp && chmod a+x /bin/developapp \
20+ && echo "#!/bin/bash\n /python/entrypoint.sh validatecode \$ @ " >> /bin/validatecode && chmod a+x /bin/validatecode \
21+ && echo "#!/bin/bash\n /python/entrypoint.sh validatecodeonce \$ @ " >> /bin/validatecodeonce && chmod a+x /bin/validatecodeonce \
22+ && echo "#!/bin/bash\n /python/entrypoint.sh runtests \$ @ " >> /bin/runtests && chmod a+x /bin/runtests
2323# Change users
2424USER python
2525
Original file line number Diff line number Diff line change @@ -116,6 +116,16 @@ plugin.
116116This code validation command executes the ` /python/test_suite.sh ` script which can
117117be overwritten with custom code validation.
118118
119+ Options:\
120+ ` -h ` Print help menu.
121+ ```
122+ validatecode -h
123+ ```
124+ ` -k ` Invoke Pytest option ` -k ` to run specific tests based on a substring match to the test name.
125+ ```
126+ validatecode -k test_get_products
127+ ```
128+
119129### ` validatecodeonce `
120130
121131Same as ` validatecode ` but executed once rather than continously running on
Original file line number Diff line number Diff line change @@ -45,10 +45,29 @@ developapp() {
4545
4646
4747validatecode () {
48+ help () {
49+ echo
50+ echo " Usage: validatecode [-h|k]"
51+ echo
52+ echo " Automatically run code validation whenever the code changes."
53+ echo
54+ echo " Options:"
55+ echo " h Print this help menu."
56+ echo " k Invoke Pytest option -k to run specific tests based on a substring match to the test name."
57+ echo
58+ }
59+
60+ while getopts " :h" option; do
61+ case $option in
62+ h)
63+ help
64+ exit ;;
65+ esac
66+ done
67+
4868 echo -e " \nREADY TO RUN THE CODE VALIDATION SUITE\nSave a python file to trigger the checks."
49-
5069 loadconfig
51- watchmedo shell-command --patterns=" *.py;*.txt" --recursive --command=" /python/test_suite.sh" --drop .
70+ watchmedo shell-command --patterns=" *.py;*.txt" --recursive --command=" /python/test_suite.sh \$ @ " --drop .
5271}
5372
5473validatecodeonce () {
You can’t perform that action at this time.
0 commit comments