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

Changes to use congif file to get needed data #29

Merged
merged 1 commit into from
Aug 31, 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
65 changes: 49 additions & 16 deletions Jenkinsfiles/orin_arm_test_set → Jenkinsfiles/hw_test_set
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,67 @@ buildResults = [:]

bootJob = ''
batJob = ''
orinDirectory = 'orin_test_results'
resultsDirectory = ''
configPath = ''
bootSuite = 'boot_test.robot'
batSuite = './'
deviceName = ''
usbHubSerial = ''
usbDrive = 'PSSD'

pipeline {
agent { label "${params.label}" }
stages {
stage('Set variables') {
steps {
script {
resultsDirectory = "${params.device}_test_results"
def splitted = "${JOB_NAME}".split('/')
bootJob = "${splitted[0]}/Testing/Orin_arm/orin_arm_boot_test"
bootJob = "${splitted[0]}/Testing/boot_test"
batJob = "${splitted[0]}/Testing/smoke_tests"
configPath = "/home/${params.label}/Jenkins-agent/workspace/${splitted[0]}/Testing/test_config.json"

// Check for which agent and which target device
if ("${params.label}" == "tc-agent02"){
if (params.device == "Orin"){
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should stop using name 'Orin' because now we have two deffirenet Orins: AGX and NX. Let's take it into account now already

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

decided to make it in different branch

deviceName = 'ORIN1'
} else if (params.device == "NUC"){
deviceName = 'NUC1'
}
} else if ("${params.label}" == "tc-agent03"){
if (params.device == "Orin"){
deviceName = 'ORIN2'
} else if (params.device == "NUC"){
deviceName = 'NUC2'
}
}
echo "DEVICE: ${deviceName}"

// Set pipeline description
currentBuild.description = "${params.server} ${params.device} BuildID: ${params.buildID}"

// Read test devices configfile and set usbHub serial to use right device
def deviceData = readJSON file: "${configPath}"
usbHubSerial = "${deviceData['addresses']["${deviceName}"]['usbhub_serial']}"
println("USB HUB serial: ${usbHubSerial}")

}
}
}
stage('Change USB HUB host to PC') {
steps {
script{
// Set pipeline description
currentBuild.description = "${params.server} BuildID: ${params.buildID}"
sh './BrainStem_dev_kit/bin/AcronameHubCLI -u 0 -s EBBBCDD4'
sh "./BrainStem_dev_kit/bin/AcronameHubCLI -u 0 -s ${usbHubSerial}"

// wait that USB drive is mounted
sh 'sleep 10'
def output = sh (
script: 'lsblk -o model,name |grep PSSD', // Check for usb device that is connected to target test device
// Check for usb drive that is connected to target test device
script: "lsblk -o model,name |grep ${usbDrive}",
returnStdout: true
).trim()
def list = output.split(' ')

// Take last element which is the target USB device
USBDEVICE = list[-1]
println("USB device: ${USBDEVICE}")
Expand All @@ -54,26 +86,27 @@ pipeline {
stage('Change USB HUB host back to test device') {
steps {
script{
sh './BrainStem_dev_kit/bin/AcronameHubCLI -u 1 -s EBBBCDD4'
sh "./BrainStem_dev_kit/bin/AcronameHubCLI -u 1 -s ${usbHubSerial}"
}
}
}
stage('Boot Orin') {
stage('Boot Test') {
steps {
script{
// Make directory for test results
sh "mkdir -p ${params.resultsPath}/${params.buildID}/${orinDirectory}/boot"
sh "mkdir -p ${params.resultsPath}/${params.buildID}/${resultsDirectory}/boot"
build = build(
job: "${bootJob}", propagate: false,
parameters: [
[$class: 'StringParameterValue', name: 'RF_SUITE', value: "${bootSuite}"],
[$class: 'StringParameterValue', name: 'DESCRIPTION', value: "${params.server} buildID: ${params.buildID}"]
[$class: 'StringParameterValue', name: 'DESCRIPTION', value: "${params.server} buildID: ${params.buildID}"],
[$class: 'StringParameterValue', name: 'DEVICE_NAME', value: "${deviceName}"]
]
)

// copy report and log
sh "cp ~/Jenkins-agent/workspace/${bootJob}/Robot-Framework/test-suites/report.html ${params.resultsPath}/${params.buildID}/${orinDirectory}/boot/report.html"
sh "cp ~/Jenkins-agent/workspace/${bootJob}/Robot-Framework/test-suites/log.html ${params.resultsPath}/${params.buildID}/${orinDirectory}/boot/log.html"
sh "cp ~/Jenkins-agent/workspace/${bootJob}/Robot-Framework/test-suites/report.html ${params.resultsPath}/${params.buildID}/${resultsDirectory}/boot/report.html"
sh "cp ~/Jenkins-agent/workspace/${bootJob}/Robot-Framework/test-suites/log.html ${params.resultsPath}/${params.buildID}/${resultsDirectory}/boot/log.html"
if(build.result == "SUCCESS") {
buildResults."boot" = "SUCCESS"
echo "BUILD NUMBER: ${build.number} SUCCESSFULLY BUILD"
Expand All @@ -94,18 +127,18 @@ pipeline {
steps {
script{
// Make directory for test results
sh "mkdir ${params.resultsPath}/${params.buildID}/${orinDirectory}/bat"
sh "mkdir ${params.resultsPath}/${params.buildID}/${resultsDirectory}/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"]
[$class: 'StringParameterValue', name: 'DEVICE_NAME', value: "${deviceName}"]
]
)
// 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"
sh "cp ~/Jenkins-agent/workspace/${batJob}/Robot-Framework/test-suites/report.html ${params.resultsPath}/${params.buildID}/${resultsDirectory}/bat/report.html"
sh "cp ~/Jenkins-agent/workspace/${batJob}/Robot-Framework/test-suites/log.html ${params.resultsPath}/${params.buildID}/${resultsDirectory}/bat/log.html"
if(build.result == "SUCCESS") {
buildResults."bat" = "SUCCESS"
echo "BUILD NUMBER: ${build.number} SUCCESSFULLY BUILD"
Expand Down
121 changes: 0 additions & 121 deletions Jenkinsfiles/nuc_x86_test_set

This file was deleted.

Empty file.
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion requirements
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ pyserial==3.5
robotframework-seriallibrary==0.4.2
robotframework-sshlibrary==3.8.0
robotframework==5.0.1
PyP100==0.0.19
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on Production side devices work with old version on this lib, so maybe we shouldn't change it in requirements right now

PyP100==0.1.2