message: Upgrade test fix
  This part of the test is kind of brittle and was missed from
  Switch channels before running tests when using the upgrade test with the `stable` and `latest` channels (used in `CD_Dev`)
  Fixes
diff: # If USE_LATEST is set, cluster will upgrade as if in CI mode, but without the pausing
  set -E
  +#set -ex
  # On Mac, use 'greadlink' instead of 'readlink'
  if [[ "$(uname)" == "Darwin" ]]; then
  @@ -62,11 +63,15 @@ function validate_cluster_stable() {
  unset VERSION
  curl -fsS https://packages.fluvio.io/v1/install.sh | bash | tee /tmp/installer.output
  - STABLE_VERSION=$(cat /tmp/installer.output | grep "Downloading Fluvio" | awk '{print $5}')
  + STABLE_VERSION=$(cat /tmp/installer.output | grep "Downloading Fluvio" | grep -v "channel" | awk '{print $5}')
  local STABLE_FLUVIO=${HOME}/.fluvio/bin/fluvio
  - echo "Installing stable fluvio"
  + # This is more for ensuring local dev will pass this test if you've changed your channel
  + echo "Switch to \"stable\" channel CLI"
  + $STABLE_FLUVIO version switch stable
  +
  + echo "Installing stable fluvio cluster"
  $STABLE_FLUVIO cluster start
  ci_check;
  @@ -127,15 +132,18 @@ function validate_upgrade_cluster_to_prerelease() {
  pushd ..
  if [[ ! -z "$USE_LATEST" ]];
  then
  - echo "Download the latest published dev CLI"
  + # Use the "latest" fluvio channel
  + echo "Switch to \"latest\" channel CLI"
  + FLUVIO_BIN_ABS_PATH=${HOME}/.fluvio/bin/fluvio
  + $FLUVIO_BIN_ABS_PATH version switch latest
  + DEV_VERSION=$($FLUVIO_BIN_ABS_PATH update | grep "Downloading Fluvio" | grep -v "channel" | awk '{print $8}' | sed 's/[+]/-/')
  - # Split this up into version (and commit too?)
  - DEV_VERSION=$(curl -fsS https://packages.fluvio.io/v1/install.sh | VERSION=latest bash | grep "Downloading Fluvio" | awk '{print $5}' | sed 's/[+]/-/')
  - TARGET_VERSION=${DEV_VERSION::-41}
  + # This is slicing the DEV_VERSION string that is expected to look like this (including the ...):
  + # ex. 0.9.17-f7e196f3c3c5cefd0339afb85543073a12db9c5d...
  + TARGET_VERSION=${DEV_VERSION::-44}
  echo "Installed CLI version ${DEV_VERSION}"
  - FLUVIO_BIN_ABS_PATH=${HOME}/.fluvio/bin/fluvio
  echo "Upgrading cluster to ${DEV_VERSION}"
  - $FLUVIO_BIN_ABS_PATH cluster upgrade --image-version latest
  + $FLUVIO_BIN_ABS_PATH cluster upgrade
  echo "Wait for SPU to be upgraded. sleeping 1 minute"
  else
  echo "Test local image v${PRERELEASE}"
  