Skip to content

Commit e8f24d6

Browse files
arr00Amxx
andauthored
Set max old space size on coverage and test (#5382)
Co-authored-by: Hadrien Croubois <[email protected]>
1 parent 855c39c commit e8f24d6

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"prepack": "scripts/prepack.sh",
2626
"generate": "scripts/generate/run.js",
2727
"version": "scripts/release/version.sh",
28-
"test": "hardhat test",
28+
"test": "scripts/set-max-old-space-size.sh && hardhat test",
2929
"test:generation": "scripts/checks/generation.sh",
3030
"test:inheritance": "scripts/checks/inheritance-ordering.js artifacts/build-info/*",
3131
"test:pragma": "scripts/checks/pragma-consistency.js artifacts/build-info/*",

scripts/checks/coverage.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ set -euo pipefail
55
export COVERAGE=true
66
export FOUNDRY_FUZZ_RUNS=10
77

8+
scripts/set-max-old-space-size.sh
9+
810
# Hardhat coverage
911
hardhat coverage
1012

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
# This script sets the node `--max-old-space-size` to 8192 if it is not set already.
4+
# All existing `NODE_OPTIONS` are retained as is.
5+
6+
export NODE_OPTIONS="${NODE_OPTIONS:-}"
7+
8+
if [[ $NODE_OPTIONS != *"--max-old-space-size"* ]]; then
9+
export NODE_OPTIONS="${NODE_OPTIONS} --max-old-space-size=8192"
10+
fi

0 commit comments

Comments
 (0)