summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Neben <alexander.neben@mongodb.com>2022-11-22 23:08:04 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-11-23 00:21:14 +0000
commit40152a8b38f48e0150fbc1e8472bcbcc789a6150 (patch)
tree4452c91ea8f42af75973fc0c9ee8c64656140e5b
parent8c19a7bcf29fe698fee342a527e37a42f19379f7 (diff)
downloadmongo-40152a8b38f48e0150fbc1e8472bcbcc789a6150.tar.gz
SERVER-71534 Fixed fuzzer linting scripts
(cherry picked from commit abb9e2114622a4bf9052e5adfcaf28792ce189e9)
-rw-r--r--evergreen/lint_fuzzer_sanity_all.sh12
-rw-r--r--evergreen/lint_fuzzer_sanity_patch.sh18
2 files changed, 21 insertions, 9 deletions
diff --git a/evergreen/lint_fuzzer_sanity_all.sh b/evergreen/lint_fuzzer_sanity_all.sh
index 2351091722e..186b9be1b6f 100644
--- a/evergreen/lint_fuzzer_sanity_all.sh
+++ b/evergreen/lint_fuzzer_sanity_all.sh
@@ -1,16 +1,22 @@
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null 2>&1 && pwd)"
. "$DIR/prelude.sh"
-cd src
+cd src/jstestfuzz
set -o pipefail
set -o verbose
+# Run first with help which will do the install
+# Then we can run it in parallel
+./src/scripts/npm_run.sh --help
# Run parse-jsfiles on 50 files at a time with 32 processes in parallel.
# Skip javascript files in third_party directory
-find "$PWD/jstests" "$PWD/src/mongo/db/modules/enterprise" -path "$PWD/jstests/third_party" -prune -o -name "*.js" -print | xargs -P 32 -L 50 ./jstestfuzz/src/scripts/npm_run.sh --prefix jstestfuzz parse-jsfiles -- | tee lint_fuzzer_sanity.log
+find "$PWD/../jstests" "$PWD/../src/mongo/db/modules/enterprise" -path "$PWD/../jstests/third_party" -prune -o -name "*.js" -print | xargs -P 32 -L 50 ./src/scripts/npm_run.sh parse-jsfiles -- | tee lint_fuzzer_sanity.log
exit_code=$?
+# Exit out of the jstestfuzz directory
+cd ..
+
activate_venv
-$python ./buildscripts/simple_report.py --test-name lint_fuzzer_sanity_all --log-file lint_fuzzer_sanity.log --exit-code $exit_code
+$python ./buildscripts/simple_report.py --test-name lint_fuzzer_sanity_all --log-file jstestfuzz/lint_fuzzer_sanity.log --exit-code $exit_code
exit $exit_code
diff --git a/evergreen/lint_fuzzer_sanity_patch.sh b/evergreen/lint_fuzzer_sanity_patch.sh
index 089a2427fd3..7d629de69ca 100644
--- a/evergreen/lint_fuzzer_sanity_patch.sh
+++ b/evergreen/lint_fuzzer_sanity_patch.sh
@@ -10,11 +10,14 @@ activate_venv
mkdir -p jstestfuzzinput jstestfuzzoutput
-indir="$(pwd)/jstestfuzzinput"
-outdir="$(pwd)/jstestfuzzoutput"
+# We need to be the jstestfuzz repo for node to install/run
+cd jstestfuzz
+
+indir="$(pwd)/../jstestfuzzinput"
+outdir="$(pwd)/../jstestfuzzoutput"
# Grep all the js files from modified_and_created_patch_files.txt and put them into $indir.
-(grep -v "\.tpl\.js$" modified_and_created_patch_files.txt | grep ".*jstests/.*\.js$" | xargs -I {} cp {} $indir || true)
+(grep -v "\.tpl\.js$" ../modified_and_created_patch_files.txt | grep ".*jstests/.*\.js$" | xargs -I {} cp {} $indir || true)
# Count the number of files in $indir.
if [[ "$(ls -A $indir)" ]]; then
@@ -25,10 +28,13 @@ if [[ "$(ls -A $indir)" ]]; then
num_files=50
fi
- ./jstestfuzz/src/scripts/npm_run.sh --prefix jstestfuzz jstestfuzz -- --jsTestsDir $indir --out $outdir --numSourceFiles $num_files --numGeneratedFiles 50
+ ./src/scripts/npm_run.sh jstestfuzz -- --jsTestsDir $indir --out $outdir --numSourceFiles $num_files --numGeneratedFiles 50
# Run parse-jsfiles on 50 files at a time with 32 processes in parallel.
- ls -1 -d $outdir/* | xargs -P 32 -L 50 ./jstestfuzz/src/scripts/npm_run.sh --prefix jstestfuzz parse-jsfiles -- | tee lint_fuzzer_sanity.log
+ ls -1 -d $outdir/* | xargs -P 32 -L 50 ./src/scripts/npm_run.sh parse-jsfiles -- | tee lint_fuzzer_sanity.log
exit_code=$?
- $python ./buildscripts/simple_report.py --test-name lint_fuzzer_sanity_patch --log-file lint_fuzzer_sanity.log --exit-code $exit_code
+
+ # Exit out of the jstestfuzz directory
+ cd ..
+ $python ./buildscripts/simple_report.py --test-name lint_fuzzer_sanity_patch --log-file jstestfuzz/lint_fuzzer_sanity.log --exit-code $exit_code
fi