summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Neben <alexander.neben@mongodb.com>2022-11-18 20:07:00 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-11-21 16:44:22 +0000
commit61620c0d6121a5031d2c8e22906bac7e09ddee87 (patch)
treeb3d1128ea9cb896a94c264cdf6692e0a889ffeb0
parent4f8c870d1ea7b76997e6587f7facc0ae9065464b (diff)
downloadmongo-61620c0d6121a5031d2c8e22906bac7e09ddee87.tar.gz
SERVER-71471 Fixed deployment process for jstestfuzz
(cherry picked from commit 45400e2540977847771a1172de82a01fb12ec8b4)
-rw-r--r--evergreen/jstestfuzz_minimize.sh4
-rw-r--r--evergreen/jstestfuzz_run.sh9
-rw-r--r--evergreen/jstestfuzz_setup.sh7
-rw-r--r--evergreen/lint_fuzzer_sanity_all.sh4
-rw-r--r--evergreen/lint_fuzzer_sanity_patch.sh5
-rwxr-xr-xevergreen/prelude.sh15
6 files changed, 7 insertions, 37 deletions
diff --git a/evergreen/jstestfuzz_minimize.sh b/evergreen/jstestfuzz_minimize.sh
index 13ddbaf5709..e1a3f54a1a4 100644
--- a/evergreen/jstestfuzz_minimize.sh
+++ b/evergreen/jstestfuzz_minimize.sh
@@ -6,8 +6,6 @@ cd src/jstestfuzz
set -o errexit
set -o verbose
-add_nodejs_to_path
-
if [ -f "../minimizer-outputs.json" ]; then
- eval npm run ${npm_command} -- -j "../minimizer-outputs.json"
+ eval ./src/scripts/npm_run.sh ${npm_command} -- -j "../minimizer-outputs.json"
fi
diff --git a/evergreen/jstestfuzz_run.sh b/evergreen/jstestfuzz_run.sh
index d79ed69ac9b..9e6f94ee65b 100644
--- a/evergreen/jstestfuzz_run.sh
+++ b/evergreen/jstestfuzz_run.sh
@@ -1,12 +1,9 @@
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null 2>&1 && pwd)"
. "$DIR/prelude.sh"
-cd src/jstestfuzz
-
-set -o errexit
-set -o verbose
+set -evo pipefail
-add_nodejs_to_path
+cd src/jstestfuzz
in_patch_build_flag=""
if [[ "${is_patch}" = "true" ]]; then
@@ -17,4 +14,4 @@ if [[ "${is_patch}" = "true" ]]; then
esac
fi
-eval npm run "${npm_command}" -- "${jstestfuzz_vars}" "${in_patch_build_flag}" --branch "${branch_name}"
+./src/scripts/npm_run.sh ${npm_command} -- ${jstestfuzz_vars} ${in_patch_build_flag} --branch ${branch_name}
diff --git a/evergreen/jstestfuzz_setup.sh b/evergreen/jstestfuzz_setup.sh
index f0d2b7a4c29..2d7e2a53cdc 100644
--- a/evergreen/jstestfuzz_setup.sh
+++ b/evergreen/jstestfuzz_setup.sh
@@ -6,11 +6,4 @@ cd src
set -o errexit
set -o verbose
-add_nodejs_to_path
-
git clone git@github.com:10gen/jstestfuzz.git
-
-pushd jstestfuzz
-npm install
-npm run prepare
-popd
diff --git a/evergreen/lint_fuzzer_sanity_all.sh b/evergreen/lint_fuzzer_sanity_all.sh
index f8a4094e3a3..2351091722e 100644
--- a/evergreen/lint_fuzzer_sanity_all.sh
+++ b/evergreen/lint_fuzzer_sanity_all.sh
@@ -6,11 +6,9 @@ cd src
set -o pipefail
set -o verbose
-add_nodejs_to_path
-
# 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 npm run --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 ./jstestfuzz/src/scripts/npm_run.sh --prefix jstestfuzz parse-jsfiles -- | tee lint_fuzzer_sanity.log
exit_code=$?
activate_venv
diff --git a/evergreen/lint_fuzzer_sanity_patch.sh b/evergreen/lint_fuzzer_sanity_patch.sh
index 70d58d9bfe5..089a2427fd3 100644
--- a/evergreen/lint_fuzzer_sanity_patch.sh
+++ b/evergreen/lint_fuzzer_sanity_patch.sh
@@ -7,7 +7,6 @@ set -o pipefail
set -o verbose
activate_venv
-add_nodejs_to_path
mkdir -p jstestfuzzinput jstestfuzzoutput
@@ -26,10 +25,10 @@ if [[ "$(ls -A $indir)" ]]; then
num_files=50
fi
- npm run --prefix jstestfuzz jstestfuzz -- --jsTestsDir $indir --out $outdir --numSourceFiles $num_files --numGeneratedFiles 50
+ ./jstestfuzz/src/scripts/npm_run.sh --prefix jstestfuzz 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 npm run --prefix jstestfuzz parse-jsfiles -- | tee lint_fuzzer_sanity.log
+ ls -1 -d $outdir/* | xargs -P 32 -L 50 ./jstestfuzz/src/scripts/npm_run.sh --prefix jstestfuzz 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
fi
diff --git a/evergreen/prelude.sh b/evergreen/prelude.sh
index 72de6ac13bb..eb671d4b5ae 100755
--- a/evergreen/prelude.sh
+++ b/evergreen/prelude.sh
@@ -32,21 +32,6 @@ unset expansions_default_yaml
unset script
unset evergreen_dir
-function add_nodejs_to_path {
- # Add node and npm binaries to PATH
- if [ "Windows_NT" = "$OS" ]; then
- # An "npm" directory might not have been created in %APPDATA% by the Windows installer.
- # Work around the issue by specifying a different %APPDATA% path.
- # See: https://github.com/nodejs/node-v0.x-archive/issues/8141
- export APPDATA=${workdir}/npm-app-data
- export PATH="$PATH:/cygdrive/c/Program Files (x86)/nodejs" # Windows location
- # TODO: this is to work around BUILD-8652
- cd "$(pwd -P | sed 's,cygdrive/c/,cygdrive/z/,')"
- else
- export PATH="$PATH:/opt/node/bin"
- fi
-}
-
function posix_workdir {
if [ "Windows_NT" = "$OS" ]; then
echo $(cygpath -u "${workdir}")