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

[JUJU-1588] Added 'yq' package bash-based testing system #14448

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ echo "failed" | grep -q "passes" # fails

## Getting started

Before running tests, you'll need to install `shellcheck` and `golangci-lint`:
Before running tests, you'll need to install `jq`, `yq`, `shellcheck` and `golangci-lint`:

```sh
sudo snap install jq
sudo snap install yq
sudo snap install shellcheck
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.44.2
```
Expand Down
2 changes: 1 addition & 1 deletion tests/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ fi
echo ""

echo "==> Checking for dependencies"
check_dependencies curl jq shellcheck
check_dependencies curl jq yq shellcheck

if [[ ${USER:-'root'} == "root" ]]; then
echo "The testsuite must not be run as root." >&2
Expand Down
7 changes: 0 additions & 7 deletions tests/suites/deploy/deploy_bundles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ run_deploy_exported_charmstore_bundle_with_fixed_revisions() {
echo "Make a copy of reference yaml"
cp ${bundle} "${TEST_DIR}/telegraf_bundle.yaml"
if [[ -n ${MODEL_ARCH:-} ]]; then
if ! which "yq" >/dev/null 2>&1; then
sudo snap install yq --classic --channel latest/stable
fi
yq -i "
.machines.\"0\".constraints = \"arch=${MODEL_ARCH}\" |
.machines.\"1\".constraints = \"arch=${MODEL_ARCH}\"
Expand All @@ -98,10 +95,6 @@ run_deploy_exported_charmhub_bundle_with_float_revisions() {
bundle_with_fake_revisions=./tests/suites/deploy/bundles/telegraf_bundle_with_fake_revisions.yaml
juju deploy ${bundle}

if ! which "yq" >/dev/null 2>&1; then
sudo snap install yq --classic --channel latest/stable
fi

echo "Create telegraf_bundle_without_revisions.yaml with known latest revisions from charmhub"
influxdb_rev=$(juju info influxdb --format json | jq -r '."channel-map"."latest/stable".revision')
telegraf_rev=$(juju info telegraf --format json | jq -r '."channel-map"."latest/stable".revision')
Expand Down