Artem Panchenko | 4167478 | 2017-06-26 18:01:55 +0300 | [diff] [blame] | 1 | package com.mirantis.tcp_qa |
asledzinskiy | e0948fd | 2017-01-06 16:23:54 +0200 | [diff] [blame] | 2 | |
| 3 | /** |
Artem Panchenko | 4167478 | 2017-06-26 18:01:55 +0300 | [diff] [blame] | 4 | * Run tcp-qa test by specified group |
asledzinskiy | e0948fd | 2017-01-06 16:23:54 +0200 | [diff] [blame] | 5 | * @param testGroup defines what tests to run, options are '-m test_mark', '-k test_expression' |
| 6 | * @param jobSetParameters is additional params needed to run mcp-qa test |
| 7 | */ |
| 8 | |
| 9 | def runTest(testGroup, jobSetParameters) { |
| 10 | def testArgs = [ '-s', '-ra' ] |
| 11 | testArgs.add(testGroup) |
| 12 | jobSetParameters.add("TEST_ARGS=${testArgs.join(' ')}") |
| 13 | echo("The current tags, args, which were set by job: ${jobSetParameters.join(' ')}") |
| 14 | withEnv(jobSetParameters) { |
| 15 | sh '''\ |
| 16 | . ${VENV_PATH}/bin/activate |
asledzinskiy | e0948fd | 2017-01-06 16:23:54 +0200 | [diff] [blame] | 17 | if ! py.test ${TEST_ARGS}; then |
Artem Panchenko | 4167478 | 2017-06-26 18:01:55 +0300 | [diff] [blame] | 18 | echo "Tests failed!" |
| 19 | exit 1 |
asledzinskiy | e0948fd | 2017-01-06 16:23:54 +0200 | [diff] [blame] | 20 | fi |
| 21 | '''.stripIndent() |
| 22 | } |
| 23 | } |