Revert "rspecq/rspec separate build"
This reverts commit 276eb49f8e
.
Reason for revert: Something in here is failing deploys
Change-Id: I615a90e6a4edf743ba47a2673bc14483ad141b3d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/282032
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
Tested-by: James Butters <jbutters@instructure.com>
This commit is contained in:
parent
e80e86e123
commit
7dd287adea
|
@ -552,13 +552,7 @@ pipeline {
|
|||
string(name: 'POSTGRES_IMAGE_TAG', value: "${env.POSTGRES_IMAGE_TAG}"),
|
||||
])
|
||||
|
||||
extendedStage('RspecQ Tests')
|
||||
.hooks(buildSummaryReportHooks.withRunManifest())
|
||||
.queue(nestedStages, jobName: '/Canvas/test-suites/test-queue', buildParameters: buildParameters + [
|
||||
string(name: 'CASSANDRA_IMAGE_TAG', value: "${env.CASSANDRA_IMAGE_TAG}"),
|
||||
string(name: 'DYNAMODB_IMAGE_TAG', value: "${env.DYNAMODB_IMAGE_TAG}"),
|
||||
string(name: 'POSTGRES_IMAGE_TAG', value: "${env.POSTGRES_IMAGE_TAG}"),
|
||||
])
|
||||
rspecStage.createDistribution(nestedStages)
|
||||
|
||||
parallel(nestedStages)
|
||||
}
|
||||
|
|
|
@ -1,185 +0,0 @@
|
|||
#!/usr/bin/env groovy
|
||||
|
||||
/*
|
||||
* Copyright (C) 2022 - present Instructure, Inc.
|
||||
*
|
||||
* This file is part of Canvas.
|
||||
*
|
||||
* Canvas is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License as published by the Free
|
||||
* Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
library "canvas-builds-library@${env.CANVAS_BUILDS_REFSPEC}"
|
||||
loadLocalLibrary('local-lib', 'build/new-jenkins/library')
|
||||
|
||||
@groovy.transform.Field
|
||||
def rspecqNodeTotal = 23
|
||||
@groovy.transform.Field
|
||||
def rspecNodeTotal = 27
|
||||
|
||||
def setupNode() {
|
||||
sh 'rm -vrf ./tmp'
|
||||
|
||||
checkout scm
|
||||
|
||||
distribution.stashBuildScripts()
|
||||
|
||||
credentials.withStarlordCredentials { ->
|
||||
sh(script: 'build/new-jenkins/docker-compose-pull.sh', label: 'Pull Images')
|
||||
}
|
||||
|
||||
sh(script: 'build/new-jenkins/docker-compose-build-up.sh', label: 'Start Containers')
|
||||
}
|
||||
|
||||
def redisUrl() {
|
||||
return "redis://${TEST_QUEUE_HOST}:6379"
|
||||
}
|
||||
|
||||
pipeline {
|
||||
agent none
|
||||
options {
|
||||
ansiColor('xterm')
|
||||
timeout(60)
|
||||
timestamps()
|
||||
}
|
||||
|
||||
environment {
|
||||
COMPOSE_FILE = 'docker-compose.new-jenkins.yml:docker-compose.new-jenkins-selenium.yml'
|
||||
FORCE_FAILURE = "${configuration.isForceFailureSelenium() ? '1' : ''}"
|
||||
RERUNS_RETRY = "${configuration.getInteger('rspecq-max-requeues')}"
|
||||
RSPEC_PROCESSES = "${configuration.getInteger('rspecq-processes')}"
|
||||
RSPECQ_FILE_SPLIT_THRESHOLD = "${configuration.fileSplitThreshold()}"
|
||||
RSPECQ_MAX_REQUEUES = "${configuration.getInteger('rspecq-max-requeues')}"
|
||||
SELENIUM_TEST_PATTERN = '^./(spec|gems/plugins/.*/spec_canvas)/selenium'
|
||||
TEST_PATTERN = '^./(spec|gems/plugins/.*/spec_canvas)/'
|
||||
EXCLUDE_TESTS = '.*/(selenium|contracts)'
|
||||
RSPECQ_UPDATE_TIMINGS = "${env.GERRIT_EVENT_TYPE == 'change-merged' ? '1' : '0'}"
|
||||
ENABLE_AXE_SELENIUM = "${env.ENABLE_AXE_SELENIUM}"
|
||||
POSTGRES_PASSWORD = 'sekret'
|
||||
SELENIUM_VERSION = '3.141.59-20210929'
|
||||
RSPECQ_REDIS_URL = redisUrl()
|
||||
CANVAS_ZEITWERK = '1'
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Environment') {
|
||||
steps {
|
||||
script {
|
||||
def rspecNodeRequirements = [label: 'canvas-docker']
|
||||
|
||||
def postBuildHandler = [
|
||||
onStageEnded: { stageName, stageConfig, result ->
|
||||
node('master') {
|
||||
buildSummaryReport.saveRunManifest()
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
def postStageHandler = [
|
||||
onStageEnded: { stageName, stageConfig, result ->
|
||||
buildSummaryReport.setStageTimings(stageName, stageConfig.timingValues())
|
||||
}
|
||||
]
|
||||
|
||||
extendedStage('Runner').hooks(postBuildHandler).obeysAllowStages(false).execute {
|
||||
extendedStage('Builder').obeysAllowStages(false).nodeRequirements(rspecNodeRequirements).execute {
|
||||
stage('Setup') {
|
||||
setupNode()
|
||||
}
|
||||
|
||||
extendedStage('Parallel Run Tests').obeysAllowStages(false).execute { stageConfig, buildConfig ->
|
||||
def rspecqStages = [:]
|
||||
|
||||
extendedStage('RSpecQ Reporter for Rspec').timeout(30).queue(rspecqStages) {
|
||||
try {
|
||||
sh(script: "docker run -e SENTRY_DSN -e RSPECQ_REDIS_URL -t $PATCHSET_TAG bundle exec rspecq \
|
||||
--build=${JOB_NAME}_build${BUILD_NUMBER}_rspec \
|
||||
--queue-wait-timeout 240 \
|
||||
--redis-url $RSPECQ_REDIS_URL \
|
||||
--report", label: 'Reporter')
|
||||
} catch (org.jenkinsci.plugins.workflow.steps.FlowInterruptedException e) {
|
||||
if (e.causes[0] instanceof org.jenkinsci.plugins.workflow.steps.TimeoutStepExecution.ExceededTimeout) {
|
||||
/* groovylint-disable-next-line GStringExpressionWithinString, SpaceInsideParentheses */
|
||||
sh '''#!/bin/bash
|
||||
ids=( $(docker ps -aq --filter "name=canvas_") )
|
||||
for i in "${ids[@]}"
|
||||
do
|
||||
docker exec $i bash -c "cat /usr/src/app/log/cmd_output/*.log"
|
||||
done
|
||||
'''
|
||||
}
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
extendedStage('RSpecQ Reporter for Selenium').timeout(30).queue(rspecqStages) {
|
||||
try {
|
||||
sh(script: "docker run -e SENTRY_DSN -e RSPECQ_REDIS_URL -t $PATCHSET_TAG bundle exec rspecq \
|
||||
--build=${JOB_NAME}_build${BUILD_NUMBER}_selenium \
|
||||
--queue-wait-timeout 120 \
|
||||
--redis-url $RSPECQ_REDIS_URL \
|
||||
--report", label: 'Reporter')
|
||||
} catch (org.jenkinsci.plugins.workflow.steps.FlowInterruptedException e) {
|
||||
if (e.causes[0] instanceof org.jenkinsci.plugins.workflow.steps.TimeoutStepExecution.ExceededTimeout) {
|
||||
/* groovylint-disable-next-line GStringExpressionWithinString, SpaceInsideParentheses */
|
||||
sh '''#!/bin/bash
|
||||
ids=( $(docker ps -aq --filter "name=canvas_") )
|
||||
for i in "${ids[@]}"
|
||||
do
|
||||
docker exec $i bash -c "cat /usr/src/app/log/cmd_output/*.log"
|
||||
done
|
||||
'''
|
||||
}
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
extendedStage('RSpecQ Selenium Set 00')
|
||||
.envVars(['CI_NODE_INDEX=0',
|
||||
"BUILD_NAME=${env.JOB_NAME}_build${env.BUILD_NUMBER}_selenium",
|
||||
"TEST_PATTERN=${env.SELENIUM_TEST_PATTERN}",
|
||||
'EXCLUDE_TESTS=.*/(selenium/performance|instfs/selenium|contracts)'])
|
||||
.hooks(postStageHandler + [onNodeAcquired: { rspecStage.setupNode() }, onNodeReleasing: { rspecStage.tearDownNode('selenium') }])
|
||||
.timeout(30)
|
||||
.queue(rspecqStages) { rspecStage.runRspecqSuite() }
|
||||
|
||||
for (int i = 1; i < rspecqNodeTotal; i++) {
|
||||
def index = i
|
||||
extendedStage("RSpecQ Selenium Set ${(index).toString().padLeft(2, '0')}")
|
||||
.envVars(["CI_NODE_INDEX=$index",
|
||||
"BUILD_NAME=${env.JOB_NAME}_build${env.BUILD_NUMBER}_selenium",
|
||||
"TEST_PATTERN=${env.SELENIUM_TEST_PATTERN}",
|
||||
'EXCLUDE_TESTS=.*/(selenium/performance|instfs/selenium|contracts)'])
|
||||
.hooks(postStageHandler + [onNodeAcquired: { rspecStage.setupNode() }, onNodeReleasing: { rspecStage.tearDownNode('selenium') }])
|
||||
.nodeRequirements(rspecNodeRequirements)
|
||||
.timeout(30)
|
||||
.queue(rspecqStages) { rspecStage.runRspecqSuite() }
|
||||
}
|
||||
|
||||
rspecNodeTotal.times { index ->
|
||||
extendedStage("RSpecQ Rspec Set ${(index + 1).toString().padLeft(2, '0')}")
|
||||
.envVars(["CI_NODE_INDEX=$index", "BUILD_NAME=${env.JOB_NAME}_build${env.BUILD_NUMBER}_rspec"])
|
||||
.hooks(postStageHandler + [onNodeAcquired: { rspecStage.setupNode() }, onNodeReleasing: { rspecStage.tearDownNode('rspec') }])
|
||||
.nodeRequirements(rspecNodeRequirements)
|
||||
.timeout(30)
|
||||
.queue(rspecqStages) { rspecStage.runRspecqSuite() }
|
||||
}
|
||||
|
||||
parallel(rspecqStages)
|
||||
} //rspecQ
|
||||
} //builder
|
||||
} //runner
|
||||
} //script
|
||||
} //steps
|
||||
} //environment
|
||||
} //stages
|
||||
} //pipeline
|
|
@ -29,21 +29,3 @@ def call() {
|
|||
}
|
||||
]
|
||||
}
|
||||
|
||||
def withRunManifest() {
|
||||
return [
|
||||
onStageEnded: { stageName, stageConfig, buildResult ->
|
||||
if (buildResult) {
|
||||
buildSummaryReport.addFailureRun(stageName, buildResult)
|
||||
|
||||
node('master') {
|
||||
buildSummaryReport.loadRunManifest(buildResult)
|
||||
}
|
||||
|
||||
buildSummaryReport.setStageIgnored(stageName)
|
||||
}
|
||||
|
||||
buildSummaryReport.setStageTimings(stageName, stageConfig.timingValues())
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -153,7 +153,7 @@ def tearDownNode(prefix) {
|
|||
def finalCategory = reruns_retry.toInteger() == 0 ? 'Initial' : "Rerun_${reruns_retry.toInteger()}"
|
||||
def splitPath = file.getPath().split('/').toList()
|
||||
def specTitle = splitPath.subList(6, splitPath.size() - 1).join('/')
|
||||
def artifactsPath = "${currentBuild.getAbsoluteUrl()}artifact/${file.getPath()}"
|
||||
def artifactsPath = "../artifact/${file.getPath()}"
|
||||
|
||||
buildSummaryReport.addFailurePath(specTitle, artifactsPath, pathCategory)
|
||||
|
||||
|
@ -186,7 +186,6 @@ def runRspecqSuite() {
|
|||
-e RSPECQ_UPDATE_TIMINGS \
|
||||
-e JOB_NAME \
|
||||
-e COVERAGE \
|
||||
-e BUILD_NAME \
|
||||
-e BUILD_NUMBER canvas bash -c \'build/new-jenkins/rspecq-tests.sh\'', label: 'Run RspecQ Tests')
|
||||
} catch (org.jenkinsci.plugins.workflow.steps.FlowInterruptedException e) {
|
||||
if (e.causes[0] instanceof org.jenkinsci.plugins.workflow.steps.TimeoutStepExecution.ExceededTimeout) {
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
set -o nounset -o errexit -o errtrace -o pipefail -o xtrace
|
||||
|
||||
PROCESSES=$((${RSPEC_PROCESSES:=1}-1))
|
||||
BUILD_NAME="${BUILD_NAME:=${JOB_NAME}_build${BUILD_NUMBER}}"
|
||||
COVERAGE=${COVERAGE:-0}
|
||||
|
||||
for i in $(seq 0 $PROCESSES); do
|
||||
WORKER_NAME="${JOB_NAME}_worker${CI_NODE_INDEX}-${i}"
|
||||
|
||||
commands+=("COVERAGE=${COVERAGE:-0} PARALLEL_INDEX=${i} RAILS_DB_NAME_TEST=canvas_test_${i} bundle exec rspecq \
|
||||
--build ${BUILD_NAME} \
|
||||
commands+=("COVERAGE=${COVERAGE} PARALLEL_INDEX=${i} RAILS_DB_NAME_TEST=canvas_test_${i} bundle exec rspecq \
|
||||
--build ${JOB_NAME}_build${BUILD_NUMBER} \
|
||||
--worker ${WORKER_NAME} \
|
||||
--include-pattern '${TEST_PATTERN}' \
|
||||
--exclude-pattern '${EXCLUDE_TESTS}' \
|
||||
|
|
|
@ -289,9 +289,7 @@ module CanvasRails
|
|||
config.exceptions_app = ExceptionsApp.new
|
||||
|
||||
config.before_initialize do
|
||||
config.action_controller.asset_host = lambda do |source, *_|
|
||||
::Canvas::Cdn.asset_host_for(source)
|
||||
end
|
||||
config.action_controller.asset_host = Canvas::Cdn.method(:asset_host_for)
|
||||
end
|
||||
|
||||
if config.action_dispatch.rack_cache != false
|
||||
|
|
|
@ -96,6 +96,11 @@ module I18n
|
|||
end
|
||||
# rubocop:enable Style/OptionalBooleanParameter
|
||||
|
||||
I18n.backend = LazyPresumptuousI18nBackend.new(
|
||||
meta_keys: %w[aliases crowdsourced custom locales],
|
||||
logger: Rails.logger.method(:debug)
|
||||
)
|
||||
|
||||
module DontTrustI18nPluralizations
|
||||
def pluralize(locale, entry, count)
|
||||
super
|
||||
|
@ -104,14 +109,7 @@ module DontTrustI18nPluralizations
|
|||
""
|
||||
end
|
||||
end
|
||||
|
||||
Rails.configuration.to_prepare do
|
||||
I18n.backend = LazyPresumptuousI18nBackend.new(
|
||||
meta_keys: %w[aliases crowdsourced custom locales],
|
||||
logger: Rails.logger.method(:debug)
|
||||
)
|
||||
LazyPresumptuousI18nBackend.prepend(DontTrustI18nPluralizations)
|
||||
end
|
||||
|
||||
module FormatInterpolatedNumbers
|
||||
def interpolate_hash(string, values)
|
||||
|
|
|
@ -21,9 +21,6 @@ module RespondusSoapEndpoint
|
|||
class Railtie < ::Rails::Engine
|
||||
initializer "respondus_soap_endpoint.canvas_plugin" do
|
||||
require "respondus_soap_endpoint/plugin_validator"
|
||||
end
|
||||
|
||||
config.to_prepare do
|
||||
Canvas::Plugin.register :respondus_soap_endpoint, nil, {
|
||||
name: -> { t :name, "Respondus SOAP Endpoint" },
|
||||
author: "instructure",
|
||||
|
|
Loading…
Reference in New Issue