From 73daf4860a75a9714465d1f9736cae97b69b91d8 Mon Sep 17 00:00:00 2001 From: Sergey Petushkov Date: Sun, 20 Jun 2021 11:09:23 +0200 Subject: [PATCH 1/4] fix(mongodb-compass): Do not use postinstall to rebuild dependencies --- packages/compass/package.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/compass/package.json b/packages/compass/package.json index 5abbf46650a..57882e28ca8 100644 --- a/packages/compass/package.json +++ b/packages/compass/package.json @@ -210,8 +210,8 @@ }, "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", "test": "hadron-build test", "test-release-tasks": "cross-env MONGODB_DOWNLOADS_AWS_ACCESS_KEY_ID='' mocha --timeout 30000 release/*.spec.js", @@ -232,8 +232,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", From a5329bc2b7b4683135d8e13e74b0b607d61be39d Mon Sep 17 00:00:00 2001 From: Sergey Petushkov Date: Sun, 20 Jun 2021 11:49:36 +0200 Subject: [PATCH 2/4] ci(github): Use the same check/test commands we use in evegreen for consistency and uhh... finish a sence --- .github/workflows/check-test.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-test.yaml b/.github/workflows/check-test.yaml index 5bc0b5893f5..94d8611ca90 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-evergreen -- --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-evergreen -- --stream --since $MAIN_BRANCH_NAME shell: bash From a7c1dcc1dfb0c3672e074ff18499cdd072b69fc6 Mon Sep 17 00:00:00 2001 From: Sergey Petushkov Date: Sun, 20 Jun 2021 11:50:19 +0200 Subject: [PATCH 3/4] fix(mongodb-compass): Do a rebuild when running test scripts --- packages/compass/package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/compass/package.json b/packages/compass/package.json index 57882e28ca8..6b50cfb2aad 100644 --- a/packages/compass/package.json +++ b/packages/compass/package.json @@ -213,7 +213,9 @@ "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", From 67cd33a5272a800b17816bfe8569e428d264b2e2 Mon Sep 17 00:00:00 2001 From: Sergey Petushkov Date: Mon, 21 Jun 2021 10:23:25 +0200 Subject: [PATCH 4/4] chore: Rename {test,check}-evergreen to {test,check}-ci --- .evergreen.yml | 4 ++-- .github/workflows/check-test.yaml | 4 ++-- package.json | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) 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 94d8611ca90..dd67dfb73c5 100644 --- a/.github/workflows/check-test.yaml +++ b/.github/workflows/check-test.yaml @@ -59,9 +59,9 @@ jobs: # We exclude dependents when running eslint and depchecks because # linting and dependency checking is relevant only for packages where # the source code was changed - run: npm run check-evergreen -- --stream --since $MAIN_BRANCH_NAME --exclude-dependents + run: npm run check-ci -- --stream --since $MAIN_BRANCH_NAME --exclude-dependents shell: bash - name: Run Tests - run: npm run test-evergreen -- --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",