Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
rename "cudos" in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aemil145 committed Jan 25, 2022
1 parent 7c25db8 commit 49ca0fd
Show file tree
Hide file tree
Showing 16 changed files with 58 additions and 58 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ npm run test -- init.test.sh

# source lets you use the content of a file
# ex. INIT_FOLDER, TEMPLATE_FILES
source ./packages/cudos-tests/integration-tests/vars.sh
source ./packages/blast-tests/integration-tests/vars.sh

# echo prints out the strings that are passed to it
# -n flag tells your terminal to stay on the same line after printing out the message
echo -n 'cudos init...'
echo -n 'blast init...'

# ARRANGE
# mkdir creates a folder at the path specified in INIT_FOLDER variable
Expand All @@ -99,7 +99,7 @@ mkdir $INIT_FOLDER && cd $INIT_FOLDER

# ACT
# &> /dev/null hides the output of the command
cudos init &> /dev/null
blast init &> /dev/null

# ASSERT
# ls -R lists directory content.
Expand Down
4 changes: 2 additions & 2 deletions packages/blast-utilities/config-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async function getNetwork() {
const { config } = await getConfig()

if (!config.network) {
throw new CudosError('Missing network in the config file.')
throw new BlastError('Missing network in the config file.')
}

return config.network
Expand All @@ -56,7 +56,7 @@ async function getDefaultAccount() {
const { config } = await getConfig()

if (!config.defaultAccount) {
throw new CudosError('Missing defaultAccount in the config file.')
throw new BlastError('Missing defaultAccount in the config file.')
}

return config.defaultAccount
Expand Down
4 changes: 2 additions & 2 deletions packages/cudos-tests/integration-tests/run-single-test.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
source ./packages/cudos-tests/integration-tests/vars.sh
compose='docker compose -f ./packages/cudos-config/docker-compose-start.yaml -f ./packages/cudos-config/docker-compose-init.yaml'
source ./packages/blast-tests/integration-tests/vars.sh
compose='docker compose -f ./packages/blast-config/docker-compose-start.yaml -f ./packages/blast-config/docker-compose-init.yaml'
start_node() {
$compose up --build -d &> /dev/null
timer=45
Expand Down
6 changes: 3 additions & 3 deletions packages/cudos-tests/integration-tests/run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
source ./packages/cudos-tests/integration-tests/vars.sh
compose='docker compose -f ./packages/cudos-config/docker-compose-start.yaml -f ./packages/cudos-config/docker-compose-init.yaml'
source ./packages/blast-tests/integration-tests/vars.sh
compose='docker compose -f ./packages/blast-config/docker-compose-start.yaml -f ./packages/blast-config/docker-compose-init.yaml'
start_node() {
$compose up --build -d &> /dev/null
timer=45
Expand All @@ -11,7 +11,7 @@ start_node() {
}

if [[ $1 ]]; then
./packages/cudos-tests/integration-tests/run-single-test.sh $1
./packages/blast-tests/integration-tests/run-single-test.sh $1
exit $?
fi

Expand Down
10 changes: 5 additions & 5 deletions packages/cudos-tests/integration-tests/tests/compile-run.test.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash
source ./packages/cudos-tests/integration-tests/vars.sh
source ./packages/blast-tests/integration-tests/vars.sh

echo -n 'cudos compile...'
echo -n 'blast compile...'
cp -R template $INIT_FOLDER &> /dev/null
cd $INIT_FOLDER
cudos compile &> /dev/null
blast compile &> /dev/null
cd artifacts

if [[ ! `ls -R` == $COMPILE_FILES ]]; then
Expand All @@ -14,12 +14,12 @@ else
echo -e $PASSED
fi

echo -n 'cudos run...'
echo -n 'blast run...'
cd ..
if [[ $exit_status == 1 ]]; then
docker run --rm -v "$INIT_FOLDER":/code --mount type=volume,source="contracts_cache",target=/code/target --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry cosmwasm/workspace-optimizer:0.12.3
fi
if [[ ! `cudos run ./scripts/deploy.js` =~ 'cudos' ]]; then
if [[ ! `blast run ./scripts/deploy.js` =~ 'blast' ]]; then
echo -e $FAILED
exit_status=1
else
Expand Down
6 changes: 3 additions & 3 deletions packages/cudos-tests/integration-tests/tests/init-d.test.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash
source ./packages/cudos-tests/integration-tests/vars.sh
source ./packages/blast-tests/integration-tests/vars.sh

echo -n 'cudos init -d...'
cudos init -d $INIT_FOLDER &> /dev/null && cd $INIT_FOLDER
echo -n 'blast init -d...'
blast init -d $INIT_FOLDER &> /dev/null && cd $INIT_FOLDER

if [[ ! `ls -R` == $TEMPLATE_FILES ]]; then
echo -e "$FAILED\nGenerated folder is invalid!" 1>&2
Expand Down
6 changes: 3 additions & 3 deletions packages/cudos-tests/integration-tests/tests/init.test.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
source ./packages/cudos-tests/integration-tests/vars.sh
source ./packages/blast-tests/integration-tests/vars.sh

echo -n 'cudos init...'
echo -n 'blast init...'
mkdir $INIT_FOLDER && cd $INIT_FOLDER
cudos init &> /dev/null
blast init &> /dev/null

if [[ ! `ls -R` == $TEMPLATE_FILES ]]; then
echo -e "$FAILED\nGenerated folder is invalid!" 1>&2
Expand Down
6 changes: 3 additions & 3 deletions packages/cudos-tests/integration-tests/tests/keys-add.test.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
source ./packages/cudos-tests/integration-tests/vars.sh
source ./packages/blast-tests/integration-tests/vars.sh

echo -n 'cudos keys add...'
echo -n 'blast keys add...'
cd template
cudos keys add $TEST_KEY &> /dev/null
blast keys add $TEST_KEY &> /dev/null
cd ..

if [[ ! `$COMPOSE cudos-noded keys list` =~ $TEST_KEY ]]; then
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/bin/bash
source ./packages/cudos-tests/integration-tests/vars.sh
source ./packages/blast-tests/integration-tests/vars.sh

echo -n 'cudos keys fund...'
echo -n 'blast keys fund...'
$COMPOSE cudos-noded keys add $TEST_KEY &> /dev/null
cd template
cudos keys fund $TEST_KEY -t 1 &> /dev/null
blast keys fund $TEST_KEY -t 1 &> /dev/null
cd ..

test_address=`$COMPOSE cudos-noded keys show $TEST_KEY -a`
balance=`$COMPOSE cudos-noded q bank balances $test_address`
if [[ ! $balance =~ $BALANCE_AFTER_FUND ]]; then
echo -e "cudos keys fund $FAILED\n$EXPECTED\n$BALANCE_AFTER_FUND\n$ACTUAL\n$balance" 1>&2
echo -e "blast keys fund $FAILED\n$EXPECTED\n$BALANCE_AFTER_FUND\n$ACTUAL\n$balance" 1>&2
exit_status=1
else
echo -e $PASSED
Expand Down
8 changes: 4 additions & 4 deletions packages/cudos-tests/integration-tests/tests/keys-ls.test.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#!/bin/bash
source ./packages/cudos-tests/integration-tests/vars.sh
source ./packages/blast-tests/integration-tests/vars.sh

echo -n 'cudos keys ls...'
echo -n 'blast keys ls...'
$COMPOSE cudos-noded keys add $TEST_KEY &> /dev/null
cd template
if [[ ! `cudos keys ls` =~ $TEST_KEY ]]; then
if [[ ! `blast keys ls` =~ $TEST_KEY ]]; then
echo -e $FAILED 1>&2
exit_status=1
fi

cd ..
$COMPOSE cudos-noded keys delete $TEST_KEY -y &> /dev/null
cd template
if [[ `cudos keys ls` =~ $TEST_KEY ]]; then
if [[ `blast keys ls` =~ $TEST_KEY ]]; then
echo -e $FAILED 1>&2
exit_status=1
fi
Expand Down
6 changes: 3 additions & 3 deletions packages/cudos-tests/integration-tests/tests/keys-rm.test.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash
source ./packages/cudos-tests/integration-tests/vars.sh
source ./packages/blast-tests/integration-tests/vars.sh

echo -n 'cudos keys rm...'
echo -n 'blast keys rm...'
$COMPOSE keys add $TEST_KEY &> /dev/null
cd template
cudos keys rm $TEST_KEY -f &> /dev/null
blast keys rm $TEST_KEY -f &> /dev/null
cd ..

if [[ `$COMPOSE cudos-noded keys list` =~ $TEST_KEY ]]; then
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
source ./packages/cudos-tests/integration-tests/vars.sh
source ./packages/blast-tests/integration-tests/vars.sh

echo -n 'cudos node start...'
echo -n 'blast node start...'
cd template
cudos node start -d &> /dev/null
blast node start -d &> /dev/null
cd ..
sleep 45
timer=30
Expand All @@ -20,7 +20,7 @@ if [[ ! $exit_status == 1 ]]; then
echo -e $PASSED
fi

echo -n 'cudos node status...'
echo -n 'blast node status...'
if [[ $exit_status == 1 ]]; then
$compose up --build -d &> /dev/null
timer=45
Expand All @@ -30,7 +30,7 @@ if [[ $exit_status == 1 ]]; then
done;
fi
cd template
if [[ ! `cudos node status` =~ 'online' ]]; then
if [[ ! `blast node status` =~ 'online' ]]; then
echo -e $FAILED
exit_status=1
else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
source ./packages/cudos-tests/integration-tests/vars.sh
source ./packages/blast-tests/integration-tests/vars.sh

echo -n 'cudos node stop...'
echo -n 'blast node stop...'
cd template
cudos node stop &> /dev/null
blast node stop &> /dev/null
timer=3
sleep $timer
until [[ ! `docker ps` =~ $CONTAINER_NAME ]]; do
Expand All @@ -19,11 +19,11 @@ if [[ ! $exit_status == 1 ]]; then
echo -e $PASSED
fi

echo -n 'cudos node status...'
echo -n 'blast node status...'
if [[ $exit_status == 1 ]]; then
$compose down &> /dev/null && sleep 5
fi
if [[ ! `cudos node status` =~ 'offline' ]]; then
if [[ ! `blast node status` =~ 'offline' ]]; then
echo -e $FAILED
exit_status=1
else
Expand Down
6 changes: 3 additions & 3 deletions packages/cudos-tests/integration-tests/tests/test.test.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash
source ./packages/cudos-tests/integration-tests/vars.sh
source ./packages/blast-tests/integration-tests/vars.sh

echo -n 'cudos test...'
echo -n 'blast test...'
cp -R template $INIT_FOLDER &> /dev/null && cd $INIT_FOLDER

result=`cudos test`
result=`blast test`
if [[ ! $result == $TEST_RESULT ]]; then
echo -e "$FAILED\n$EXPECTED\n$TEST_RESULT\n$ACTUAL\n$result" 1>&2
exit_status=1
Expand Down
6 changes: 3 additions & 3 deletions packages/cudos-tests/integration-tests/tests/unittest.test.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash
source ./packages/cudos-tests/integration-tests/vars.sh
source ./packages/blast-tests/integration-tests/vars.sh

echo -n 'cudos unittest...'
echo -n 'blast unittest...'
cp -R template $INIT_FOLDER &> /dev/null && cd $INIT_FOLDER

result=`cudos unittest -q`
result=`blast unittest -q`
if [[ ! $result =~ $UNITTEST_RESULT ]]; then
echo -e "$FAILED\n$EXPECTED\n$UNITTEST_RESULT\n$ACTUAL\n$result" 1>&2
exit_status=1
Expand Down
14 changes: 7 additions & 7 deletions packages/cudos-tests/integration-tests/vars.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash

export TESTS_FOLDER='./packages/cudos-tests/integration-tests/tests'
export INIT_FOLDER='./test-cudos-init'
export CONTAINER_NAME='cudos-config_cudos-node'
export COMPOSE='docker compose -f ./packages/cudos-config/docker-compose-start.yaml -f ./packages/cudos-config/docker-compose-init.yaml exec cudos-node'
export TESTS_FOLDER='./packages/blast-tests/integration-tests/tests'
export INIT_FOLDER='./test-blast-init'
export CONTAINER_NAME='blast-config_cudos-node'
export COMPOSE='docker compose -f ./packages/blast-config/docker-compose-start.yaml -f ./packages/blast-config/docker-compose-init.yaml exec cudos-node'
red='\033[0;31m'
green='\033[0;32m'
reset_color='\033[m'
Expand All @@ -22,10 +22,10 @@ export COMPILE_FILES='alpha.wasm
beta.wasm
checksums.txt
checksums_intermediate.txt'
export TEMPLATE_FILES='Cargo.lock
export TEMPLATE_FILES='blast.config.js
Cargo.lock
Cargo.toml
contracts
cudos.config.js
integration_tests
package.json
scripts
Expand Down Expand Up @@ -88,4 +88,4 @@ alpha.test.js
./scripts:
deploy.js
interaction.js'
interact.js'

0 comments on commit 49ca0fd

Please sign in to comment.