blob: f64dd53c382deb8ec3f09b8590939014e6d1f207 [file] [log] [blame]
Artem Panchenko41674782017-06-26 18:01:55 +03001package com.mirantis.tcp_qa
asledzinskiye0948fd2017-01-06 16:23:54 +02002
3/**
Artem Panchenko41674782017-06-26 18:01:55 +03004 * Run tcp-qa test by specified group
asledzinskiye0948fd2017-01-06 16:23:54 +02005 * @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
9def 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
asledzinskiye0948fd2017-01-06 16:23:54 +020017 if ! py.test ${TEST_ARGS}; then
Artem Panchenko41674782017-06-26 18:01:55 +030018 echo "Tests failed!"
19 exit 1
asledzinskiye0948fd2017-01-06 16:23:54 +020020 fi
21 '''.stripIndent()
22 }
23}