Skip to content

Commit

Permalink
Set max old space size on coverage and test (#5382)
Browse files Browse the repository at this point in the history
Co-authored-by: Hadrien Croubois <[email protected]>
  • Loading branch information
arr00 and Amxx authored Dec 19, 2024
1 parent 855c39c commit e8f24d6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"prepack": "scripts/prepack.sh",
"generate": "scripts/generate/run.js",
"version": "scripts/release/version.sh",
"test": "hardhat test",
"test": "scripts/set-max-old-space-size.sh && hardhat test",
"test:generation": "scripts/checks/generation.sh",
"test:inheritance": "scripts/checks/inheritance-ordering.js artifacts/build-info/*",
"test:pragma": "scripts/checks/pragma-consistency.js artifacts/build-info/*",
Expand Down
2 changes: 2 additions & 0 deletions scripts/checks/coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ set -euo pipefail
export COVERAGE=true
export FOUNDRY_FUZZ_RUNS=10

scripts/set-max-old-space-size.sh

# Hardhat coverage
hardhat coverage

Expand Down
10 changes: 10 additions & 0 deletions scripts/set-max-old-space-size.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

# This script sets the node `--max-old-space-size` to 8192 if it is not set already.
# All existing `NODE_OPTIONS` are retained as is.

export NODE_OPTIONS="${NODE_OPTIONS:-}"

if [[ $NODE_OPTIONS != *"--max-old-space-size"* ]]; then
export NODE_OPTIONS="${NODE_OPTIONS} --max-old-space-size=8192"
fi

0 comments on commit e8f24d6

Please sign in to comment.