Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sp 2247 #21

Merged
merged 1 commit into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 37 additions & 36 deletions Jenkinsfiles/nuc_x86_test_set
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ bootJob = ''
batJob = ''
nucDirectory = 'nuc_test_results'
bootSuite = 'boot_test.robot'
//batSuite = 'bat_test_nuc.robot'
batSuite = './'

pipeline {
agent { label 'tc-agent02' }
agent { label "${params.label}" }
stages {
stage('Set variables') {
steps {
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 @@ -33,7 +33,7 @@ pipeline {
// wait that USB drive is mounted
sh 'sleep 10'
def output = sh (
script: 'lsblk -o model,name |grep PSSD',
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 Down Expand Up @@ -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")
}
}
}
}
}
}
}
71 changes: 36 additions & 35 deletions Jenkinsfiles/orin_arm_test_set
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ bootJob = ''
batJob = ''
orinDirectory = 'orin_test_results'
bootSuite = 'boot_test.robot'
//batSuite = 'bat_test_orin.robot'
batSuite = './'

pipeline {
agent { label 'tc-agent02' }
agent { label "${params.label}" }
stages {
stage('Set variables') {
steps {
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 @@ -33,7 +33,7 @@ pipeline {
// 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 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")
}
}
}
}
}
}
}