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

test: print gas report, and ensure evm is killed #732

Merged
merged 1 commit into from
Oct 14, 2022
Merged
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
21 changes: 11 additions & 10 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ source $(pwd)/scripts/evm

yarn build

### Cleanup
function cleanup() {
if [ "$RUN_EVM" = true ]; then
evm_kill
fi
}
trap cleanup EXIT

# Gas reporter needs to run in its own evm instance
if [ "$RUN_EVM" = true ]; then
evm_kill
Expand All @@ -23,14 +31,7 @@ mkdir -p reports
# Run using the standalone evm instance
npx hardhat test --network hardhat $@

### Cleanup

# Exit error mode so the evm instance always gets killed
set +e
result=0

if [ "$RUN_EVM" = true ]; then
evm_kill
if [ "$REPORT_GAS" = true ]; then
cat reports/gas-report.log
echo "" # Gas report doesn't have a newline at the end
fi

exit $result