summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Guo <robert.guo@10gen.com>2019-06-18 14:05:36 -0400
committerRobert Guo <robert.guo@10gen.com>2019-06-18 17:53:15 -0400
commit91b898cb3748eeec0e0d181b2130952547883e27 (patch)
tree7d3f9803959824fb354ae54e4e8ca32391a33bb0
parentab89518f6f22a9f1177e6ef913fdaff4af809098 (diff)
downloadmongo-91b898cb3748eeec0e0d181b2130952547883e27.tar.gz
SERVER-41401 SERVER-40924 SERVER-40923 Add Evergreen task to sanity check fuzzer can parse JavaScript tests, remove npm test call
-rw-r--r--etc/evergreen.yml177
1 files changed, 127 insertions, 50 deletions
diff --git a/etc/evergreen.yml b/etc/evergreen.yml
index 8b7e8b6c96a..79d9a413758 100644
--- a/etc/evergreen.yml
+++ b/etc/evergreen.yml
@@ -144,6 +144,7 @@ variables:
- name: compile
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
- *run_jstestfuzz_tests
@@ -547,6 +548,22 @@ functions:
mkdir -p ../../../../../../mongo-tools/distsrc
cp THIRD-PARTY-NOTICES ../../../../../../mongo-tools/distsrc/THIRD-PARTY-NOTICES.gotools
+ # This function should only be called from patch-build-only tasks.
+ "get added and modified patch files":
+ command: shell.exec
+ params:
+ working_dir: src
+ shell: bash
+ script: |
+ set -o verbose
+ set -o errexit
+ git diff HEAD --name-only --line-prefix="${workdir}/src/" --diff-filter=d >> modified_and_created_patch_files.txt
+ if [ -d src/mongo/db/modules/enterprise ]; then
+ pushd src/mongo/db/modules/enterprise
+ git diff HEAD --name-only --line-prefix="${workdir}/src/src/mongo/db/modules/enterprise/" --diff-filter=d >> ~1/modified_and_created_patch_files.txt
+ popd
+ fi
+
"send benchmark results" :
command: json.send
params:
@@ -919,85 +936,76 @@ functions:
exit $(cat jepsen_system_failure_${task_name}_${execution})
fi
- "run jstestfuzz":
+ "setup jstestfuzz":
- command: shell.exec
params:
working_dir: src
+ shell: bash
script: |
set -o errexit
set -o verbose
+ ${add_nodejs_to_path}
+
git clone git@github.com:10gen/jstestfuzz.git
- cp mongodb*/bin/mongod .
+ pushd jstestfuzz
+ npm install
+ npm run prepare
+ popd
+ "lint fuzzer sanity patch":
- command: shell.exec
+ type: test
params:
working_dir: src
+ shell: bash
script: |
- set -o errexit
+ set -eo pipefail
set -o verbose
- git clone --depth 1 git@github.com:10gen/mongo-enterprise-modules.git jstests/enterprise_tests
- git clone --depth 1 git@github.com:10gen/QA.git jstests/qa_tests
+ ${add_nodejs_to_path}
+
+ # Run parse-jsfiles on 50 files at a time with 32 processes in parallel.
+ # Grep returns 1 if it fails to find a match.
+ (grep "\.js$" modified_and_created_patch_files.txt || true) | xargs -P 32 -L 50 npm run --prefix jstestfuzz parse-jsfiles --
+ "lint fuzzer sanity all":
- command: shell.exec
+ type: test
params:
- working_dir: src/jstestfuzz
+ working_dir: src
+ shell: bash
script: |
- set -o errexit
+ set -eo pipefail
set -o verbose
- # 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
- else
- export PATH="$PATH:/opt/node/bin"
- fi
+ ${add_nodejs_to_path}
- npm install
+ # Run parse-jsfiles on 50 files at a time with 32 processes in parallel.
+ find "$PWD/jstests" "$PWD/src/mongo/db/modules/enterprise" -name "*.js" -print | xargs -P 32 -L 50 npm run --prefix jstestfuzz parse-jsfiles --
+ "run jstestfuzz":
- command: shell.exec
- type: test
params:
- working_dir: src/jstestfuzz
+ working_dir: src
script: |
set -o errexit
set -o verbose
- # 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
- else
- export PATH="$PATH:/opt/node/bin"
- fi
+ cp mongodb*/bin/mongod .
- echo "jstestfuzz self-tests are starting"
- set +o errexit
- npm test > npm_test-${task_id}.log 2>&1
- if [ $? -ne 0 ]; then
- echo "jstestfuzz self-tests failure"
- branch=$(git symbolic-ref --short HEAD)
- commit=$(git show -s --pretty=format:"%h - %an, %ar: %s")
- echo "Git branch: $branch, commit: $commit"
- which node
- node --version
- which npm
- npm --version
- cat npm_test-${task_id}.log
- exit 1
- fi
- rm -f npm_test-${task_id}.log
+ git clone --depth 1 git@github.com:10gen/mongo-enterprise-modules.git jstests/enterprise_tests
+ git clone --depth 1 git@github.com:10gen/QA.git jstests/qa_tests
+
+ - command: shell.exec
+ params:
+ working_dir: src/jstestfuzz
+ script: |
set -o errexit
- echo "jstestfuzz self-tests finished"
+ set -o verbose
+
+ ${add_nodejs_to_path}
npm run ${npm_command|jstestfuzz} -- ${jstestfuzz_vars}
@@ -2023,6 +2031,18 @@ pre:
fi
fi
echo "python set to $(which $python)"
+ - key: add_nodejs_to_path
+ value: |
+ # 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
+ else
+ export PATH="$PATH:/opt/node/bin"
+ fi
- key: posix_workdir
value: eval 'if [ "Windows_NT" = "$OS" ]; then echo $(cygpath -u "${workdir}"); else echo ${workdir}; fi'
# For ssh disable the options GSSAPIAuthentication, CheckHostIP, StrictHostKeyChecking
@@ -2880,6 +2900,7 @@ tasks:
commands:
- func: "do setup"
- func: "do multiversion setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
npm_command: update-fuzzer
@@ -2895,6 +2916,7 @@ tasks:
commands:
- func: "do setup"
- func: "do multiversion setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
npm_command: update-fuzzer
@@ -2910,6 +2932,7 @@ tasks:
commands:
- func: "do setup"
- func: "do multiversion setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
npm_command: update-fuzzer
@@ -2925,6 +2948,7 @@ tasks:
commands:
- func: "do setup"
- func: "do multiversion setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
npm_command: update-fuzzer
@@ -2939,6 +2963,7 @@ tasks:
name: rollback_fuzzer
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --numGeneratedFiles 15
@@ -2953,6 +2978,7 @@ tasks:
name: rollback_fuzzer_WT
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --numGeneratedFiles 15
@@ -2967,6 +2993,7 @@ tasks:
name: jstestfuzz
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --jsTestsDir ../jstests
@@ -2980,6 +3007,7 @@ tasks:
name: jstestfuzz_WT
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --jsTestsDir ../jstests
@@ -2993,6 +3021,7 @@ tasks:
name: jstestfuzz_concurrent
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --numGeneratedFiles 75 --jsTestsDir ../jstests
@@ -3006,6 +3035,7 @@ tasks:
name: jstestfuzz_concurrent_WT
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --numGeneratedFiles 75 --jsTestsDir ../jstests
@@ -3019,6 +3049,7 @@ tasks:
name: jstestfuzz_concurrent_replication
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --numGeneratedFiles 75 --jsTestsDir ../jstests
@@ -3032,6 +3063,7 @@ tasks:
name: jstestfuzz_concurrent_replication_WT
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --numGeneratedFiles 75 --jsTestsDir ../jstests
@@ -3045,6 +3077,7 @@ tasks:
name: jstestfuzz_concurrent_replication_session
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --numGeneratedFiles 75 --jsTestsDir ../jstests
@@ -3058,6 +3091,7 @@ tasks:
name: jstestfuzz_concurrent_replication_session_WT
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --numGeneratedFiles 75 --jsTestsDir ../jstests
@@ -3071,6 +3105,7 @@ tasks:
name: jstestfuzz_concurrent_sharded
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --numGeneratedFiles 75 --jsTestsDir ../jstests
@@ -3084,6 +3119,7 @@ tasks:
name: jstestfuzz_concurrent_sharded_WT
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --numGeneratedFiles 75 --jsTestsDir ../jstests
@@ -3097,6 +3133,7 @@ tasks:
name: jstestfuzz_concurrent_sharded_causal_consistency
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --numGeneratedFiles 75 --jsTestsDir ../jstests
@@ -3110,6 +3147,7 @@ tasks:
name: jstestfuzz_concurrent_sharded_causal_consistency_WT
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --numGeneratedFiles 75 --jsTestsDir ../jstests
@@ -3123,6 +3161,7 @@ tasks:
name: jstestfuzz_concurrent_sharded_continuous_stepdown
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --numGeneratedFiles 25 --jsTestsDir ../jstests
@@ -3136,6 +3175,7 @@ tasks:
name: jstestfuzz_concurrent_sharded_session
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --numGeneratedFiles 75 --jsTestsDir ../jstests
@@ -3149,6 +3189,7 @@ tasks:
name: jstestfuzz_concurrent_sharded_session_WT
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --numGeneratedFiles 75 --jsTestsDir ../jstests
@@ -3162,6 +3203,7 @@ tasks:
name: jstestfuzz_replication
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --jsTestsDir ../jstests
@@ -3175,6 +3217,7 @@ tasks:
name: jstestfuzz_replication_WT
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --jsTestsDir ../jstests
@@ -3188,6 +3231,7 @@ tasks:
name: jstestfuzz_replication_initsync
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --numGeneratedFiles 75 --jsTestsDir ../jstests
@@ -3201,6 +3245,7 @@ tasks:
name: jstestfuzz_replication_initsync_WT
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --numGeneratedFiles 75 --jsTestsDir ../jstests
@@ -3214,6 +3259,7 @@ tasks:
name: jstestfuzz_replication_resync
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --numGeneratedFiles 75 --jsTestsDir ../jstests
@@ -3227,6 +3273,7 @@ tasks:
name: jstestfuzz_replication_resync_WT
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --numGeneratedFiles 75 --jsTestsDir ../jstests
@@ -3240,6 +3287,7 @@ tasks:
name: jstestfuzz_replication_session
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --jsTestsDir ../jstests
@@ -3253,6 +3301,7 @@ tasks:
name: jstestfuzz_replication_session_WT
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --jsTestsDir ../jstests
@@ -3266,6 +3315,7 @@ tasks:
name: jstestfuzz_sharded
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --jsTestsDir ../jstests
@@ -3279,6 +3329,7 @@ tasks:
name: jstestfuzz_sharded_WT
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --jsTestsDir ../jstests
@@ -3292,6 +3343,7 @@ tasks:
name: jstestfuzz_sharded_causal_consistency
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --jsTestsDir ../jstests
@@ -3305,6 +3357,7 @@ tasks:
name: jstestfuzz_sharded_causal_consistency_WT
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --jsTestsDir ../jstests
@@ -3318,6 +3371,7 @@ tasks:
name: jstestfuzz_sharded_continuous_stepdown
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --numGeneratedFiles 50 --jsTestsDir ../jstests
@@ -3331,6 +3385,7 @@ tasks:
name: jstestfuzz_sharded_session
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --jsTestsDir ../jstests
@@ -3344,6 +3399,7 @@ tasks:
name: jstestfuzz_sharded_session_WT
commands:
- func: "do setup"
+ - func: "setup jstestfuzz"
- func: "run jstestfuzz"
vars:
jstestfuzz_vars: --jsTestsDir ../jstests
@@ -3352,6 +3408,24 @@ tasks:
<<: *jstestfuzz_config_vars
resmoke_args: --suites=jstestfuzz_sharded_session --storageEngine=wiredTiger
+# Check that the mutational fuzzer can parse JS files modified in a patch build.
+- name: lint_fuzzer_sanity_patch
+ patch_only: true
+ commands:
+ - command: manifest.load
+ - func: "git get project"
+ - func: "get added and modified patch files"
+ - func: "setup jstestfuzz"
+ - func: "lint fuzzer sanity patch"
+
+# Check that the mutational fuzzer can parse all JS filess.
+- name: lint_fuzzer_sanity_all
+ commands:
+ - command: manifest.load
+ - func: "git get project"
+ - func: "setup jstestfuzz"
+ - func: "lint fuzzer sanity all"
+
## integration test suites ##
- <<: *task_template
@@ -7433,6 +7507,7 @@ buildvariants:
requires:
- name: burn_in_tests
- name: lint
+ - name: lint_fuzzer_sanity_patch
distros:
- rhel62-large
- name: compile_all
@@ -7442,6 +7517,7 @@ buildvariants:
distros:
- rhel62-large
- name: lint
+ - name: lint_fuzzer_sanity_patch
- name: burn_in_tests
- name: rollback_fuzzer_WT
- name: aggregation_WT
@@ -10193,17 +10269,18 @@ buildvariants:
- ubuntu1604-build
- name: tig-daily-cron
+ modules:
+ - enterprise
display_name: "~ TIG Daily Cron"
run_on:
- - rhel62-large
+ - rhel62-small
batchtime: 1440 # 1 day
stepback: false
tasks:
# Test lifecycle is temporarily disabled to reduce load on Evergreen API.
# - name: update_test_lifecycle
- name: fetch_test_lifecycle
- distros:
- - rhel62-small
+ - name: lint_fuzzer_sanity_all
- name: enterprise-rhel-62-64-bit-mmapv1
display_name: Enterprise RHEL 6.2 MMAPv1