-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add development service convenience runner "openqa-run" #5796
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
usage() { | ||
cat << EOF | ||
Usage: openqa-run [OPTIONS...] OPENQA_SERVICE | ||
Call an openQA service OPENQA_SERVICE with appropriate user account and the | ||
base-dir set to the local working copy. | ||
|
||
Example: | ||
openqa-run openqa-webui-daemon | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This kind of usage is very annoying without auto completion. In my helper is worked around this via shortcuts. The script doesn't seem to ensure that e.g. |
||
|
||
Options: | ||
-h, --help display this help | ||
EOF | ||
exit "$1" | ||
} | ||
|
||
OPENQA_BASEDIR="${OPENQA_BASEDIR:-"$(dirname "$0")/../t/data"}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure whether that's the best idea. I get the idea of reusing test fixtures. However, it is also a bit problematic as this might lead to accidental cluttering and changes in that directory. This might be annoying because those changes might show up in Git (and we cannot just ignore them because files in that directory are supposed to be under version control) and might also lead to failures when running unit tests (which might not be obvious to debug). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could create a temporary directory and use that. |
||
export OPENQA_BASEDIR | ||
|
||
opts=$(getopt -o h --long help -n "$0" -- "$@") || usage 1 | ||
eval set -- "$opts" | ||
while true; do | ||
case "$1" in | ||
-h | --help) usage 0 ;; | ||
--) | ||
shift | ||
break | ||
;; | ||
*) break ;; | ||
esac | ||
done | ||
|
||
main() { | ||
"$@" | ||
} | ||
|
||
caller 0 > /dev/null || main "$@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree. The service account this script chooses is not appropriate for local development. I recommend not to mix the production/packaged setup with the development environment.
This description also makes it not clear at all to what
OPENQA_BASEDIR
is actually set (because "your local development environment" is not clear in this context, apparently it means test files from the current working dir but also only ifOPENQA_BASEDIR
is not set anyway).