Skip to content

Commit 4fcecc8

Browse files
committed
Merge remote-tracking branch 'origin/improve-upgrade-tests' into #303-Upgrade-Cosmos-SDK
# Conflicts: # integration_tests/run-all.sh # integration_tests/upgrade/test-upgrade-0.12-to-1.2.sh # integration_tests/upgrade/test-upgrade-1.2-to-1.3.sh
2 parents b2ac10c + b5cad3f commit 4fcecc8

10 files changed

+2616
-3012
lines changed

app/app.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ func New(
680680
)
681681

682682
app.UpgradeKeeper.SetUpgradeHandler(
683-
"v1.3",
683+
"v1.4",
684684
func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
685685
return app.mm.RunMigrations(ctx, app.configurator, fromVM)
686686
},

integration_tests/cli/common.sh

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ random_string() {
4545
else
4646
eval $__resultvar="'$(date +%s.%N | sha1sum | fold -w ${length} | head -n 1)'"
4747
fi
48+
49+
sleep 1
4850
}
4951

5052
DEF_OUTPUT_MODE=json

integration_tests/run-all.sh

+52-45
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,17 @@ patch_consensus_config() {
6161
init_pool() {
6262
local _patch_config="${1:-yes}";
6363
local _localnet_init_target=${2:-localnet_init}
64+
local _binary_version=${3:-""}
6465

6566
log "Setting up pool"
6667

67-
log "-> Generating network configuration" >${DETAILED_OUTPUT_TARGET}
68-
make ${_localnet_init_target} &>${DETAILED_OUTPUT_TARGET}
68+
if [ -n "$_binary_version" ]; then
69+
log "-> Generating network configuration with binary version=$_binary_version" >${DETAILED_OUTPUT_TARGET}
70+
make ${_localnet_init_target} MAINNET_STABLE_VERSION=$_binary_version &>${DETAILED_OUTPUT_TARGET}
71+
else
72+
log "-> Generating network configuration" >${DETAILED_OUTPUT_TARGET}
73+
make ${_localnet_init_target} &>${DETAILED_OUTPUT_TARGET}
74+
fi
6975

7076
if [ "$_patch_config" = "yes" ];
7177
then
@@ -105,31 +111,31 @@ make image &>${DETAILED_OUTPUT_TARGET}
105111

106112
cleanup_pool
107113

108-
# Light Client Proxy Cli shell tests
109-
if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "light" ]]; then
110-
CLI_SHELL_TESTS=$(find integration_tests/light_client_proxy -type f -name '*.sh' -not -name "common.sh" | sort)
114+
# Cli shell tests
115+
if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "cli" ]]; then
116+
CLI_SHELL_TESTS=$(find integration_tests/cli -type f -name '*.sh' -not -name "common.sh")
111117

112-
for CLI_SHELL_TEST in ${CLI_SHELL_TESTS}; do
113-
init_pool
118+
for CLI_SHELL_TEST in ${CLI_SHELL_TESTS}; do
119+
init_pool
114120

115-
log "*****************************************************************************************"
116-
log "Running $CLI_SHELL_TEST"
117-
log "*****************************************************************************************"
121+
log "*****************************************************************************************"
122+
log "Running $CLI_SHELL_TEST"
123+
log "*****************************************************************************************"
118124

119-
if bash "$CLI_SHELL_TEST" &>${DETAILED_OUTPUT_TARGET}; then
120-
log "$CLI_SHELL_TEST finished successfully"
121-
else
122-
log "$CLI_SHELL_TEST failed"
123-
exit 1
124-
fi
125+
if bash "$CLI_SHELL_TEST" &>${DETAILED_OUTPUT_TARGET}; then
126+
log "$CLI_SHELL_TEST finished successfully"
127+
else
128+
log "$CLI_SHELL_TEST failed"
129+
exit 1
130+
fi
125131

126-
cleanup_pool
127-
done
128-
fi
132+
cleanup_pool
133+
done
134+
fi
129135

130-
# Cli shell tests
131-
if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "cli" ]]; then
132-
CLI_SHELL_TESTS=$(find integration_tests/cli -type f -name '*.sh' -not -name "common.sh")
136+
# Light Client Proxy Cli shell tests
137+
if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "light" ]]; then
138+
CLI_SHELL_TESTS=$(find integration_tests/light_client_proxy -type f -name '*.sh' -not -name "common.sh")
133139

134140
for CLI_SHELL_TEST in ${CLI_SHELL_TESTS}; do
135141
init_pool
@@ -149,7 +155,6 @@ if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "cli" ]]; then
149155
done
150156
fi
151157

152-
153158
# Go rest tests
154159
if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "rest" ]]; then
155160
GO_REST_TESTS="$(find integration_tests/grpc_rest -type f -name '*_test.go')"
@@ -177,33 +182,35 @@ if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "rest" ]]; then
177182
fi
178183

179184
# Deploy tests
180-
if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "deploy" ]]; then
181-
DEPLOY_SHELL_TEST="./integration_tests/deploy/test_deploy.sh"
182-
if bash "$DEPLOY_SHELL_TEST" &>${DETAILED_OUTPUT_TARGET}; then
183-
log "$DEPLOY_SHELL_TEST finished successfully"
184-
else
185-
log "$DEPLOY_SHELL_TEST failed"
186-
exit 1
187-
fi
188-
fi
185+
if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "deploy" ]]; then
186+
DEPLOY_SHELL_TEST="./integration_tests/deploy/test_deploy.sh"
187+
if bash "$DEPLOY_SHELL_TEST" &>${DETAILED_OUTPUT_TARGET}; then
188+
log "$DEPLOY_SHELL_TEST finished successfully"
189+
else
190+
log "$DEPLOY_SHELL_TEST failed"
191+
exit 1
192+
fi
193+
fi
189194

190195
# Upgrade procedure tests
191196
if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "upgrade" ]]; then
192-
UPGRADE_SHELL_TESTS=$(find integration_tests/upgrade -type f -name '*.sh' -not -name "add-new-node-after-upgrade.sh" -not -name "common.sh" -not -name "test-upgrade-1.2-to-1.3.sh" | sort)
197+
UPGRADE_SHELL_TEST="./integration_tests/upgrade/test-upgrade.sh"
193198

194-
for UPGRADE_SHELL_TEST in ${UPGRADE_SHELL_TESTS}; do
195-
log "*****************************************************************************************"
196-
log "Running $UPGRADE_SHELL_TEST"
197-
log "*****************************************************************************************"
199+
init_pool yes localnet_init_latest_stable_release "v0.12.0"
198200

199-
if bash "$UPGRADE_SHELL_TEST" &>${DETAILED_OUTPUT_TARGET}; then
200-
log "$UPGRADE_SHELL_TEST finished successfully"
201-
else
202-
log "$UPGRADE_SHELL_TEST failed"
203-
exit 1
204-
fi
201+
log "*****************************************************************************************"
202+
log "Running $UPGRADE_SHELL_TEST"
203+
log "*****************************************************************************************"
205204

206-
cleanup_pool
207-
done
205+
if bash "$UPGRADE_SHELL_TEST" &>${DETAILED_OUTPUT_TARGET}; then
206+
rm dcld_mainnet_stable
207+
log "$UPGRADE_SHELL_TEST finished successfully"
208+
source integration_tests/upgrade/add-new-node-after-upgrade.sh
209+
check_adding_new_node
210+
else
211+
log "$UPGRADE_SHELL_TEST failed"
212+
exit 1
213+
fi
208214

215+
cleanup_pool
209216
fi

0 commit comments

Comments
 (0)