Skip to content

Commit

Permalink
test: refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
pcheremu committed Dec 5, 2023
1 parent f580696 commit 8d87571
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/tests/test_zksync_cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

declare -i counter_failed=0
declare -i counter_total=0
declare -i RESULT=0

verify_result () {
RESULT=$?
counter_total+=1
if [ $RESULT -eq 0 ]; then
echo ""
echo "\n\n"
echo "-----------> SUCCESS <-----------"
echo "---------------------------------"
else
echo ""
echo "\n\n"
echo "-----------> FAILED <-----------"
echo "---------------------------------"
counter_failed+=1
Expand All @@ -29,19 +29,22 @@ echo "1. BASIC"
echo "-----------> Basic command like zksync-cli"

npx zksync-cli
RESULT=$?
verify_result


echo ""
echo "-----------> zksync-cli -V"

npx zksync-cli -V
RESULT=$?
verify_result

echo ""
echo "-----------> zksync-cli -h"

npx zksync-cli -h
RESULT=$?
verify_result


Expand All @@ -51,13 +54,15 @@ echo "2. DEV PART"
echo "-----------> zksync-cli dev"

npx zksync-cli dev
RESULT=$?
verify_result


echo ""
echo "-----------> zksync-cli dev config"

yes | npx zksync-cli dev config
RESULT=$?
verify_result


Expand All @@ -67,18 +72,21 @@ echo ""
echo "-----------> zksync-cli dev start"

npx zksync-cli dev start
RESULT=$?
verify_result

echo ""
echo "-----------> zksync-cli dev stop"

npx zksync-cli dev stop
RESULT=$?
verify_result

echo ""
echo "-----------> zksync-cli dev restart"

npx zksync-cli dev restart
RESULT=$?
verify_result

##########
Expand All @@ -87,12 +95,14 @@ echo ""
echo "-----------> zksync-cli dev logs"

npx zksync-cli dev logs
RESULT=$?
verify_result

echo ""
echo "-----------> zksync-cli dev clean"

npx zksync-cli dev clean
RESULT=$?
verify_result

#echo ""
Expand Down Expand Up @@ -120,6 +130,7 @@ echo ""
echo "-----------> zksync-cli dev modules"

npx zksync-cli dev modules
RESULT=$?
verify_result
##########

Expand All @@ -128,7 +139,7 @@ verify_result
#yes | npx zksync-cli create
#verify_result

if [ $RESULT_COMMON -eq 0 ]; then
if [ $counter_failed -eq 0 ]; then
echo "$counter_total tests Passed"
else
echo "Fail. $counter_failed failed test(s)"
Expand Down

0 comments on commit 8d87571

Please sign in to comment.