Skip to content

Commit

Permalink
Add BAT tests triggering
Browse files Browse the repository at this point in the history
Add BAT tests triggering to Jenkinsfiles

Signed-off-by: Ville-Pekka Juntunen <[email protected]>
  • Loading branch information
vjuntunen committed Jul 6, 2023
1 parent 6682090 commit c9cdac1
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 73 deletions.
75 changes: 38 additions & 37 deletions Jenkinsfiles/nuc_x86_test_set
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ bootJob = ''
batJob = ''
nucDirectory = 'nuc_test_results'
bootSuite = 'boot_test.robot'
//batSuite = 'bat_test_nuc.robot'
batSuite = './'

pipeline {
agent { label "${params.label}" }
Expand All @@ -20,7 +20,7 @@ pipeline {
script {
def splitted = "${JOB_NAME}".split('/')
bootJob = "${splitted[0]}/Testing/NUC_x86/nuc_x86_boot_test"
//batJob = "development/Testing/Orin_arm/orin_arm_bat_test"
batJob = "${splitted[0]}/Testing/smoke_tests"
}
}
}
Expand All @@ -29,11 +29,11 @@ pipeline {
script{
// Set pipeline description
currentBuild.description = "${params.server} BuildID: ${params.buildID}"
sh './BrainStem_dev_kit/bin/AcronameHubCLI -u 0 -s 8CC6B0A9'
sh './BrainStem_dev_kit/bin/AcronameHubCLI -u 0 -s 6B780E17'
// wait that USB drive is mounted
sh 'sleep 10'
def output = sh (
script: 'lsblk -o model,name |grep SanDisk',
script: 'lsblk -o model,name |grep PSSD', // Check for usb device that is connected to target test device
returnStdout: true
).trim()
def list = output.split(' ')
Expand All @@ -54,7 +54,7 @@ pipeline {
stage('Change USB HUB host back to test device') {
steps {
script{
sh './BrainStem_dev_kit/bin/AcronameHubCLI -u 1 -s 8CC6B0A9'
sh './BrainStem_dev_kit/bin/AcronameHubCLI -u 1 -s 6B780E17'
}
}
}
Expand All @@ -67,7 +67,7 @@ pipeline {
job: "${bootJob}", propagate: false,
parameters: [
[$class: 'StringParameterValue', name: 'RF_SUITE', value: "${bootSuite}"],
[$class: 'StringParameterValue', name: 'DESCRIPTION', value: "Hydra buildID: ${params.buildID}"]
[$class: 'StringParameterValue', name: 'DESCRIPTION', value: "${params.server} buildID: ${params.buildID}"]
]
)

Expand All @@ -85,36 +85,37 @@ pipeline {
}
}
}
// stage('BAT tests') {
// when {
// expression {
// buildResults.boot == 'SUCCESS'
// }
// }
// steps {
// script{
// // Make directory for test results
// sh "mkdir ${params.resultsPath}/${params.buildID}/${nucDirectory}/bat"
// build = build(
// job: "${batJob}", propagate: false,
// parameters: [
// [$class: 'StringParameterValue', name: 'RF_SUITE', value: "${batSuite}"],
// [$class: 'StringParameterValue', name: 'DESCRIPTION', value: "Hydra buildID: ${params.buildID}"]
// ]
// )
// // copy report and log
// sh "cp ~/Jenkins-agent/workspace/${batJob}/Robot-Framework/test-suites/report.html ${params.resultsPath}/${params.buildID}/${nucDirectory}/bat/report.html"
// sh "cp ~/Jenkins-agent/workspace/${batJob}/Robot-Framework/test-suites/log.html ${params.resultsPath}/${params.buildID}/${nucDirectory}/bat/log.html"
// if(build.result == "SUCCESS") {
// buildResults."bat" = "SUCCESS"
// echo "BUILD NUMBER: ${build.number} SUCCESSFULLY BUILD"
// } else {
// catchError(stageResult: 'FAILURE', buildResult: 'FAILURE'){
// error("BAT build failed")
// }
// }
// }
// }
// }
stage('BAT tests') {
when {
expression {
buildResults.boot == 'SUCCESS'
}
}
steps {
script{
// Make directory for test results
sh "mkdir ${params.resultsPath}/${params.buildID}/${nucDirectory}/bat"
build = build(
job: "${batJob}", propagate: false,
parameters: [
[$class: 'StringParameterValue', name: 'RF_SUITE', value: "${batSuite}"],
[$class: 'StringParameterValue', name: 'DESCRIPTION', value: "${params.server} buildID: ${params.buildID}"],
[$class: 'StringParameterValue', name: 'DEVICE_NAME', value: "NUC1"]
]
)
// copy report and log
sh "cp ~/Jenkins-agent/workspace/${batJob}/Robot-Framework/test-suites/report.html ${params.resultsPath}/${params.buildID}/${nucDirectory}/bat/report.html"
sh "cp ~/Jenkins-agent/workspace/${batJob}/Robot-Framework/test-suites/log.html ${params.resultsPath}/${params.buildID}/${nucDirectory}/bat/log.html"
if(build.result == "SUCCESS") {
buildResults."bat" = "SUCCESS"
echo "BUILD NUMBER: ${build.number} SUCCESSFULLY BUILD"
} else {
catchError(stageResult: 'FAILURE', buildResult: 'FAILURE'){
error("BAT build failed")
}
}
}
}
}
}
}
73 changes: 37 additions & 36 deletions Jenkinsfiles/orin_arm_test_set
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ bootJob = ''
batJob = ''
orinDirectory = 'orin_test_results'
bootSuite = 'boot_test.robot'
//batSuite = 'bat_test_orin.robot'
batSuite = './'

pipeline {
agent { label "${params.label}" }
Expand All @@ -20,7 +20,7 @@ pipeline {
script {
def splitted = "${JOB_NAME}".split('/')
bootJob = "${splitted[0]}/Testing/Orin_arm/orin_arm_boot_test"
//batJob = "development/Testing/Orin_arm/orin_arm_bat_test"
batJob = "${splitted[0]}/Testing/smoke_tests"
}
}
}
Expand All @@ -29,11 +29,11 @@ pipeline {
script{
// Set pipeline description
currentBuild.description = "${params.server} BuildID: ${params.buildID}"
sh './BrainStem_dev_kit/bin/AcronameHubCLI -u 0 -s 92D8AEB7'
sh './BrainStem_dev_kit/bin/AcronameHubCLI -u 0 -s EBBBCDD4'
// wait that USB drive is mounted
sh 'sleep 10'
def output = sh (
script: 'lsblk -o model,name |grep DataTraveler', // SanDisk is certain usb-store connected to this certain usb-hub.
script: 'lsblk -o model,name |grep DataTraveler', // Check for usb device that is connected to target test device
returnStdout: true
).trim()
def list = output.split(' ')
Expand All @@ -54,7 +54,7 @@ pipeline {
stage('Change USB HUB host back to test device') {
steps {
script{
sh './BrainStem_dev_kit/bin/AcronameHubCLI -u 1 -s 92D8AEB7'
sh './BrainStem_dev_kit/bin/AcronameHubCLI -u 1 -s EBBBCDD4'
}
}
}
Expand Down Expand Up @@ -85,36 +85,37 @@ pipeline {
}
}
}
// stage('BAT tests') {
// when {
// expression {
// buildResults.boot == 'SUCCESS'
// }
// }
// steps {
// script{
// // Make directory for test results
// sh "mkdir ${params.resultsPath}/${params.buildID}/${orinDirectory}/bat"
// build = build(
// job: "${batJob}", propagate: false,
// parameters: [
// [$class: 'StringParameterValue', name: 'RF_SUITE', value: "${batSuite}"],
// [$class: 'StringParameterValue', name: 'DESCRIPTION', value: "Hydra buildID: ${params.buildID}"]
// ]
// )
// // copy report and log
// sh "cp ~/Jenkins-agent/workspace/${batJob}/Robot-Framework/test-suites/report.html ${params.resultsPath}/${params.buildID}/${orinDirectory}/bat/report.html"
// sh "cp ~/Jenkins-agent/workspace/${batJob}/Robot-Framework/test-suites/log.html ${params.resultsPath}/${params.buildID}/${orinDirectory}/bat/log.html"
// if(build.result == "SUCCESS") {
// buildResults."bat" = "SUCCESS"
// echo "BUILD NUMBER: ${build.number} SUCCESSFULLY BUILD"
// } else {
// catchError(stageResult: 'FAILURE', buildResult: 'FAILURE'){
// error("BAT build failed")
// }
// }
// }
// }
// }
stage('BAT tests') {
when {
expression {
buildResults.boot == 'SUCCESS'
}
}
steps {
script{
// Make directory for test results
sh "mkdir ${params.resultsPath}/${params.buildID}/${orinDirectory}/bat"
build = build(
job: "${batJob}", propagate: false,
parameters: [
[$class: 'StringParameterValue', name: 'RF_SUITE', value: "${batSuite}"],
[$class: 'StringParameterValue', name: 'DESCRIPTION', value: "${params.server} buildID: ${params.buildID}"],
[$class: 'StringParameterValue', name: 'DEVICE_NAME', value: "ORIN1"]
]
)
// copy report and log
sh "cp ~/Jenkins-agent/workspace/${batJob}/Robot-Framework/test-suites/report.html ${params.resultsPath}/${params.buildID}/${orinDirectory}/bat/report.html"
sh "cp ~/Jenkins-agent/workspace/${batJob}/Robot-Framework/test-suites/log.html ${params.resultsPath}/${params.buildID}/${orinDirectory}/bat/log.html"
if(build.result == "SUCCESS") {
buildResults."bat" = "SUCCESS"
echo "BUILD NUMBER: ${build.number} SUCCESSFULLY BUILD"
} else {
catchError(stageResult: 'FAILURE', buildResult: 'FAILURE'){
error("BAT build failed")
}
}
}
}
}
}
}

0 comments on commit c9cdac1

Please sign in to comment.