From 72754363564272e5faf6e2192e9871a9b99f6cf4 Mon Sep 17 00:00:00 2001 From: dschom Date: Wed, 12 Feb 2025 08:57:15 -0800 Subject: [PATCH] task(ci): Make runs consistent Because: - We track metrics on number of tests, failures, skips, etc... - Using `nx affected` resulted in different numbers of tests being run, which skewed metrics. This Commit: - Runs all test suites, not just affected, suites for test_and_deploy, and nightly - Improves parallelization. - Removes extra build in unit-test job. Note, not sure why unit test job had a build a step. It was probably a necessary hack at some point. Let's see if we can remove this. --- .circleci/config.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2af9f106f29..726aa6f0493 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -292,6 +292,7 @@ commands: parameters: nx_run: type: string + default: run-many steps: - run: name: Linting @@ -301,6 +302,7 @@ commands: parameters: nx_run: type: string + default: run-many steps: - run: name: Pre building shared libraries @@ -564,7 +566,7 @@ jobs: parameters: nx_run: type: string - default: affected --base=main --head=$CIRCLE_SHA1 + default: run-many executor: default-executor resource_class: small steps: @@ -577,7 +579,7 @@ jobs: parameters: nx_run: type: string - default: affected --base=main --head=$CIRCLE_SHA1 + default: run-many executor: default-executor resource_class: large steps: @@ -591,7 +593,7 @@ jobs: parameters: nx_run: type: string - default: affected --base=main --head=$CIRCLE_SHA1 + default: run-many executor: default-executor resource_class: medium+ steps: @@ -602,7 +604,7 @@ jobs: command: NODE_OPTIONS="--max-old-space-size=7168" npx nx run-many -t build --projects=tag:scope:shared:lib --parallel=2 - run: name: Run unit tests - command: npx nx << parameters.nx_run >> --parallel=2 -t test-unit + command: NODE_OPTIONS="--max-old-space-size=7168" npx nx << parameters.nx_run >> --parallel=2 -t test-unit environment: NODE_ENV: test - store-artifacts @@ -766,18 +768,21 @@ workflows: - Init (PR) - lint: name: Lint (PR) + nx_run: affected --base=main --head=$CIRCLE_SHA1 requires: - Init (PR) post-steps: - fail-fast - compile: name: Compile (PR) + nx_run: affected --base=main --head=$CIRCLE_SHA1 requires: - Init (PR) post-steps: - fail-fast - unit-test: name: Unit Test (PR) + nx_run: affected --base=main --head=$CIRCLE_SHA1 requires: - Build (PR) post-steps: @@ -1080,17 +1085,14 @@ workflows: - Init (nightly) - lint: name: Lint (nightly) - nx_run: 'run-many' requires: - Init (nightly) - compile: name: Compile (nightly) - nx_run: 'run-many' requires: - Init (nightly) - unit-test: name: Unit Test (nightly) - nx_run: 'run-many' requires: - Build (nightly) - integration-test: