Skip to content
Open
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
4 changes: 2 additions & 2 deletions .openshift-ci/base_qa_e2e_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
from runners import ClusterTestSetsRunner, TestSet


def make_qa_e2e_test_runner(cluster):
def make_qa_e2e_test_runner(cluster, roxie_config=""):
return ClusterTestSetsRunner(
cluster=cluster,
initial_pre_test=PreSystemTests(),
sets=[
TestSet(
"QA tests part I",
test=QaE2eTestPart1(),
test=QaE2eTestPart1(roxie_config=roxie_config),
post=PostClusterTest(
check_stackrox_logs=True,
artifact_destination_prefix="part-1",
Expand Down
9 changes: 8 additions & 1 deletion .openshift-ci/ci_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,18 @@ def run(self):
class QaE2eTestPart1(BaseTest):
TEST_TIMEOUT = 240 * 60

def __init__(self, roxie_config=""):
super().__init__()
self.roxie_config = roxie_config

def run(self):
print("Executing qa-tests-backend tests (part I)")

args = ["qa-tests-backend/scripts/run-part-1.sh"]
if self.roxie_config:
args.append(self.roxie_config)
self.run_with_graceful_kill(
["qa-tests-backend/scripts/run-part-1.sh"], self.TEST_TIMEOUT,
args, self.TEST_TIMEOUT,
output_dir="/tmp/qa-part1-misc-logs",
)

Expand Down
2 changes: 1 addition & 1 deletion ROXIE_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.13
0.4.14-test2
20 changes: 17 additions & 3 deletions qa-tests-backend/scripts/run-part-1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,23 @@ source "$ROOT/qa-tests-backend/scripts/workload-identities/workload-identities.s
set -euo pipefail

run_part_1() {
local roxie_config="${1:-}"

if [[ -z "$roxie_config" ]]; then
# No roxie config provided by the caller, hence we use a new one.
roxie_config="$(mktemp)"
trap 'rm -f "$roxie_config"' RETURN
fi

info "Starting test (qa-tests-backend part I)"

config_part_1
config_part_1 "$roxie_config"
test_part_1
}

config_part_1() {
local roxie_config="${1:-}"

info "Configuring the cluster to run part 1 of e2e tests"

require_environment "ORCHESTRATOR_FLAVOR"
Expand Down Expand Up @@ -65,8 +75,12 @@ config_part_1() {

ensure_roxie_on_path

local config_file
config_file="$(mktemp)"
local config_file="$roxie_config"
if [[ -z ${config_file} ]]; then
config_file="$(mktemp)"
# No cleanup trap, we're deep in the call stack and it's not clear if it would be safe to
# override the global exit trap.
fi

merge_yaml "$config_file" <<EOF
central:
Expand Down
21 changes: 19 additions & 2 deletions scripts/ci/jobs/gke_race_condition_qa_e2e_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,38 @@
"""
Run qa-tests-backend in a GKE cluster with a `-race` stackrox/main.
"""

import os
import tempfile

from base_qa_e2e_test import make_qa_e2e_test_runner
from clusters import GKECluster

# set test parameters
os.environ["ORCHESTRATOR_FLAVOR"] = "k8s"
os.environ["KUBERNETES_PROVIDER"] = "gke"
os.environ["USE_ROXIE_DEPLOY"] = "true"
os.environ["GCP_IMAGE_TYPE"] = "cos_containerd"
os.environ["SCANNER_V4_DB_STORAGE_CLASS"] = "faster"

# use -rcd image for stackrox/main
os.environ["MAIN_IMAGE_TAG"] = os.environ["STACKROX_BUILD_TAG"] + "-rcd"
os.environ["CENTRAL_DB_IMAGE_TAG"] = os.environ["STACKROX_BUILD_TAG"]
os.environ["USE_LOCAL_ROXCTL"] = "true"
os.environ["ROX_RISK_REPROCESSING_INTERVAL"] = "15s"
os.environ["ROX_SENSOR_CONNECTION_RETRY_MAX_INTERVAL"] = "30s"

make_qa_e2e_test_runner(cluster=GKECluster("race-condition-qa-e2e-test")).run()
with tempfile.NamedTemporaryFile(mode="w", suffix=".yaml") as roxie_config_file:
main_tag = os.environ["MAIN_IMAGE_TAG"]
build_tag = os.environ["STACKROX_BUILD_TAG"]
roxie_config_file.write(f"""\
operator:
version: "{build_tag}" # Necessary since roxie compat layer hardcodes roxie.version: "$MAIN_IMAGE_TAG"
operandTag: "{build_tag}"
operandTagOverrides:
"main": "{main_tag}"
""")
roxie_config_file.flush()
make_qa_e2e_test_runner(
cluster=GKECluster("race-condition-qa-e2e-test"),
roxie_config=roxie_config_file.name,
).run()
Loading