always upload junit results as artifact

refs DE-1221

Change-Id: Ibb51fd81c0ba51a1715ffe5190092549193f879e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/293641
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
This commit is contained in:
Aaron Ogata 2022-06-09 09:23:39 -07:00
parent 79eedc25d6
commit 4410f1cb67
4 changed files with 10 additions and 8 deletions

View File

@ -108,12 +108,14 @@ pipeline {
}
copyArtifacts(
filter: 'tmp/*_rspec_results/**',
filter: 'tmp/*/rspec_results.tgz',
optional: false,
projectName: env.JOB_NAME,
selector: specific(env.BUILD_NUMBER),
)
sh "ls tmp/*/rspec_results.tgz | xargs -n1 tar xvf"
withEnv(['COMPOSE_FILE=docker-compose.new-jenkins.yml']) {
sh """
docker-compose run -v \$(pwd)/\$LOCAL_WORKDIR/tmp/:/tmp \

View File

@ -51,18 +51,20 @@ def redisUrl() {
def generateSkippedSpecsReport() {
try{
copyArtifacts(
filter: 'tmp/*_rspec_results/**',
filter: 'tmp/*/rspec_results.tgz',
optional: false,
projectName: env.JOB_NAME,
selector: specific(env.BUILD_NUMBER),
)
sh "ls tmp/*/rspec_results.tgz | xargs -n1 tar xvf"
withEnv(['COMPOSE_FILE=docker-compose.new-jenkins.yml']) {
withCredentials([usernamePassword(credentialsId: 'INSENG_CANVAS_CI_AWS_ACCESS', usernameVariable: 'INSENG_AWS_ACCESS_KEY_ID', passwordVariable: 'INSENG_AWS_SECRET_ACCESS_KEY')]) {
def awsCreds = "AWS_DEFAULT_REGION=us-west-2 AWS_ACCESS_KEY_ID=${INSENG_AWS_ACCESS_KEY_ID} AWS_SECRET_ACCESS_KEY=${INSENG_AWS_SECRET_ACCESS_KEY}"
sh "$awsCreds aws s3 cp s3://instructure-canvas-ci/skipped_specs_ruby.json skipped_specs.json"
sh """
docker-compose run -v \$(pwd)/\$LOCAL_WORKDIR/tmp/rspec_results/:/tmp/rspec_results \
docker-compose run -v \$(pwd)/\$LOCAL_WORKDIR/tmp/:/tmp \
-v \$(pwd)/\$LOCAL_WORKDIR/skipped_specs.json/:/usr/src/app/skipped_specs.json \
--name skipped-spec-collator canvas bash -c \
"bundle install; ruby build/new-jenkins/skipped_specs_manager.rb ruby"

View File

@ -114,6 +114,8 @@ def tearDownNode() {
docker cp ${srcDir}/log/results ${destDir}_rspec_results/ || true
docker cp ${srcDir}/log/spec_failures ${destDir}/spec_failures/ || true
tar cvfz ${destDir}/rspec_results.tgz ${destDir}_rspec_results/
if [[ "\$COVERAGE" == "1" ]]; then
docker cp ${srcDir}/coverage ${destDir}/coverage/ || true
fi
@ -135,10 +137,6 @@ def tearDownNode() {
archiveArtifacts allowEmptyArchive: true, artifacts: "$destDir/**/*"
if (env.ENABLE_AXE_SELENIUM == '1' || env.COVERAGE == '1') {
archiveArtifacts allowEmptyArchive: true, artifacts: "${destDir}_rspec_results/**/*"
}
findFiles(glob: "$destDir/spec_failures/**/index.html").each { file ->
// tmp/node_18/spec_failures/Initial/spec/selenium/force_failure_spec.rb:20/index
// split on the 5th to give us the rerun category (Initial, Rerun_1, Rerun_2...)

View File

@ -34,7 +34,7 @@ class SkippedSpecsManager
def determine_settings
@path_to_specs = if @mode == "ruby"
"/tmp/rspec_results"
"/tmp/*_rspec_results"
else
"/tmp/js-results"
end