Skip to content

Commit

Permalink
remove redundant node clean-up code
Browse files Browse the repository at this point in the history
refs DE-338

The protectedNode() function now handles automatic cleanup before / after a node is used, so much of the code here can be removed.

Test Plan:
1. Main build passes, FSC passes

[canvas-builds-refspec=81cc926fe89d6efd9f604d0c573630318fb4eb86]

Change-Id: Ie21d242aabe9826353f05149abb304a85223cebc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/263149
Tested-by: Service Cloud Jenkins <[email protected]>
Reviewed-by: Kyle Rosenbaum <[email protected]>
QA-Review: Aaron Ogata <[email protected]>
Product-Review: Aaron Ogata <[email protected]>
  • Loading branch information
aogata-inst committed Apr 19, 2021
1 parent 9bf1b46 commit b7b9d8c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 42 deletions.
10 changes: 3 additions & 7 deletions Jenkinsfile.contract-tests
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,10 @@
library "canvas-builds-library@${env.CANVAS_BUILDS_REFSPEC}"

def cleanupFn(status) {
try {
junit "tmp/spec_results/**/*.xml"
junit "tmp/spec_results/**/*.xml"

if(status == 'SUCCESS' && configuration.isChangeMerged()) {
sh 'build/new-jenkins/pact/contracts-publish-api.sh'
}
} finally {
sh 'rm -vrf tmp/spec_results'
if(status == 'SUCCESS' && configuration.isChangeMerged()) {
sh 'build/new-jenkins/pact/contracts-publish-api.sh'
}
}

Expand Down
1 change: 0 additions & 1 deletion Jenkinsfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def cleanupFn() {
if(env.TEST_SUITE != 'upload') {
archiveArtifacts artifacts: 'tmp/**/*.xml'
junit "tmp/**/*.xml"
sh 'find ./tmp -path "*.xml"'
}
}
}
Expand Down
17 changes: 4 additions & 13 deletions Jenkinsfile.selenium.flakey_spec_catcher
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,8 @@ def sendSlack(success) {
}

def cleanupFn(status) {
try {
if(fsc_status != 'aborted') {
sendSlack(status == 'SUCCESS')
}
} finally {
sh 'rm -vrf ./tmp/'
if(fsc_status != 'aborted') {
sendSlack(status == 'SUCCESS')
}
}

Expand Down Expand Up @@ -267,13 +263,8 @@ pipeline {
"FSC_TESTS=${partitions[index].join(',')}",
"NODE_NUMBER=$node_number"
]) {
try {
setupNode()
executeFlakeySpecCatcher("node$node_number")
}
finally {
sh 'rm -vrf ./tmp'
}
setupNode()
executeFlakeySpecCatcher("node$node_number")
}
}
}
Expand Down
32 changes: 14 additions & 18 deletions Jenkinsfile.vendored-gems
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,23 @@
library "canvas-builds-library@${env.CANVAS_BUILDS_REFSPEC}"

def cleanupFn() {
try {
def htmlFiles
def htmlFiles

sh 'docker cp $(docker ps -f "ancestor"="$PATCHSET_TAG" -q):/usr/src/app/tmp/spec_results/. ./spec_results/'
sh 'docker cp $(docker ps -f "ancestor"="$PATCHSET_TAG" -q):/usr/src/app/tmp/spec_results/. ./spec_results/'

dir ('spec_results') {
sh 'mv report.html canvas_i18nliner_results.html'
htmlFiles = findFiles glob: '*results.html'
}

publishHTML target: [
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: "spec_results",
reportFiles: htmlFiles.join(','),
reportName: 'Test Results'
]
} finally {
sh 'rm -vrf ./spec_results/'
dir ('spec_results') {
sh 'mv report.html canvas_i18nliner_results.html'
htmlFiles = findFiles glob: '*results.html'
}

publishHTML target: [
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: "spec_results",
reportFiles: htmlFiles.join(','),
reportName: 'Test Results'
]
}

pipeline {
Expand Down
3 changes: 0 additions & 3 deletions build/new-jenkins/library/vars/setupStage.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
*/

def call() {
echo 'Cleaning Workspace From Previous Runs'
sh 'ls -A1 | xargs rm -rf'
sh 'find .'
def refspecToCheckout = env.GERRIT_PROJECT == "canvas-lms" ? env.GERRIT_REFSPEC : env.CANVAS_LMS_REFSPEC
checkoutRepo("canvas-lms", refspecToCheckout, 100)

Expand Down

0 comments on commit b7b9d8c

Please sign in to comment.