Skip to content
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

tests/main/cohorts: replace yq with a Python snippet #9807

Merged

Conversation

bboozzoo
Copy link
Contributor

@bboozzoo bboozzoo commented Jan 4, 2021

The yq tool changed its command line arguments and the test broke. Try not to
depend on external tools and use a simple Python snippet to extract the cohort key.

The yq tool changed its command line arguments and the test broke. Try not to
depend on external tools and use a simple Python snippet to extract the cohort key.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
So that we don't have to deal with silly quoting when calling test-snapd-sh.sh.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
@bboozzoo bboozzoo added ⚠ Critical High-priority stuff (e.g. to fix master) Simple 😃 A small PR which can be reviewed quickly labels Jan 4, 2021
Copy link
Contributor

@zyga zyga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

command="$1"
shift

exec "$command" "$@"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could simplify the last three lines of this script to simply do exec "$@". No need to split off $1.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point. We carry a copy of this script in a couple of places. I can update them in a followup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚠ Critical High-priority stuff (e.g. to fix master) Simple 😃 A small PR which can be reviewed quickly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants