forked from pancakeswap/pancake-smart-contracts
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from neonlabsorg/NDEV-2655
Run projects tests directly via runner script
- Loading branch information
Showing
2 changed files
with
25 additions
and
7 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
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 |
---|---|---|
@@ -1,9 +1,27 @@ | ||
#!/bin/bash | ||
|
||
# Run tests for each package with a pause | ||
for PACKAGE in $(lerna la -p --json | jq -r '.[].name'); do | ||
echo "Running command for $PACKAGE" | ||
lerna run test --scope="$PACKAGE" --stream | ||
subprojects=($(lerna la -p --json | jq -r '.[].name')) | ||
error_occurred=0 | ||
|
||
sleep 1 | ||
done | ||
for subproject in "${subprojects[@]}" | ||
do | ||
project_dir="projects/$subproject" | ||
if test -f "$project_dir/hardhat.config.ts"; then | ||
echo "Running subproject: $subproject" | ||
npx hardhat test --config "$project_dir/hardhat.config.ts" | ||
fi | ||
|
||
exit_code=$? | ||
if [ $exit_code -ne 0 ]; then | ||
echo "Subproject $subproject failed with exit code $exit_code" | ||
error_occurred=1 | ||
fi | ||
done | ||
|
||
if [ $error_occurred -ne 0 ]; then | ||
echo "One or more subprojects failed." | ||
exit 1 | ||
fi | ||
|
||
echo "All subprojects completed successfully." | ||
exit 0 |