summaryrefslogtreecommitdiffstats
path: root/coin
diff options
context:
space:
mode:
authorSimo Fält <simo.falt@qt.io>2021-03-15 16:50:28 +0200
committerSimo Fält <simo.falt@qt.io>2021-07-01 08:46:57 +0000
commitc1b6fdd0d96107cf3b8dd2f14d698e01149eb4a5 (patch)
treeef04c8967a5f932760e113e97d16dee267de36b3 /coin
parenteea930b4d7cabb6ada6155b66b5b143b73a10344 (diff)
Add instructions to collect results from COIN test run
Change adds coin_ctest_runner.py which is used to pass test arguments for testcase. Results are stored to xml files, which are then parsed by COIN. Data that we are interested in, is injected to influx db. Task-number: COIN-643 Change-Id: Ib1c99fc8aacc6a6b5863d282f3435fe1cfdcd013 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'coin')
-rw-r--r--coin/instructions/cmake_run_ctest_enforce_exit_code.yaml41
-rw-r--r--coin/instructions/cmake_setup_running_tests_env_vars.yaml32
2 files changed, 73 insertions, 0 deletions
diff --git a/coin/instructions/cmake_run_ctest_enforce_exit_code.yaml b/coin/instructions/cmake_run_ctest_enforce_exit_code.yaml
index 0d99faddcd..5e57b50951 100644
--- a/coin/instructions/cmake_run_ctest_enforce_exit_code.yaml
+++ b/coin/instructions/cmake_run_ctest_enforce_exit_code.yaml
@@ -1,5 +1,46 @@
type: Group
instructions:
+ - type: ScheduleUploadTestResults
+ - type: PrependToEnvironmentVariable
+ variableName: PATH
+ variableValue: "{{.Env.PYTHON3_PATH}}:"
+ disable_if:
+ condition: property
+ property: host.os
+ equals_value: Windows
+ - type: EnvironmentVariable
+ variableName: TESTRUNNER
+ variableValue: "python3 {{.SourceDir}}/coin_ctest_runner.py"
+ disable_if:
+ condition: or
+ conditions:
+ - condition: property
+ property: host.os
+ equals_value: Windows
+ - condition: property
+ property: features
+ contains_value: AndroidTestRun
+ - type: EnvironmentVariable
+ variableName: TESTRUNNER
+ variableValue: "{{.SourceDir}}\\coin_ctest_runner.py"
+ enable_if:
+ condition: property
+ property: host.os
+ equals_value: Windows
+ - type: EnvironmentVariable
+ variableName: COIN_CTEST_RESULTSDIR
+ variableValue: "{{.AgentWorkingDir}}\\testresults"
+ enable_if:
+ condition: property
+ property: host.os
+ equals_value: Windows
+ - type: EnvironmentVariable
+ variableName: COIN_CTEST_RESULTSDIR
+ variableValue: "{{.AgentWorkingDir}}/testresults"
+ disable_if:
+ condition: property
+ property: host.os
+ equals_value: Windows
- type: EnvironmentVariable
variableName: CTEST_ARGS
variableValue: "-V --rerun-failed --force-new-ctest-process --repeat until-pass:5"
diff --git a/coin/instructions/cmake_setup_running_tests_env_vars.yaml b/coin/instructions/cmake_setup_running_tests_env_vars.yaml
index ac909a95cc..be0f81dfa7 100644
--- a/coin/instructions/cmake_setup_running_tests_env_vars.yaml
+++ b/coin/instructions/cmake_setup_running_tests_env_vars.yaml
@@ -3,6 +3,38 @@ instructions:
- type: EnvironmentVariable
variableName: QTEST_ENVIRONMENT
variableValue: "ci"
+ - type: WriteFile
+ fileContents: |
+ #!/usr/bin/python3
+ import subprocess
+ import calendar
+ import datetime
+ import time
+ import sys
+ import os
+ import re
+ from os.path import expanduser
+ home = expanduser("~")
+
+ file=os.path.basename(sys.argv[1])
+ timestamp = str(round(time.time() * 1000))
+ results_file = home + "/work/testresults/" + file +"-" + timestamp + ".xml,xml"
+ testargs = ["-o", results_file, "-o", "-,txt"]
+ if re.search("testlib.selftests.tst_selftests", sys.argv[1]):
+ testargs = []
+ exit(subprocess.call([sys.argv[1]] + testargs))
+ filename: "{{.SourceDir}}/coin_ctest_runner.py"
+ fileMode: 755
+ - type: ExecuteCommand
+ command: "chmod 755 {{.SourceDir}}/coin_ctest_runner.py"
+ maxTimeInSeconds: 10
+ maxTimeBetweenOutput: 10
+ userMessageOnFailure: >
+ Failed to change file permission.
+ disable_if:
+ condition: property
+ property: host.os
+ equals_value: Windows
- type: Group
instructions:
- type: EnvironmentVariable