Skip to content

Commit

Permalink
HW tests: Fix performance test
Browse files Browse the repository at this point in the history
ghaf-robot performance test requires the test to be run from the
directory `Robot-Framework/test-suites`. Otherwise, the the test fails
with errors like:

```
FileNotFoundError: [Errno 2] No such file or directory:
'../test-suites/OrinNX1_CPU One thread test.png'
```

This should probably fixed in
https://github.com/tiiuae/ci-test-automation repo, perhaps somewhere in:
```
Robot-Framework/lib/PerformanceDataProcessing.py
```

Signed-off-by: Henri Rosten <[email protected]>
  • Loading branch information
henrirosten committed Aug 24, 2024
1 parent 9b3976f commit a3cc7d3
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions ghaf-hw-test.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ def ghaf_robot_test(String testname='boot') {
string(credentialsId: 'testagent-switch-token', variable: 'SW_TOKEN'),
string(credentialsId: 'testagent-switch-secret', variable: 'SW_SECRET'),
]) {
dir("Robot-Framework/test-suites/${testname}") {
dir("Robot-Framework/test-suites") {
sh 'rm -f *.png output.xml report.html log.html'
// On failure, continue the pipeline execution
catchError(stageResult: 'FAILURE', buildResult: 'FAILURE') {
try {
// Pass the secrets to the shell as environment variables, as we
// don't want Groovy to interpolate them. Similary, we pass
// other variables as environment variables to shell.
Expand All @@ -69,12 +69,21 @@ def ghaf_robot_test(String testname='boot') {
-v SWITCH_TOKEN:$SW_TOKEN \
-v SWITCH_SECRET:$SW_SECRET \
-v BUILD_ID:${BUILD_NUMBER} \
-i $INCLUDE_TEST_TAGS ..
-i $INCLUDE_TEST_TAGS .
'''
if (testname == 'boot') {
// Set an environment variable to indicate boot test passed
env.BOOT_PASSED = 'true'
}
} catch (Exception e) {
currentBuild.result = "FAILURE"
unstable("FAILED '${testname}': ${e.toString()}")
} finally {
// Move the test output (if any) to a subdirectory
sh """
rm -fr $testname; mkdir -p $testname
mv -f *.png output.xml report.html log.html $testname/ || true
"""
}
}
}
Expand All @@ -98,7 +107,7 @@ pipeline {
stage('Setup') {
steps {
script {
env.TEST_CONFIG_DIR = 'Robot-Framework/test-suites/config'
env.TEST_CONFIG_DIR = 'Robot-Framework/config'
sh """
mkdir -p ${TEST_CONFIG_DIR}
rm -f ${TEST_CONFIG_DIR}/*.json
Expand Down

0 comments on commit a3cc7d3

Please sign in to comment.