-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5f4544a
commit d1e42a5
Showing
3 changed files
with
36 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -180,7 +180,7 @@ $ bin/shell | |
Run a specific test (the shell offers autocompletion): | ||
|
||
```sh | ||
([email protected])1> eunit:test(ar_fork_recovery_tests:height_plus_one_fork_recovery_test_()). | ||
bin/test ar_fork_recovery_tests:height_plus_one_fork_recovery_test_ | ||
``` | ||
|
||
If it fails, the nodes keep running so you can inspect them through Erlang shell or HTTP API. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,10 +8,20 @@ cd "$SCRIPT_DIR/.." | |
|
||
export ERL_EPMD_ADDRESS=127.0.0.1 | ||
|
||
if [[ $# -gt 0 ]]; then | ||
MODULES=$@ | ||
else | ||
SRC_MODULES=$(ls $SCRIPT_DIR/../apps/arweave/src | sed -n 's/.erl$//p' | sort) | ||
TEST_MODULE_BASENAMES=$(ls $SCRIPT_DIR/../apps/arweave/test | sed -n 's/_tests.erl$//p' | sort) | ||
NON_SRC_TEST_MODULE_BASENAMES=$(comm -13 <(printf "%s\n" $SRC_MODULES) <(printf "%s\n" $TEST_MODULE_BASENAMES)) | ||
NON_SRC_TEST_MODULES=$(echo $NON_SRC_TEST_MODULE_BASENAMES | xargs -I{} echo '{}_tests') | ||
MODULES="$SRC_MODULES $NON_SRC_TEST_MODULES" | ||
fi | ||
|
||
ERL_TEST_OPTS="-pa `./rebar3 as test path` `./rebar3 as test path --base`/lib/arweave/test -config config/sys.config" | ||
echo -e "\033[0;32m===> Running tests...\033[0m" | ||
|
||
set -x | ||
set -o pipefail | ||
stdbuf -oL -eL erl $ERL_TEST_OPTS -noshell -name [email protected] -setcookie test -run ar tests ${@:1} -s init stop 2>&1 | tee main-localtest.out | ||
set +x | ||
stdbuf -oL -eL erl $ERL_TEST_OPTS -noshell -name [email protected] -setcookie test -run ar tests $MODULES -s init stop 2>&1 | tee main-localtest.out | ||
set +x |