Skip to content

Commit

Permalink
#303 Upgrade Cosmos-SDK to v0.47.3
Browse files Browse the repository at this point in the history
- Temporary comment passed tests

Signed-off-by: Abdulbois <abdulbois.tursunov@dsr-corporation.com>
Signed-off-by: Abdulbois <abdulbois123@gmail.com>
  • Loading branch information
Abdulbois committed Feb 6, 2024
1 parent c49d40b commit 5bc5b16
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ^1.20

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
needs:
- lint
steps:
- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: ^1.20
- uses: actions/checkout@v3
Expand Down
22 changes: 6 additions & 16 deletions integration_tests/cli/model-negative-cases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ test_divider

echo "Add Model with VID: $vid PID: $pid: Twice"
result=$(echo "test1234" | dcld tx model add-model --vid=$vid --pid=$pid --deviceTypeID=1 --productName=TestProduct --productLabel=TestingProductLabel --partNumber=1 --commissioningCustomFlow=0 --from=$vendor_account --yes)
result=$(get_txn_result "$result")
result=$(echo "test1234" | dcld tx model add-model --vid=$vid --pid=$pid --deviceTypeID=1 --productName=TestProduct --productLabel=TestingProductLabel --partNumber=1 --commissioningCustomFlow=0 --from=$vendor_account --yes)
result=$(get_txn_result "$result")
check_response_and_report "$result" "\"code\": 501"
Expand All @@ -92,7 +93,7 @@ result=$(get_txn_result "$result")
echo "$result"

echo "Delete Model with VID: ${vid} PID: ${pid}"
result=$(dcld tx model delete-model --vid=$vid --pid=$pid --from=$vendor_account --yes)
result=$(echo 'test1234' | dcld tx model delete-model --vid=$vid --pid=$pid --from=$vendor_account --yes)
result=$(get_txn_result "$result")
check_response "$result" "\"code\": 525" # code for model certified error

Expand All @@ -101,68 +102,57 @@ check_response "$result" "\"code\": 525" # code for model certified error

echo "Add Model with VID: $vid PID: $pid: Unknown account"
result=$(echo "test1234" | dcld tx model add-model --vid=$vid --pid=$pid --deviceTypeID=1 --productName=TestProduct --productLabel=TestingProductLabel --partNumber=1 --commissioningCustomFlow=0 --from=$vendor_account --yes)
result=$(dcld tx model add-model --vid=$vid --pid=$pid --deviceTypeID=1 --productName=TestProduct --productLabel=TestingProductLabel --partNumber=1 --commissioningCustomFlow=0 --from "Unknown" 2>&1) || true
result=$(get_txn_result "$result")
result=$(dcld tx model add-model --vid=$vid --pid=$pid --deviceTypeID=1 --productName=TestProduct --productLabel=TestingProductLabel --partNumber=1 --commissioningCustomFlow=0 --from "Unknown" 2>&1) || true
check_response_and_report "$result" "key not found" raw

test_divider

echo "Add model with invalid VID/PID"
i="-1"
result=$(echo "test1234" | dcld tx model add-model --vid=$i --pid=$pid --deviceTypeID=1 --productName=TestProduct --productLabel=TestingProductLabel --partNumber=1 --commissioningCustomFlow=0 --from $vendor_account --yes 2>&1) || true
result=$(get_txn_result "$result")
check_response_and_report "$result" "Vid must not be less than 1" raw

result=$(echo "test1234" | dcld tx model add-model --vid=$vid --pid=$i --deviceTypeID=1 --productName=TestProduct --productLabel=TestingProductLabel --partNumber=1 --commissioningCustomFlow=0 --from $vendor_account --yes 2>&1) || true
result=$(get_txn_result "$result")
heck_response_and_report "$result" "Pid must not be less than 1" raw
check_response_and_report "$result" "Pid must not be less than 1" raw

i="0"
i="0"
result=$(echo "test1234" | dcld tx model add-model --vid=$i --pid=$pid --deviceTypeID=1 --productName=TestProduct --productLabel=TestingProductLabel --partNumber=1 --commissioningCustomFlow=0 --from $vendor_account --yes 2>&1) || true
result=$(get_txn_result "$result")
check_response_and_report "$result" "Vid must not be less than 1" raw

result=$(echo "test1234" | dcld tx model add-model --vid=$vid --pid=$i --deviceTypeID=1 --productName=TestProduct --productLabel=TestingProductLabel --partNumber=1 --commissioningCustomFlow=0 --from $vendor_account --yes 2>&1) || true
result=$(get_txn_result "$result")
check_response_and_report "$result" "Pid must not be less than 1" raw

i="65536"
result=$(echo "test1234" | dcld tx model add-model --vid=$i --pid=$pid --deviceTypeID=1 --productName=TestProduct --productLabel=TestingProductLabel --partNumber=1 --commissioningCustomFlow=0 --from $vendor_account --yes 2>&1) || true
result=$(get_txn_result "$result")
check_response_and_report "$result" "Vid must not be greater than 65535" raw

result=$(echo "test1234" | dcld tx model add-model --vid=$vid --pid=$i --deviceTypeID=1 --productName=TestProduct --productLabel=TestingProductLabel --partNumber=1 --commissioningCustomFlow=0 --from $vendor_account --yes 2>&1) || true
result=$(get_txn_result "$result")
check_response_and_report "$result" "Pid must not be greater than 65535" raw

i="string"
i="string"
result=$(echo "test1234" | dcld tx model add-model --vid=$i --pid=$pid --deviceTypeID=1 --productName=TestProduct --productLabel=TestingProductLabel --partNumber=1 --commissioningCustomFlow=0 --from $vendor_account --yes 2>&1) || true
result=$(get_txn_result "$result")
check_response_and_report "$result" "invalid syntax" raw

result=$(echo "test1234" | dcld tx model add-model --vid=$vid --pid=$i --deviceTypeID=1 --productName=TestProduct --productLabel=TestingProductLabel --partNumber=1 --commissioningCustomFlow=0 --from $vendor_account --yes 2>&1) || true
result=$(get_txn_result "$result")
check_response_and_report "$result" "invalid syntax" raw

test_divider

echo "Add model with empty name"
result=$(echo "test1234" | dcld tx model add-model --vid=$vid --pid=$pid --deviceTypeID=1 --productName="" --productLabel=TestingProductLabel --partNumber=1 --commissioningCustomFlow=0 --from $vendor_account --yes 2>&1) || true
result=$(get_txn_result "$result")
check_response_and_report "$result" "ProductName is a required field" raw

test_divider

echo "Add model with empty --from flag"
result=$(dcld tx model add-model --vid=$vid --pid=$pid --deviceTypeID=1 --productName=TestProduct --productLabel=TestingProductLabel --partNumber=1 --commissioningCustomFlow=0 --from "" --yes 2>&1) || true
result=$(get_txn_result "$result")
check_response_and_report "$result" "invalid creator address (empty address string is not allowed)" raw

test_divider

echo "Add model without --from flag"
result=$(dcld tx model add-model --vid=$vid --pid=$pid --deviceTypeID=1 --productName=TestProduct --productLabel=TestingProductLabel --partNumber=1 --commissioningCustomFlow=0 --yes 2>&1) || true
result=$(get_txn_result "$result")
check_response_and_report "$result" "required flag(s) \"from\" not set" raw

test_divider
Expand Down
1 change: 1 addition & 0 deletions integration_tests/cli/modelversion-demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ test_divider
# Update model version with vid belonging to another vendor
echo "Update a Device Model Version with VID: $vid PID: $pid SV: $sv from a different vendor account"
result=$(echo 'test1234' | dcld tx model update-model-version --vid=$vid --pid=$pid --softwareVersion=$sv --softwareVersionValid=false --from=$different_vendor_account --yes)
result=$(get_txn_result "$result")
check_response_and_report "$result" "transaction should be signed by a vendor account containing the vendorID $vid"

# Delete existing model version
Expand Down
72 changes: 36 additions & 36 deletions integration_tests/run-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,30 +106,8 @@ make image &>${DETAILED_OUTPUT_TARGET}
cleanup_pool

# Cli shell tests
if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "cli" ]]; then
CLI_SHELL_TESTS=$(find integration_tests/cli -type f -name '*.sh' -not -name "common.sh")

for CLI_SHELL_TEST in ${CLI_SHELL_TESTS}; do
init_pool

log "*****************************************************************************************"
log "Running $CLI_SHELL_TEST"
log "*****************************************************************************************"

if bash "$CLI_SHELL_TEST" &>${DETAILED_OUTPUT_TARGET}; then
log "$CLI_SHELL_TEST finished successfully"
else
log "$CLI_SHELL_TEST failed"
exit 1
fi

cleanup_pool
done
fi

# Light Client Proxy Cli shell tests
#if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "light" ]]; then
# CLI_SHELL_TESTS=$(find integration_tests/light_client_proxy -type f -name '*.sh' -not -name "common.sh")
#if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "cli" ]]; then
# CLI_SHELL_TESTS=$(find integration_tests/cli -type f -name '*.sh' -not -name "common.sh")
#
# for CLI_SHELL_TEST in ${CLI_SHELL_TESTS}; do
# init_pool
Expand All @@ -149,32 +127,54 @@ fi
# done
#fi

# Go rest tests
if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "rest" ]]; then
GO_REST_TESTS="$(find integration_tests/grpc_rest -type f -name '*_test.go')"
# Light Client Proxy Cli shell tests
if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "light" ]]; then
CLI_SHELL_TESTS=$(find integration_tests/light_client_proxy -type f -name '*.sh' -not -name "common.sh" | sort)

for GO_REST_TEST in ${GO_REST_TESTS}; do
for CLI_SHELL_TEST in ${CLI_SHELL_TESTS}; do
init_pool

log "*****************************************************************************************"
log "Running $GO_REST_TEST"
log "Running $CLI_SHELL_TEST"
log "*****************************************************************************************"

# TODO issue 99: improve, that await helps with the cases of not ready connections to Cosmos endpoints
sleep 5

dcld config keyring-backend test
if go test "$GO_REST_TEST" &>${DETAILED_OUTPUT_TARGET}; then
log "$GO_REST_TEST finished successfully"
if bash "$CLI_SHELL_TEST" &>${DETAILED_OUTPUT_TARGET}; then
log "$CLI_SHELL_TEST finished successfully"
else
log "$GO_REST_TEST failed"
log "$CLI_SHELL_TEST failed"
exit 1
fi

cleanup_pool
done
fi

# Go rest tests
#if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "rest" ]]; then
# GO_REST_TESTS="$(find integration_tests/grpc_rest -type f -name '*_test.go')"
#
# for GO_REST_TEST in ${GO_REST_TESTS}; do
# init_pool
#
# log "*****************************************************************************************"
# log "Running $GO_REST_TEST"
# log "*****************************************************************************************"
#
# # TODO issue 99: improve, that await helps with the cases of not ready connections to Cosmos endpoints
# sleep 5
#
# dcld config keyring-backend test
# if go test "$GO_REST_TEST" &>${DETAILED_OUTPUT_TARGET}; then
# log "$GO_REST_TEST finished successfully"
# else
# log "$GO_REST_TEST failed"
# exit 1
# fi
#
# cleanup_pool
# done
#fi

# Deploy tests
#if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "deploy" ]]; then
# DEPLOY_SHELL_TEST="./integration_tests/deploy/test_deploy.sh"
Expand Down

0 comments on commit 5bc5b16

Please sign in to comment.