Skip to content

Commit 91054b5

Browse files
committed
Git. Added script to run tests for all blueprints with code
1 parent 68e4c28 commit 91054b5

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

scripts/alltests.sh

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
cd ../lib || exit 1
4+
5+
run_test(){
6+
if [ -z "$1" ]; then
7+
echo "Please provide blueprint directory name"
8+
exit 1
9+
fi
10+
local workdir=$1
11+
cd "$workdir" || exit 1
12+
echo "Running tests for $workdir"
13+
npm run test
14+
if [ $? -ne 0 ]; then
15+
echo "Tests failed for $workdir"
16+
exit 1
17+
fi
18+
echo "Tests successful for $workdir"
19+
cd ../ || exit 1
20+
}
21+
22+
# Run tests for each blueprint
23+
excluded_directories=("besu-private" "constructs" "wax")
24+
for dir in */; do
25+
# If dir is not in the array of excluded_directories, run test
26+
if [[ "${excluded_directories[*]}" =~ ${dir%/} ]]; then
27+
echo "Skipping $dir"
28+
else
29+
run_test "$dir"
30+
fi
31+
done

0 commit comments

Comments
 (0)