Add SPARQL tests step and publish results.
1 parent 7eda5c2 commit 7c9c4e98b4ee0c634379ab5253c3293b426e7301
@Alex Tucker Alex Tucker authored on 18 Mar 2019
Showing 1 changed file
View
26
vars/transformPipeline.groovy
}
}
}
}
stage('Test') {
stage('Validate CSV') {
agent {
docker {
image 'cloudfluff/csvlint'
reuseNode true
}
}
}
}
stage('Upload draftset') {
stage('Upload Tidy Data') {
steps {
script {
jobDraft.replace()
uploadTidy(['out/observations.csv'],
"https://ons-opendata.github.io/${pipelineParams.refFamily}/columns.csv")
}
}
}
stage('Test draft dataset') {
agent {
docker {
image 'cloudfluff/gdp-sparql-tests'
reuseNode true
}
}
steps {
script {
pmd = pmdConfig("pmd")
String draftId = pmd.drafter.findDraftset(env.JOB_NAME).id
String endpoint = pmd.drafter.getDraftsetEndpoint(draftId)
String dspath = util.slugise(env.JOB_NAME)
String dsgraph = "${pmd.config.base_uri}/graph/${dspath}"
withCredentials([usernamePassword(credentialsId: pmd.config.credentials, usernameVariable: 'USER', passwordVariable: 'PASS')]) {
sh "sparql-test-runner -t /usr/local/tests -s ${endpoint} -a '${USER}:${PASS}' -p \"dsgraph=<${dsgraph}>\""
}
}
}
}
stage('Publish') {
post {
always {
script {
archiveArtifacts artifacts: 'out/*', excludes: 'out/*.html'
junit 'reports/**/*.xml'
publishHTML([
allowMissing: true, alwaysLinkToLastBuild: true, keepAll: true,
reportDir: 'out', reportFiles: 'main.html',
reportName: 'Transform'])
}
 
}
}