From db836c338252ca3e23e63c8974cef5b27dca5791 Mon Sep 17 00:00:00 2001 From: Aaron Ogata Date: Tue, 21 Jun 2022 07:53:16 -0700 Subject: [PATCH] parallelize canvas-rce tests on Jenkins Change-Id: Ib76fae85e01d006df8ba96350bdc65e0808fc769 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/294389 Tested-by: Service Cloud Jenkins Reviewed-by: James Butters QA-Review: Aaron Ogata Product-Review: Aaron Ogata --- build/new-jenkins/library/vars/jsStage.groovy | 2 +- packages/canvas-rce/package.json | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/build/new-jenkins/library/vars/jsStage.groovy b/build/new-jenkins/library/vars/jsStage.groovy index 33629475b6d..f2b6fbec3d4 100644 --- a/build/new-jenkins/library/vars/jsStage.groovy +++ b/build/new-jenkins/library/vars/jsStage.groovy @@ -145,7 +145,7 @@ def queueKarmaDistribution() { def queuePackagesDistribution() { { stages -> - callableWithDelegate(queueTestStage())(stages, 'packages', [], 'TEST_RESULT_OUTPUT_DIR=/usr/src/app/$TEST_RESULT_OUTPUT_DIR yarn test:packages:parallel') + callableWithDelegate(queueTestStage())(stages, 'packages', ["CANVAS_RCE_PARALLEL=1"], 'TEST_RESULT_OUTPUT_DIR=/usr/src/app/$TEST_RESULT_OUTPUT_DIR yarn test:packages:parallel') } } diff --git a/packages/canvas-rce/package.json b/packages/canvas-rce/package.json index abbd08edf5f..7f08cd76034 100644 --- a/packages/canvas-rce/package.json +++ b/packages/canvas-rce/package.json @@ -10,7 +10,9 @@ "lint": "eslint \"src/**/*.js\" \"test/**/*.js\"", "lint:fix": "eslint --fix \"src/**/*.js\" \"test/**/*.js\"", "_test": "Test cafe will be added back to test as part of CORE-2995", - "test": "yarn test:mocha && yarn test:jest && yarn test:cafe", + "test": "if [ \"$CANVAS_RCE_PARALLEL\" = \"1\" ]; then yarn test:parallel; else yarn test:serial; fi", + "test:parallel": "concurrently --names \"yarn test:mocha\" \"yarn test:jest\" \"yarn test:cafe\"", + "test:serial": "yarn test:mocha && yarn test:jest && yarn test:cafe", "test:mocha": "mocha 'test/**/*.test.js' --timeout 5000 --reporter mocha-multi-reporters --reporter-options configFile=mocha-reporter-config.js", "test:mocha:one": "mocha --timeout 5000 --reporter mocha-multi-reporters --reporter-options configFile=mocha-reporter-config.js", "test:mocha:debug": "mocha --inspect-brk --timeout 5000 --reporter mocha-multi-reporters --reporter-options configFile=mocha-reporter-config.js", @@ -118,6 +120,7 @@ "axios": "^0.21.1", "bloody-offset": "0.0.0", "classnames": "^2.2.5", + "concurrently": "^4", "format-message": "^6", "format-message-generate-id": "^6", "i18n-js": "^3",