Skip to content

Commit 8dede22

Browse files
committed
fix: upgrade_test on local
1 parent 179e198 commit 8dede22

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

crates/fluvio-cluster/src/cli/upgrade.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
use std::time::Duration;
2+
13
use clap::Parser;
24
use color_eyre::owo_colors::OwoColorize;
35
use colored::Colorize;
46
use fluvio_extension_common::installation::InstallationType;
7+
use fluvio_future::timer::sleep;
58
use fluvio_sc_schema::{
69
mirror::MirrorSpec, partition::PartitionSpec, smartmodule::SmartModuleSpec, spg::SpuGroupSpec,
710
spu::SpuSpec, store::NameSpace, tableformat::TableFormatSpec, topic::TopicSpec,
@@ -76,6 +79,7 @@ impl UpgradeOpt {
7679
}
7780
};
7881
ShutdownOpt.process().await?;
82+
sleep(Duration::from_secs(10)).await;
7983
if let Err(err) = self.upgrade_local_cluster(&pb, platform_version).await {
8084
pb.println(format!("💔 {}", err.to_string().red()));
8185
}

makefiles/build.mk

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ ifeq (${CI},true)
4848
build_k8_image:
4949
else ifeq (${IMAGE_VERSION},true)
5050
build_k8_image:
51+
else ifeq (${FLUVIO_MODE},local)
52+
build_k8_image:
5153
else
5254
# When not in CI (i.e. development), build image before testing
5355
build_k8_image: fluvio_image

tests/upgrade-test.sh

+16-6
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fi
2828

2929
readonly STABLE=${1:-stable}
3030
readonly PRERELEASE=${2:-$(cat VERSION)-$(git rev-parse HEAD)}
31-
readonly CI_SLEEP=${CI_SLEEP:-5}
31+
readonly CI_SLEEP=${CI_SLEEP:-1}
3232
readonly CI=${CI:-}
3333
readonly STABLE_TOPIC=${STABLE_TOPIC:-stable}
3434
readonly PRERELEASE_TOPIC=${PRERELEASE_TOPIC:-prerelease}
@@ -52,7 +52,11 @@ function cleanup() {
5252
# If we're in CI, we want to slow down execution
5353
# to give CPU some time to rest, so we don't time out
5454
function ci_check() {
55-
:
55+
if [[ "$FLUVIO_MODE" == "local" ]]; then
56+
sleep $CI_SLEEP
57+
else
58+
:
59+
fi
5660
}
5761

5862
# This function is intended to be run second after the Stable-1 validation
@@ -97,13 +101,15 @@ function validate_cluster_stable() {
97101
# $STABLE_FLUVIO topic create ${STABLE_TOPIC}-delete
98102
ci_check;
99103

100-
echo "Create mirror"
101-
$STABLE_FLUVIO remote register stable-remote
104+
# echo "Create mirror"
105+
# $STABLE_FLUVIO remote register stable-remote
106+
# ci_check;
102107

103108
# Validate consume on topic before produce
104109
# https://github.com/infinyon/fluvio/issues/1819
105110
echo "Validate consume on \"${STABLE_TOPIC}\" before producing"
106111
$STABLE_FLUVIO consume -B -d ${STABLE_TOPIC} 2>/dev/null
112+
ci_check;
107113

108114
echo "Producing test data to ${STABLE_TOPIC}"
109115
cat data1.txt.tmp | $STABLE_FLUVIO produce ${STABLE_TOPIC}
@@ -128,6 +134,7 @@ function validate_cluster_stable() {
128134

129135

130136
$STABLE_FLUVIO partition list
137+
ci_check;
131138

132139
}
133140

@@ -151,7 +158,7 @@ function validate_upgrade_cluster_to_prerelease() {
151158
~/.fvm/bin/fvm install latest | tee /tmp/installer.output
152159
# expectd output fvm current => 0.11.0-dev-1+hash (latest)
153160
DEV_VERSION=$(~/.fvm/bin/fvm current | awk '{print $1}')
154-
TARGET_VERSION=${PRERELEASE:0:${#PRERELEASE}-41}
161+
TARGET_VERSION=${DEV_VERSION:0:${#DEV_VERSION}-41}
155162

156163
echo "Installed CLI version ${DEV_VERSION}"
157164
echo "Upgrading cluster to ${DEV_VERSION}"
@@ -172,11 +179,12 @@ function validate_upgrade_cluster_to_prerelease() {
172179
fi
173180
if [[ "$FLUVIO_MODE" == "local" ]]; then
174181
echo "Resuming local cluster"
175-
sleep 5
182+
ci_check;
176183
$FLUVIO_BIN_ABS_PATH cluster resume
177184
fi
178185
popd
179186

187+
ci_check;
180188

181189
# Validate that the development version output matches the expected version from installer output
182190
$FLUVIO_BIN_ABS_PATH version
@@ -324,6 +332,8 @@ function main() {
324332
echo "Update cluster to stable v${STABLE}. Create and validate data."
325333
validate_cluster_stable;
326334

335+
ci_check;
336+
327337
echo "Update cluster to prerelease v${PRERELEASE}"
328338
validate_upgrade_cluster_to_prerelease;
329339

0 commit comments

Comments
 (0)