Skip to content

Commit 6330525

Browse files
authored
test: Support specific tests to run in integ-suite-ocp.sh (#573)
Signed-off-by: mkralik3 <mkralik@redhat.com>
1 parent 75608d1 commit 6330525

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

prow/integ-suite-ocp.sh

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,34 @@
1515
# limitations under the License.
1616

1717
# This script is used to run the integration tests on OpenShift.
18-
# Usage: ./integ-suite-ocp.sh TEST_SUITE SKIP_TESTS, example: /prow/integ-suite-ocp.sh telemetry "TestClientTracing|TestServerTracing"
19-
# TEST_SUITE: The test suite to run. Default is "pilot". Available options are "pilot", "security", "telemetry", "helm".
18+
# Usage: ./integ-suite-ocp.sh [TEST_SUITE] [SKIP_TESTS] [SKIP_SUITE] [SPECIFIC_TESTS]
19+
# Example: ./integ-suite-ocp.sh telemetry "TestAuthZCheck|TestRevisionTags" "tracing/zipkin|policy" "TestAccessLogs|TestAccessLogsFilter"
20+
#
21+
# Parameters can also be set via environment variables:
22+
# TEST_SUITE: The test suite to run. Default is "pilot". Available options are "pilot", "security", "telemetry", "helm", "ambient".
23+
# SKIP_TESTS: The tests to skip. Default is "". e.g. "TestAuthZCheck|TestRevisionTags"
24+
# SKIP_SUITE: The test suites under main suite to skip. Default is "". e.g. "tracing/zipkin|policy"
25+
# SPECIFIC_TESTS: The specific tests ONLY to run. Default is "". e.g. "TestAccessLogs|TestAccessLogsFilter"
26+
#
27+
# Examples:
28+
# ./integ-suite-ocp.sh telemetry # Run all telemetry tests
29+
# ./integ-suite-ocp.sh telemetry "" "" "TestAccessLogs|TestAccessLogsFilter" # Run only specific tests
30+
# ./integ-suite-ocp.sh telemetry "" "tracing/zipkin" "TestAccessLogs|TestAccessLogsFilter" # Run specific tests but skip if in tracing/zipkin suite
31+
# SPECIFIC_TESTS="TestAccessLogs|TestAccessLogsFilter" ./integ-suite-ocp.sh telemetry # Same as above, using env var
32+
# SKIP_TESTS="TestAuthZCheck|TestRevisionTags" ./integ-suite-ocp.sh pilot # Skip specific tests
33+
# SKIP_SUITE="tracing/zipkin|policy" ./integ-suite-ocp.sh telemetry # Skip specific suites
34+
#
2035
# TODO: Use the same arguments as integ-suite.kind.sh uses
2136

2237
WD=$(dirname "$0")
2338
ROOT=$(dirname "$WD")
2439
WD=$(cd "$WD"; pwd)
2540
export NAMESPACE="${NAMESPACE:-"istio-system"}"
2641
export TAG="${TAG:-"istio-testing"}"
27-
SKIP_TESTS="${2:-""}"
28-
TEST_SUITE="${1:-"pilot"}"
29-
SKIP_SUITE="${3:-""}"
42+
TEST_SUITE="${1:-${TEST_SUITE:-"pilot"}}"
43+
SKIP_TESTS="${2:-${SKIP_TESTS:-""}}"
44+
SKIP_SUITE="${3:-${SKIP_SUITE:-""}}"
45+
SPECIFIC_TESTS="${4:-${SPECIFIC_TESTS:-""}}"
3046
SKIP_SETUP="${SKIP_SETUP:-"false"}"
3147
INSTALL_METALLB="${INSTALL_METALLB:-"false"}"
3248
OPERATOR_NAMESPACE="${OPERATOR_NAMESPACE:-"sail-operator"}"
@@ -261,6 +277,11 @@ if [ "${CONTROL_PLANE_SOURCE}" == "sail" ]; then
261277
base_cmd+=("--istio.test.kube.controlPlaneInstaller=${SAIL_SETUP_SCRIPT}")
262278
fi
263279

280+
# Append specific tests flag if SPECIFIC_TESTS is set, e.g.: "TestTraffic|TestServices"
281+
if [ -n "${SPECIFIC_TESTS}" ]; then
282+
base_cmd+=("-run" "${SPECIFIC_TESTS}")
283+
fi
284+
264285
# Append skip tests flag if SKIP_TESTS is set
265286
if [ -n "${SKIP_TESTS}" ]; then
266287
base_cmd+=("-skip" "${SKIP_TESTS}")

0 commit comments

Comments
 (0)