From 433bbef122398a57d316cb5d0c070fbcc8f124cc Mon Sep 17 00:00:00 2001 From: Aaron Ogata Date: Wed, 1 Jun 2022 11:01:03 -0700 Subject: [PATCH] split packages into own node refs DE-1215 Change-Id: I601bf51238c69e8eaa7e74a093ffcebec77e411e Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/293024 QA-Review: Aaron Ogata Product-Review: Aaron Ogata Product-Review: Ryan Norton Tested-by: Service Cloud Jenkins Reviewed-by: Ryan Norton --- Jenkinsfile.js | 8 ++++++++ build/new-jenkins/library/vars/jsStage.groovy | 17 ++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile.js b/Jenkinsfile.js index b14a2990d38..f1255aae18c 100644 --- a/Jenkinsfile.js +++ b/Jenkinsfile.js @@ -86,6 +86,14 @@ pipeline { parallel(tests) } + extendedStage('Runner - Packages').hooks(postStageHandler).nodeRequirements(label: 'canvas-docker', podTemplate: jsStage.packagesNodeRequirementsTemplate()).obeysAllowStages(false).timeout(10).queue(runnerStages) { + def tests = [:] + + callableWithDelegate(jsStage.queuePackagesDistribution())(tests) + + parallel(tests) + } + parallel(runnerStages) } } diff --git a/build/new-jenkins/library/vars/jsStage.groovy b/build/new-jenkins/library/vars/jsStage.groovy index 793151c01c2..315aaf9141c 100644 --- a/build/new-jenkins/library/vars/jsStage.groovy +++ b/build/new-jenkins/library/vars/jsStage.groovy @@ -53,13 +53,24 @@ def karmaNodeRequirementsTemplate() { def karmaContainers = [] karmaContainers = karmaContainers + (0..JSG_NODE_COUNT).collect { index -> baseTestContainer + [name: "jsg${index}"] } - karmaContainers = karmaContainers + ['jsa', 'jsh', 'packages'].collect { group -> baseTestContainer + [name: group] } + karmaContainers = karmaContainers + ['jsa', 'jsh'].collect { group -> baseTestContainer + [name: group] } return [ containers: karmaContainers, ] } +def packagesNodeRequirementsTemplate() { + def baseTestContainer = [ + image: env.KARMA_RUNNER_IMAGE, + command: 'cat' + ] + + return [ + containers: [baseTestContainer + [name: "packages"]], + ] +} + def tearDownNode() { return { copyToWorkspace srcBaseDir: '/usr/src/app', path: env.TEST_RESULT_OUTPUT_DIR @@ -129,7 +140,11 @@ def queueKarmaDistribution() { ['jsa', 'jsh'].each { group -> callableWithDelegate(queueTestStage())(stages, "${group}", ["JSPEC_GROUP=${group}"], 'yarn test:karma:headless') } + } +} +def queuePackagesDistribution() { + { stages -> callableWithDelegate(queueTestStage())(stages, 'packages', [], 'TEST_RESULT_OUTPUT_DIR=/usr/src/app/$TEST_RESULT_OUTPUT_DIR yarn test:packages') } }