Skip to content

Commit

Permalink
test: add ci for upgrade cluster locally
Browse files Browse the repository at this point in the history
  • Loading branch information
fraidev committed Aug 17, 2024
1 parent 86bcd9b commit 7748a77
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 2 deletions.
46 changes: 45 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ jobs:
retention-days: 1

k8_upgrade_test:
name: Upgrade cluster test on (${{ matrix.run }})
name: Upgrade K8S cluster test on (${{ matrix.run }})
needs: build_image
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -945,6 +945,50 @@ jobs:
path: diagnostics*.gz
retention-days: 1

local_upgrade_test:
name: Upgrade local cluster test on (${{ matrix.run }})
needs: build_primary_binaries
runs-on: ${{ matrix.os }}
strategy:
# fail-fast: false
matrix:
os: [ubuntu-latest]
rust-target: [x86_64-unknown-linux-musl]
run: [r1]
steps:
- uses: actions/checkout@v4
# Download artifacts
- name: Download artifact - fluvio
uses: actions/download-artifact@v4
with:
name: fluvio-${{ matrix.rust-target }}
path: ~/bin
- name: Mark executable
run: |
chmod +x ~/bin/fluvio && ~/bin/fluvio version
echo "${HOME}/bin" >> $GITHUB_PATH
- name: Run upgrade test with CI artifacts
timeout-minutes: 10
env:
TEST_DATA_BYTES: 10000
run: |
date
make FLUVIO_MODE=local FLUVIO_BIN=~/bin/fluvio upgrade-test
- name: Run diagnostics
if: ${{ !success() }}
timeout-minutes: 5
run: fluvio cluster diagnostics
- name: Upload logs
timeout-minutes: 5
if: ${{ !success() }}
uses: actions/upload-artifact@v4
with:
name: k8_upgrade_${{ matrix.run }}_log
path: diagnostics*.gz
retention-days: 1

# Smoke test across different version of fluvio
cli_smoke:
name: CLI smoke test (${{ matrix.test }}) CLI (${{ matrix.cli_version }}) on cluster (${{ matrix.cluster_version }})
Expand Down
14 changes: 13 additions & 1 deletion tests/upgrade-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ readonly PRERELEASE_TOPIC=${PRERELEASE_TOPIC:-prerelease}
readonly USE_LATEST=${USE_LATEST:-}
readonly FLUVIO_BIN=$(${READLINK} -f ${FLUVIO_BIN:-"$(which fluvio)"})
readonly FVM_BIN=$(${READLINK} -f ${FVM_BIN:-"~/.fvm/bin/fvm"})
readonly FLUVIO_MODE=${FLUVIO_MODE:-"k8"}

# Change to this script's directory
pushd "$(dirname "$(${READLINK} -f "$0")")" > /dev/null
Expand Down Expand Up @@ -75,7 +76,12 @@ function validate_cluster_stable() {
~/.fvm/bin/fvm switch stable

echo "Installing stable fluvio cluster"
$STABLE_FLUVIO cluster start --k8
if [[ "$FLUVIO_MODE" == "local" ]]; then
$STABLE_FLUVIO cluster start --local
else
$STABLE_FLUVIO cluster start --k8
fi

ci_check;

# Baseline: CLI version and platform version are expected to be the same
Expand Down Expand Up @@ -163,6 +169,12 @@ function validate_upgrade_cluster_to_prerelease() {
fi
popd

if [[ "$FLUVIO_MODE" == "local" ]]; then
echo "Resuming local cluster"
$FLUVIO_BIN_ABS_PATH cluster resume
fi


# Validate that the development version output matches the expected version from installer output
$FLUVIO_BIN_ABS_PATH version
validate_cli_version $FLUVIO_BIN_ABS_PATH $TARGET_VERSION
Expand Down

0 comments on commit 7748a77

Please sign in to comment.