Skip to content

Commit

Permalink
spec: publish test results from gems running rspec
Browse files Browse the repository at this point in the history
Change-Id: Ia2457bf89c27538612d0f42eaf92447b0cf23150
refs: CORE-3254
Reviewed-on: https://gerrit.instructure.com/207148
Tested-by: Jenkins
Reviewed-by: Robert Lamb <[email protected]>
QA-Review: James Butters <[email protected]>
Product-Review: James Butters <[email protected]>
  • Loading branch information
jbutte committed Aug 28, 2019
1 parent 8ad72a6 commit 28f144c
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 3 deletions.
21 changes: 21 additions & 0 deletions Jenkinsfile.vendored-gems
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,27 @@ pipeline {
}

post {
always {
// copy the test results from the container
sh 'docker cp $(docker ps -f "ancestor"="$PATCHSET_TAG" -q):/usr/src/app/tmp/spec_results/. ./spec_results/'
script {
def htmlFiles
// find all results files
dir ('spec_results') {
htmlFiles = findFiles glob: '*_results.html'
}
// publish html
publishHTML target: [
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: "spec_results",
reportFiles: htmlFiles.join(','),
reportName: 'Test Report'
]
}
}

cleanup {
sh 'build/new-jenkins/docker-cleanup.sh'
}
Expand Down
2 changes: 1 addition & 1 deletion gems/canvas_partman/.rspec
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
--color
--require spec_helper
--require spec_helper
2 changes: 1 addition & 1 deletion gems/lti-advantage/.rspec
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
--color
--require spec_helper
--require spec_helper
3 changes: 3 additions & 0 deletions gems/test-all-gems-new-jenkins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ cd gems

for test_script in $(find . -name test.sh); do
pushd `dirname $test_script` > /dev/null
echo -e "--format doc" >> ./.rspec
echo -e "--format html" >> ./.rspec
echo -e "--out ../../tmp/spec_results/$(basename `dirname $test_script`)_results.html" >> ./.rspec
echo "################ $(basename `dirname $test_script`) ################"
./test.sh
let gem_result=$?
Expand Down
2 changes: 1 addition & 1 deletion gems/turnitin_api/.rspec
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
--color
--require spec_helper
--require spec_helper

0 comments on commit 28f144c

Please sign in to comment.