unable to run caliper tests
In order to familiarise myself with the existing tool, tried running the caliper tests as mentioned in gitlab.com/PBSA/tools-libs/peerplays-utils/-/tree/master/caliper-peerplays-tests/README.md, which resulted in the following errors
- complains that no basic-private-net folder is present
- complains "Error: Cannot find module '@hyperledger/caliper-core"
ubuntu@ip-172-31-35-225:~/CALIPER/peerplays-utils/caliper-peerplays-tests$ node -v
v16.13.2
ubuntu@ip-172-31-35-225:~/CALIPER/peerplays-utils/caliper-peerplays-tests$ npm -v
8.3.2
ubuntu@ip-172-31-35-225:~/CALIPER/peerplays-utils/caliper-peerplays-tests$
ubuntu@ip-172-31-35-225:~/CALIPER/peerplays-utils$ ls -lrt
total 28
-rw-rw-r-- 1 ubuntu ubuntu 305 Jan 21 11:11 README.md
drwxrwxr-x 2 ubuntu ubuntu 4096 Jan 21 11:11 peerplays-proposal-creation
drwxrwxr-x 6 ubuntu ubuntu 4096 Jan 21 11:11 caliper-peerplays
drwxrwxr-x 2 ubuntu ubuntu 4096 Jan 21 11:26 node_modules
drwxrwxr-x 8 ubuntu ubuntu 4096 Jan 22 12:31 peerplays-qa-environment
drwxrwxr-x 2 ubuntu ubuntu 4096 Jan 22 12:31 jmeter-script-for-draw
drwxrwxr-x 6 ubuntu ubuntu 4096 Jan 22 12:54 caliper-peerplays-tests
ubuntu@ip-172-31-35-225:~/CALIPER/peerplays-utils$ git branch -a
caliper-tests-for-peerplays
* master
remotes/origin/HEAD -> origin/master
remotes/origin/bug/issue50
remotes/origin/dependabot/npm_and_yarn/caliper-peerplays/packages/caliper-core/systeminformation-4.27.11
remotes/origin/docker
remotes/origin/feature/438/add-hardware-requirements-for-environment-setup
remotes/origin/feature/5-dockerizing-qa-env
remotes/origin/feature/caliper-tests-for-peerplays
remotes/origin/jmeter_scripts
remotes/origin/master
remotes/origin/proposals
remotes/origin/support/caliper
remotes/origin/tests
ubuntu@ip-172-31-35-225:~/CALIPER/peerplays-utils$ cd caliper-peerplays-tests
ubuntu@ip-172-31-35-225:~/CALIPER/peerplays-utils/caliper-peerplays-tests$ npm i
up to date, audited 1289 packages in 12s
74 vulnerabilities (2 low, 30 moderate, 38 high, 4 critical)
To address all issues, run:
npm audit fix
Run `npm audit` for details.
ubuntu@ip-172-31-35-225:~/CALIPER/peerplays-utils/caliper-peerplays-tests$ ls -lrt
total 988
-rwxrwxr-x 1 ubuntu ubuntu 1059 Jan 21 11:11 run-tests.sh
-rw-rw-r-- 1 ubuntu ubuntu 414 Jan 21 11:11 package.json
-rw-rw-r-- 1 ubuntu ubuntu 411 Jan 21 11:11 README.md
drwxrwxr-x 3 ubuntu ubuntu 4096 Jan 22 12:31 master-private-net_tests
drwxrwxr-x 3 ubuntu ubuntu 4096 Jan 22 12:31 develop-private-net_tests
drwxrwxr-x 5 ubuntu ubuntu 4096 Jan 22 12:32 node_modules
-rw-rw-r-- 1 ubuntu ubuntu 979964 Jan 23 06:15 package-lock.json
ubuntu@ip-172-31-35-225:~/CALIPER/peerplays-utils/caliper-peerplays-tests$ BENCHMARK=basic-private-net ./run-tests.sh
set -o pipefail
# Barf if we don't recognize this test connector.
if [[ "${BENCHMARK}" = "" ]]; then
echo You must set BENCHMARK to one of the desired test collections 'master-private-net|develop-private-net'
echo For example:
echo export BENCHMARK=basic-private-net
exit 1
fi
TEST_DIR="${BENCHMARK}_tests"
if [[ -d "${TEST_DIR}" ]]; then
"${TEST_DIR}"/run.sh
else
echo "Unknown target benchmark ${BENCHMARK}"
exit 1
fi
Unknown target benchmark basic-private-net
ubuntu@ip-172-31-35-225:~/CALIPER/peerplays-utils/caliper-peerplays-tests$ BENCHMARK=develop-private-net ./run-tests.sh
set -o pipefail
# Barf if we don't recognize this test connector.
if [[ "${BENCHMARK}" = "" ]]; then
echo You must set BENCHMARK to one of the desired test collections 'master-private-net|develop-private-net'
echo For example:
echo export BENCHMARK=basic-private-net
exit 1
fi
TEST_DIR="${BENCHMARK}_tests"
if [[ -d "${TEST_DIR}" ]]; then
"${TEST_DIR}"/run.sh
else
echo "Unknown target benchmark ${BENCHMARK}"
exit 1
fi
# Grab the parent directory.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "${DIR}"
npx caliper launch manager \
--caliper-bind-sut peerplays:latest \
--caliper-workspace ./ \
--caliper-benchconfig benchconfig.yaml \
--caliper-networkconfig networkconfig.json
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module '@hyperledger/caliper-core'
Require stack:
- /home/ubuntu/CALIPER/peerplays-utils/caliper-peerplays/packages/caliper-cli/caliper.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/home/ubuntu/CALIPER/peerplays-utils/caliper-peerplays/packages/caliper-cli/caliper.js:19:26)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/ubuntu/CALIPER/peerplays-utils/caliper-peerplays/packages/caliper-cli/caliper.js'
]
}
ubuntu@ip-172-31-35-225:~/CALIPER/peerplays-utils/caliper-peerplays-tests$
Edited by Kiran Kumar