Skip to content
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
25 changes: 25 additions & 0 deletions test/resources/SkipTests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""Pre-run modifier that skips tests by their name.
Tests to skip are specified by Test Name
"""

import os
from robot.api import SuiteVisitor


class SkipTests(SuiteVisitor):

def __init__(self, list_skip_test):
self.list_skip_test = list_skip_test

if self.list_skip_test:
print("List of tests to be skipped:")
print(f" - {self.list_skip_test.replace(',', f'{os.linesep} - ')}")
else:
print("No tests to be skipped")

def visit_test(self, test):
"""Set tag to skip tests"""

# set `robot:skip` tag
if test.name in self.list_skip_test.split(","):
test.tags.add("robot:skip")
9 changes: 7 additions & 2 deletions test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ OUTDIR="${ROOTDIR}/_output/e2e-$(date +%Y%m%d-%H%M%S)"
function usage {
local -r script_name=$(basename "$0")
cat - <<EOF
${script_name} [-h] [-n] [-o output_dir] [-v venv_dir] [-i var_file] [test suite files]
${script_name} [-h] [-n] [-o output_dir] [-v venv_dir] [-i var_file] [-k test_names] [test suite files]

Options:

Expand All @@ -24,10 +24,11 @@ Options:
-o DIR The output directory. (${OUTDIR})
-v DIR The venv directory. (${RF_VENV})
-i PATH The variables file. (${RF_VARIABLES})
-k SKIP_TESTS Comma separated list of tests to skip.
EOF
}

while getopts "hno:v:i:" opt; do
while getopts "hno:v:i:k:" opt; do
case ${opt} in
h)
usage
Expand All @@ -45,6 +46,9 @@ while getopts "hno:v:i:" opt; do
i)
RF_VARIABLES=${OPTARG}
;;
k)
SKIP_TESTS=${OPTARG}
;;
*)
usage
exit 1
Expand Down Expand Up @@ -82,6 +86,7 @@ else
# shellcheck disable=SC2086
"${RF_BINARY}" \
--randomize all \
--prerunmodifier "${SCRIPTDIR}/resources/SkipTests.py:${SKIP_TESTS:-}" \
--loglevel TRACE \
-V "${RF_VARIABLES}" \
-x junit.xml \
Expand Down