From 684d6412de2561b33d66b6fd67baf3091c2f9b03 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Mon, 26 Aug 2024 13:22:09 -0400 Subject: [PATCH] Use default concurrency value for lerna run The default concurrency value for leran run is the number of logical CPU cores. This is better than arbitrarily using 4 threads, since different machines may be able to handle more. --- .github/workflows/test-all.yml | 6 +++--- package.json | 4 ++-- scripts/ci-test/test_changed.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 002b76d0299..eda081d1df7 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -92,7 +92,7 @@ jobs: - name: Run unit tests # Ignore auth and firestore since they're handled in their own separate jobs. run: | - xvfb-run yarn lerna run --ignore '{firebase-messaging-integration-test,@firebase/auth*,@firebase/firestore*,firebase-firestore-integration-test}' --concurrency 4 test:ci + xvfb-run yarn lerna run --ignore '{firebase-messaging-integration-test,@firebase/auth*,@firebase/firestore*,firebase-firestore-integration-test}' test:ci node scripts/print_test_logs.js env: FIREBASE_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }} @@ -142,7 +142,7 @@ jobs: run: echo "FIREBASE_CI_TEST_START_TIME=$(date +%s)" >> $GITHUB_ENV - name: Run unit tests run: | - xvfb-run yarn lerna run --concurrency 4 test:ci --scope '@firebase/auth*' + xvfb-run yarn lerna run test:ci --scope '@firebase/auth*' node scripts/print_test_logs.js env: FIREBASE_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }} @@ -182,7 +182,7 @@ jobs: run: echo "FIREBASE_CI_TEST_START_TIME=$(date +%s)" >> $GITHUB_ENV - name: Run unit tests run: | - xvfb-run yarn lerna run --concurrency 4 test:ci --scope '@firebase/firestore*' + xvfb-run yarn lerna run test:ci --scope '@firebase/firestore*' node scripts/print_test_logs.js env: FIREBASE_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }} diff --git a/package.json b/package.json index 32d8e78eeb9..7c65287bb20 100644 --- a/package.json +++ b/package.json @@ -30,8 +30,8 @@ "repl": "node tools/repl.js", "release": "ts-node-script scripts/release/cli.ts", "pretest": "node tools/pretest.js", - "test": "lerna run --ignore firebase-messaging-integration-test --concurrency 4 --stream test", - "test:ci": "lerna run --ignore firebase-messaging-integration-test --concurrency 4 test:ci", + "test": "lerna run --ignore firebase-messaging-integration-test --stream test", + "test:ci": "lerna run --ignore firebase-messaging-integration-test test:ci", "pretest:coverage": "mkdirp coverage", "ci:coverage": "lcov-result-merger 'packages/**/lcov.info' 'lcov-all.info'", "test:coverage": "lcov-result-merger 'packages/**/lcov.info' | coveralls", diff --git a/scripts/ci-test/test_changed.ts b/scripts/ci-test/test_changed.ts index ed60cdc8e4a..6fa24f712d2 100644 --- a/scripts/ci-test/test_changed.ts +++ b/scripts/ci-test/test_changed.ts @@ -59,7 +59,7 @@ async function runTests(config: TestConfig) { process.exit(0); } - const lernaCmd = ['lerna', 'run', '--concurrency', '4']; + const lernaCmd = ['lerna', 'run']; console.log(chalk`{blue Running tests in:}`); for (const task of testTasks) { if (task.reason === TestReason.Changed) {