Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interactive mode for e2e testing #3227

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,9 @@ optional arguments:
--version Future|vXX selects the network template file
```

To run a specific test:
To run a specific test, run e2e.sh with -i interactive flag, and follow the instructions:
```
~$ ./e2e_client_runner.py /full/path/to/e2e_subs/test_script.sh
```

Make sure to install the Algorand Python SDK before running:
```
pip install py-algorand-sdk
test/scripts/e2e.sh -i
```

Tests in the `e2e_subs/serial` directory are executed serially instead of in parallel. This should only be used when absolutely necessary.
25 changes: 23 additions & 2 deletions test/scripts/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Options:
-n Run tests without building binaries (Binaries are expected in PATH)
"
NO_BUILD=false
while getopts ":c:nh" opt; do
while getopts ":c:nhi" opt; do
case ${opt} in
c ) CHANNEL=$OPTARG
;;
Expand All @@ -33,7 +33,11 @@ while getopts ":c:nh" opt; do
;;
h ) echo "${HELP}"
exit 0
;;
;;
i ) echo " Interactive session"
echo "######################################################################"
INTERACTIVE=true
;;
\? ) echo "${HELP}"
exit 2
;;
Expand Down Expand Up @@ -122,6 +126,23 @@ if [ -z "$E2E_TEST_FILTER" ] || [ "$E2E_TEST_FILTER" == "SCRIPTS" ]; then
"${TEMPDIR}/ve/bin/pip3" install --upgrade py-algorand-sdk cryptography
duration "e2e client setup"

if [ $INTERACTIVE ]; then
echo "********** READY **********"
echo "The test environment is now set. Run the tests using the following command on a different terminal after setting the path."
echo ""
echo "export VIRTUAL_ENV=\"${TEMPDIR}/ve\""
echo "export PATH=\"\$VIRTUAL_ENV/bin:\$PATH\""
echo ""
echo "${TEMPDIR}/ve/bin/python3" test/scripts/e2e_client_runner.py ${RUN_KMD_WITH_UNSAFE_SCRYPT} "$SRCROOT"/test/scripts/e2e_subs/SCRIPT_FILE_NAME
echo ""
echo "Press enter to shut down the test environment..."
read a
echo -n "deactivating..."
deactivate
echo "done"
exit
fi

"${TEMPDIR}/ve/bin/python3" e2e_client_runner.py ${RUN_KMD_WITH_UNSAFE_SCRYPT} "$SRCROOT"/test/scripts/e2e_subs/*.{sh,py}
duration "parallel client runner"

Expand Down