diff --git a/.evergreen.yml b/.evergreen.yml index 39a3aecfaa7..2cc2a50dd34 100644 --- a/.evergreen.yml +++ b/.evergreen.yml @@ -139,7 +139,7 @@ functions: source ~/compass_env.sh echo "Run static analysis..." - npm run check-evergreen + npm run check-ci test: - command: shell.exec @@ -162,7 +162,7 @@ functions: # debug option is not very useful in normal runs, but helpful when # debugging any issues with tests. Set to "mocha*", "hadron*", or # "mongo*" for some helpful output from the test tooling we are using - DEBUG=${debug} MONGODB_VERSION=${mongodb_version|4.0.3} npm run test-evergreen --unsafe-perm -- --stream + DEBUG=${debug} MONGODB_VERSION=${mongodb_version|4.0.3} npm run test-ci --unsafe-perm -- --stream 'package': - command: shell.exec diff --git a/.github/workflows/check-test.yaml b/.github/workflows/check-test.yaml index 5bc0b5893f5..dd67dfb73c5 100644 --- a/.github/workflows/check-test.yaml +++ b/.github/workflows/check-test.yaml @@ -57,10 +57,11 @@ jobs: - name: Run Checks # We exclude dependents when running eslint and depchecks because - # linting and dependency checking is relevant only for - run: npm run check -- --stream --since $MAIN_BRANCH_NAME --exclude-dependents + # linting and dependency checking is relevant only for packages where + # the source code was changed + run: npm run check-ci -- --stream --since $MAIN_BRANCH_NAME --exclude-dependents shell: bash - name: Run Tests - run: npm run test -- --stream --since $MAIN_BRANCH_NAME + run: npm run test-ci -- --stream --since $MAIN_BRANCH_NAME shell: bash diff --git a/package.json b/package.json index f82a2cda1d1..472f447dfdd 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "precheck": "depcheck", "check": "lerna run check --stream", "check-changed": "npm run check -- --since HEAD --exclude-dependents", - "check-evergreen": "lerna run check", + "check-ci": "lerna run check", "bootstrap": "npm install && lerna run prepare --stream", "bootstrap-evergreen": "npm ci && lerna run prepare", "start": "npm run start --workspace=mongodb-compass", @@ -25,7 +25,7 @@ "release": "npm run release --workspace mongodb-compass --", "release-evergreen": "npm run release-evergreen --workspace=mongodb-compass --", "test": "lerna run test --concurrency 1 --stream", - "test-evergreen": "lerna run test-ci --concurrency 1", + "test-ci": "lerna run test-ci --concurrency 1", "update-akzidenz-cache": "node scripts/download-akzidenz.js --update-cache", "download-akzidenz": "lerna exec -- node ../../scripts/download-akzidenz.js", "update-authors": "node scripts/generate-authors.js", diff --git a/packages/compass/package.json b/packages/compass/package.json index 5abbf46650a..6b50cfb2aad 100644 --- a/packages/compass/package.json +++ b/packages/compass/package.json @@ -210,10 +210,12 @@ }, "scripts": { "install": "node scripts/download-akzidenz.js", - "postinstall": "electron-rebuild --force --only kerberos,keytar,interruptor", - "prestart": "rm -rf .compiled-sources", + "electron-rebuild": "electron-rebuild --force --only kerberos,keytar,interruptor", + "prestart": "rm -rf .compiled-sources && npm run electron-rebuild", "start": "hadron-build develop", + "pretest": "npm run electron-rebuild", "test": "hadron-build test", + "posttest": "node ../../scripts/killall-mongo.js && node ../../scripts/rebuild.js kerberos keytar interruptor", "test-release-tasks": "cross-env MONGODB_DOWNLOADS_AWS_ACCESS_KEY_ID='' mocha --timeout 30000 release/*.spec.js", "check": "npm run lint && npm run depcheck", "clean": "hadron-build clean", @@ -232,8 +234,9 @@ "jsx": "babel ./src --out-dir ./lib", "lint": "eslint \"./src/**/*.{js,jsx}\" \"./test/**/*.js\"", "depcheck": "depcheck", + "pretest-ci": "npm run electron-rebuild", "test-ci": "xvfb-maybe electron-mocha --no-sandbox ./test/**/*.test.js", - "posttest-ci": "node ../../scripts/killall-mongo.js" + "posttest-ci": "node ../../scripts/killall-mongo.js && node ../../scripts/rebuild.js kerberos keytar interruptor" }, "repository": { "type": "git",