Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
268 commits
Select commit Hold shift + click to select a range
56f0438
end brace
davdhacs Aug 1, 2025
999656b
only run on prs
davdhacs Aug 1, 2025
6b3c941
reuse base from .openshift-ci
davdhacs Aug 1, 2025
b96492e
endquote
davdhacs Aug 1, 2025
2bed6a5
set pr var if gha
davdhacs Aug 1, 2025
a46a140
use runner_temp
davdhacs Aug 1, 2025
6aa0cc7
or use /tmp
davdhacs Aug 1, 2025
cb8dcc4
share with other steps
davdhacs Aug 1, 2025
dabf279
env in step yaml
davdhacs Aug 1, 2025
697dfc0
add job name
davdhacs Aug 1, 2025
eea52be
in same shell
davdhacs Aug 1, 2025
b1f018d
use ocp script
davdhacs Aug 1, 2025
19a2e0b
just use the dispatch
davdhacs Aug 1, 2025
c29f0af
fetch all history
davdhacs Aug 1, 2025
158e02f
reuse job name
davdhacs Aug 1, 2025
4a261a5
fetch-depth
davdhacs Aug 1, 2025
a867c06
fix export name
davdhacs Aug 1, 2025
4f77ad9
not tee with export
davdhacs Aug 1, 2025
59a827c
direct python script run
davdhacs Aug 1, 2025
4c1d7ed
set job name before infra check
davdhacs Aug 1, 2025
d83b41a
list here
davdhacs Aug 1, 2025
622a835
use gha infractl
davdhacs Aug 1, 2025
76786de
use public path
davdhacs Aug 1, 2025
28398fa
decode from base64
davdhacs Aug 1, 2025
1d6dac0
retry curl
davdhacs Aug 1, 2025
43f8757
set empty
davdhacs Aug 1, 2025
bec23f3
Merge branch 'master' into rox-e2e-existing-install
davdhacs Aug 4, 2025
bb1d8e6
use infra token secret
davdhacs Aug 4, 2025
2500e21
export kubeconfig
davdhacs Aug 4, 2025
bdda74c
add to shared_env
davdhacs Aug 4, 2025
a0a2646
quay auth
davdhacs Aug 4, 2025
5533999
add image-prefetcher quay auth
davdhacs Aug 4, 2025
0fb344f
add token for image-prefetcher
davdhacs Aug 4, 2025
b4d1ff1
try without container
davdhacs Aug 4, 2025
aa11a47
use pr head sha
davdhacs Aug 4, 2025
66a0ce7
try test against target
davdhacs Aug 4, 2025
2e4a53a
export tag
davdhacs Aug 4, 2025
a66f6c3
override prefetcher tag
davdhacs Aug 4, 2025
123f789
faster clone
davdhacs Aug 4, 2025
4f39a0d
use base sha
davdhacs Aug 4, 2025
1dbaca2
print tag
davdhacs Aug 4, 2025
7bdff21
remove end bracket
davdhacs Aug 4, 2025
9867327
remove dir listing
davdhacs Aug 4, 2025
5d69e94
create tag formatted
davdhacs Aug 4, 2025
a7d5f21
fetch all
davdhacs Aug 4, 2025
62aa9f4
install oc
davdhacs Aug 4, 2025
5899edf
add scanner
davdhacs Aug 4, 2025
a77e890
do not gather
davdhacs Aug 4, 2025
421821a
try passwd lookup
davdhacs Aug 4, 2025
5093871
set empty debug collect dir
davdhacs Aug 4, 2025
59582e3
hide passwd
davdhacs Aug 4, 2025
7532e6e
add scanner gcr cred
davdhacs Aug 4, 2025
ee3c542
export empty debug log var
davdhacs Aug 4, 2025
7526906
post_collect condition
davdhacs Aug 4, 2025
dffe419
pythonize
davdhacs Aug 4, 2025
dc91830
log vars in debug check
davdhacs Aug 4, 2025
3ef76f7
echo dir
davdhacs Aug 4, 2025
797d01c
always log for collect
davdhacs Aug 5, 2025
410cc7c
keep logs dir
davdhacs Aug 5, 2025
60e7e94
try finding port also
davdhacs Aug 5, 2025
4d107a5
list api hn and port
davdhacs Aug 5, 2025
78ca81a
Add Cypress configuration to run tests against OCP console
dvail Jul 29, 2025
99ffa40
(WIP) debug in ci
dvail Jul 29, 2025
0954b4f
Test ci_export
dvail Jul 29, 2025
d106d5e
Export when the vars is in scope, perhaps
dvail Jul 30, 2025
b8f1dac
Lets try this again, but for jobs that do not start with "osd"
dvail Jul 30, 2025
c9a2033
One more time with feeling
dvail Jul 30, 2025
d9807e1
More debug
dvail Aug 4, 2025
ab62f56
More debug
dvail Aug 5, 2025
92d096f
Update dispatch.sh
dvail Aug 5, 2025
719f480
use kubectl
davdhacs Aug 5, 2025
bac17a4
--amend
davdhacs Aug 5, 2025
f317e01
debug ci set
davdhacs Aug 5, 2025
9a553c0
restore oc install
davdhacs Aug 5, 2025
546945b
set timeouts
davdhacs Aug 6, 2025
20ef1a2
only env files
davdhacs Aug 6, 2025
f32ed90
only *env files
davdhacs Aug 6, 2025
7624476
re-set CI
davdhacs Aug 6, 2025
771305b
install rox if not found
davdhacs Aug 6, 2025
6209dc4
add curl api check
davdhacs Aug 6, 2025
cd7782c
vars to stdout
davdhacs Aug 6, 2025
ba6e94f
match in bash
davdhacs Aug 6, 2025
3bcfa8b
reduce
davdhacs Aug 6, 2025
ab97ae9
allow err
davdhacs Aug 6, 2025
ceb0278
api test
davdhacs Aug 6, 2025
595fd37
toString cluster constant
davdhacs Aug 6, 2025
fafb1cb
separate flavor check
davdhacs Aug 6, 2025
fbda917
remove suffix
davdhacs Aug 6, 2025
775752c
install oc only for openshift cluster
davdhacs Aug 6, 2025
c1b677b
xtrace infractl install
davdhacs Aug 6, 2025
e6b0ecc
use jq
davdhacs Aug 6, 2025
f00ed3b
use kubeconfig path
davdhacs Aug 6, 2025
681d469
fix operand
davdhacs Aug 6, 2025
9a74b1d
use shared_dir
davdhacs Aug 6, 2025
63b1abc
admin-password full name
davdhacs Aug 7, 2025
26abbde
exec syntax
davdhacs Aug 7, 2025
90cccde
list tmp files
davdhacs Aug 7, 2025
b467f2b
bg git fetch
davdhacs Aug 7, 2025
a8e9c8a
check tag lookup
davdhacs Aug 7, 2025
b90939c
try 4. prefix
davdhacs Aug 7, 2025
8997e14
only .x
davdhacs Aug 7, 2025
3ebbad3
try .x ending
davdhacs Aug 7, 2025
0fdc650
try shallow-since
davdhacs Aug 7, 2025
4afdf87
filter and 8k
davdhacs Aug 7, 2025
0e39fa5
tag lookup before deploy
davdhacs Aug 7, 2025
dad6e4d
ignore not found
davdhacs Aug 7, 2025
23367e4
or true
davdhacs Aug 7, 2025
5bb12ea
fetch all
davdhacs Aug 7, 2025
721bc21
cat the admin-password file
davdhacs Aug 7, 2025
c98fb9d
tag lookup later
davdhacs Aug 7, 2025
38de939
try wait for pid
davdhacs Aug 7, 2025
9ab8322
remove extra slash
davdhacs Aug 7, 2025
36f0c7f
remove extra ps check
davdhacs Aug 7, 2025
7fe5c6b
pgrep and sleep
davdhacs Aug 7, 2025
c2b39a8
fix overwrite after pswd from file
davdhacs Aug 7, 2025
20364dd
fail if api test fails
davdhacs Aug 7, 2025
8f21e70
bg tests and wait on pids
davdhacs Aug 7, 2025
0ab1554
1s loop check pgrep
davdhacs Aug 7, 2025
cb4ac54
list all files under qa-tests
davdhacs Aug 7, 2025
3c3b9ca
extra semicolon
davdhacs Aug 7, 2025
ed4b1e7
try grep for gradle
davdhacs Aug 7, 2025
e80a9f1
space!
davdhacs Aug 7, 2025
6acefef
back to pids
davdhacs Aug 7, 2025
03978ae
sequential
davdhacs Aug 7, 2025
8b5160b
log each Env.mustGet lookup
davdhacs Aug 7, 2025
28efa5b
verify gcr creds
davdhacs Aug 7, 2025
230fd76
unset CI
davdhacs Aug 7, 2025
e8382e2
replace stackrox
davdhacs Aug 7, 2025
63fa3c5
log scannerv4 set
davdhacs Aug 7, 2025
403b1d1
and tail git fetch bg
davdhacs Aug 7, 2025
74fe561
use deploy password if deploy.sh
davdhacs Aug 7, 2025
cb5d675
remove duplicate deploy
davdhacs Aug 7, 2025
a1a9f54
Merge branch 'master' into rox-29840-access-ocp-console
davdhacs Aug 11, 2025
2d01dfc
xtrace in deploy
davdhacs Aug 11, 2025
f5a6571
CI=true
davdhacs Aug 11, 2025
c7f17e9
scc setup for tests
davdhacs Aug 11, 2025
b78a3ec
create ns before scc patch
davdhacs Aug 11, 2025
ed8d38b
try direct in scc setup
davdhacs Aug 11, 2025
7bf2a39
requiredDrop null
davdhacs Aug 11, 2025
04fb7c2
do not always remove
davdhacs Aug 12, 2025
0bac9f9
stop logging var setup
davdhacs Aug 12, 2025
e4143f8
without re-setting in env
davdhacs Aug 12, 2025
2a9899c
check for null pr body also
davdhacs Aug 12, 2025
51d903a
retry null desc also
davdhacs Aug 12, 2025
5915398
remove var check
davdhacs Aug 12, 2025
cf7cf82
fix redirect
davdhacs Aug 12, 2025
54c52de
try new sha
davdhacs Aug 12, 2025
60ada4c
gradle fail fast
davdhacs Aug 12, 2025
160a9f9
show all in summary table
davdhacs Aug 13, 2025
35ae053
manual test summary
davdhacs Aug 13, 2025
8661086
wrap !cancelled
davdhacs Aug 13, 2025
9d8510d
remove debug log of collect vars
davdhacs Aug 13, 2025
332f1bb
Merge branch 'master' into rox-e2e-existing-install
davdhacs Aug 13, 2025
0a063f1
quiet gradle
davdhacs Aug 13, 2025
518027a
wait for tag match
davdhacs Aug 13, 2025
5d61726
git describe always
davdhacs Aug 13, 2025
ab0d608
check gradle daemon
davdhacs Aug 13, 2025
3b8f028
xtrace tag check
davdhacs Aug 13, 2025
88f1c83
match in git describe
davdhacs Aug 13, 2025
a2464d5
fetch all in bg
davdhacs Aug 13, 2025
bce60d1
no fail on image tag
davdhacs Aug 13, 2025
52d6086
use gradle wrapper
davdhacs Aug 13, 2025
9b426e1
use gha gradle action
davdhacs Aug 13, 2025
5ab9840
enable echo on compile
davdhacs Aug 13, 2025
93c941d
use wrapper gradle version
davdhacs Aug 13, 2025
4d9fae4
try gradle 8.14
davdhacs Aug 13, 2025
c637524
update before setup
davdhacs Aug 13, 2025
4dc5aeb
log=warn
davdhacs Aug 13, 2025
65796dd
and check if the gradle wrapper changed
davdhacs Aug 13, 2025
0235001
fail-fast steps also
davdhacs Aug 13, 2025
988cf1d
cancel old jobs
davdhacs Aug 13, 2025
256ae34
always run test summary
davdhacs Aug 13, 2025
263dda1
no continue on test steps
davdhacs Aug 13, 2025
cd1a294
check daemon at end
davdhacs Aug 13, 2025
4f5520c
try project-dir
davdhacs Aug 13, 2025
20ce0f7
gradle wrapper direct
davdhacs Aug 13, 2025
5f36ac5
gradle cache use
davdhacs Aug 13, 2025
b1a1d84
use gradlew for update
davdhacs Aug 13, 2025
f64eef8
cd first
davdhacs Aug 13, 2025
9ecaae7
skip gradle upgrade
davdhacs Aug 13, 2025
0720e92
retry infractl download
davdhacs Aug 13, 2025
22475b9
retry whoami
davdhacs Aug 13, 2025
a2f4e29
empty commit
davdhacs Aug 14, 2025
bc01ff4
log more in smoke test
davdhacs Aug 14, 2025
3ed1d7e
try use master cache
davdhacs Aug 14, 2025
01131b6
fetch all
davdhacs Aug 14, 2025
1f0f808
try default checkout
davdhacs Aug 14, 2025
09a8370
empty commit
davdhacs Aug 14, 2025
1a61e51
try tag match
davdhacs Aug 14, 2025
b226e5b
fetch tags
davdhacs Aug 14, 2025
b74eff3
xtrace on ci_export
davdhacs Aug 14, 2025
82f0c30
var for ocp like osd
davdhacs Aug 14, 2025
0f62d52
simplify
davdhacs Aug 15, 2025
8975d8d
lint
davdhacs Aug 15, 2025
8a96f63
simplify cluster auth vars
davdhacs Aug 15, 2025
8e0fc15
deploy-local
davdhacs Aug 15, 2025
42bdbda
Merge branch 'rox-e2e-existing-install' into rox-29840-access-ocp-con…
davdhacs Aug 15, 2025
dcb59f7
login to ocp cluster in gha
davdhacs Aug 15, 2025
0aeae04
source the e2e lib
davdhacs Aug 15, 2025
6785816
Merge branch 'master' into rox-29840-access-ocp-console
davdhacs Aug 15, 2025
9db0565
test client certs
davdhacs Aug 15, 2025
1678267
show console url
davdhacs Aug 15, 2025
76809b3
try start-ocp bridge
davdhacs Aug 15, 2025
f8d3b27
set acs_api var
davdhacs Aug 15, 2025
7f54020
Merge branch 'rox-29840-access-ocp-console' into rox-e2e-existing-ins…
davdhacs Aug 15, 2025
9833e23
merge fail
davdhacs Aug 15, 2025
9492b83
lookup api with kubeconfig
davdhacs Aug 16, 2025
03822c4
try ui e2e
davdhacs Aug 16, 2025
7b921ff
missing dash
davdhacs Aug 16, 2025
8ea96ad
without bridge
davdhacs Aug 16, 2025
c78b599
run ui-e2e
davdhacs Aug 16, 2025
b48d8f9
always delete stackrox ns
davdhacs Aug 16, 2025
d4bfb38
api_endpoint not set
davdhacs Aug 16, 2025
f77b356
no quiet on openssl
davdhacs Aug 16, 2025
83795c7
add VERSION for operator deploy
davdhacs Aug 16, 2025
5ff4973
use oper makefile rewrite of tag
davdhacs Aug 16, 2025
7d1bfa3
store infra files in tmp not shared
davdhacs Aug 16, 2025
86c1d31
handle no infra test
davdhacs Aug 16, 2025
c9fe799
use console url not api
davdhacs Aug 17, 2025
a116c40
kind cluster if no infra
davdhacs Aug 17, 2025
19d1e53
ocplogin
davdhacs Aug 17, 2025
8e5fdbd
disable testoninfra in prow
davdhacs Aug 17, 2025
a23317b
test with kubeconfig separately
davdhacs Aug 17, 2025
0594695
continue if no cluster
davdhacs Aug 17, 2025
1aaf613
cluster type check
davdhacs Aug 17, 2025
a9f779b
remove logging of osd vars
davdhacs Aug 17, 2025
cb10afc
wait 1min
davdhacs Aug 17, 2025
2f0165c
add timeout for un get
davdhacs Aug 17, 2025
6de328a
hack ocp login to work
davdhacs Aug 18, 2025
1d30004
turn off xtrace for env
davdhacs Aug 18, 2025
c1d4b26
include int-ocp results
davdhacs Aug 18, 2025
1bdce8a
do not reinstall
davdhacs Aug 18, 2025
4a79299
lookup rox vars
davdhacs Aug 18, 2025
b8eb561
disable secured cluster lookup
davdhacs Aug 18, 2025
ec8b6c1
remove ui test debug
davdhacs Aug 20, 2025
9babeb2
test on kind
davdhacs Aug 20, 2025
07ea504
install on non-infra
davdhacs Aug 20, 2025
8a4ce7c
share username
davdhacs Aug 20, 2025
15c2d93
quiet deploy
davdhacs Aug 20, 2025
085f48a
lookup only if existed
davdhacs Aug 20, 2025
bf68a2a
fetch all
davdhacs Aug 20, 2025
bbf6092
CI off
davdhacs Aug 20, 2025
3e8bd56
default remote clustername
davdhacs Aug 20, 2025
64b0bc4
continue on err
davdhacs Aug 20, 2025
5d9432c
Merge branch 'master' into rox-e2e-existing-install
davdhacs Aug 25, 2025
5239b86
set cluster for k8s
davdhacs Aug 25, 2025
ab9611a
only install with qa wrapper
davdhacs Aug 25, 2025
6391db8
specify image to deploy in config
davdhacs Aug 25, 2025
0334344
Merge branch 'master' into rox-e2e-existing-install
davdhacs Sep 10, 2025
2e5dfa3
restore master scc anyuid
davdhacs Sep 10, 2025
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
317 changes: 317 additions & 0 deletions .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,317 @@
name: E2E tests
on:
pull_request:
workflow_dispatch:
inputs:
commit:
description: 'Commit SHA of tests'
required: true
type: string
tested_commit:
description: 'Commit SHA to test'
required: true
type: string
workflow_call:
env:
ROX_PRODUCT_BRANDING: stackrox

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
e2e-tests:
runs-on: ubuntu-latest
env:
KUBECONFIG: "/tmp/kubeconfig"
FAIL_FAST: "true"
INFRA_TOKEN: ${{ secrets.INFRA_TOKEN }}
POD_SECURITY_POLICIES: "false"
ROX_VULN_MGMT_UNIFIED_CVE_DEFERRAL: "true"
ROX_PROCESSES_LISTENING_ON_PORT: "false"
REGISTRY_USERNAME: ${{ secrets.QUAY_RHACS_ENG_RO_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.QUAY_RHACS_ENG_RO_PASSWORD }}
GOOGLE_CREDENTIALS_GCR_SCANNER_V2: ${{ secrets.GOOGLE_CREDENTIALS_GCR_SCANNER_V2 }}
GCP_SERVICE_ACCOUNT_STACKROX_CI: ${{ secrets.GCP_SERVICE_ACCOUNT_STACKROX_CI }}
QUAY_RHACS_ENG_RO_PASSWORD: ${{ secrets.QUAY_RHACS_ENG_RO_PASSWORD }}
QUAY_RHACS_ENG_RO_USERNAME: ${{ secrets.QUAY_RHACS_ENG_RO_USERNAME }}
QUAY_RHACS_ENG_BEARER_TOKEN: ${{ secrets.QUAY_RHACS_ENG_BEARER_TOKEN }}
MAIN_IMAGE_TAG: ${{ inputs.tested_commit || github.event.pull_request.base.sha }}
TAG: ${{ inputs.tested_commit || github.event.pull_request.base.sha }}
GATHER_QA_TEST_DEBUG_LOGS: "false"
QA_TEST_DEBUG_LOGS: ""
SHARED_DIR: "/tmp"
#ORCHESTRATOR_FLAVOR: "openshift"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 #${{ github.event.pull_request.commits }}
fetch-tags: true
show-progress: false

- run: |
nohup git fetch origin '+refs/tags/*:refs/tags/*' >>/tmp/git.fetching.log 2>&1 &
echo $! | tee /tmp/git.fetching.pid

- uses: ./.github/actions/job-preamble
if: ${{ !env.ACT }}
with:
gcp-account: ${{ secrets.GCP_SERVICE_ACCOUNT_STACKROX_CI }}

- name: Env variables
run: |
JOB_NAME="${JOB_NAME:-ocp-4-19-qa-e2e-tests}"

ARTIFACT_DIR="${ARTIFACT_DIR:-${SHARED_DIR}/artifacts/}"
mkdir -p "$ARTIFACT_DIR"

cat >> "$GITHUB_ENV" <<EOF
SHARED_DIR=${SHARED_DIR:-/tmp}
ARTIFACT_DIR=${ARTIFACT_DIR}

CI_JOB_NAME=${JOB_NAME}
JOB_NAME=${JOB_NAME}
JOB_NAME_SAFE=qa-e2e-tests
GRADLE_USER_HOME=${HOME}
EOF

#- name: Check if testing on Infra cluster
# timeout-minutes: 5
# continue-on-error: true
# run: |
# source scripts/ci/lib.sh
# test_on_infra | tee -a "$GITHUB_ENV"

- id: cluster-exists
continue-on-error: true
run: |
kubectl get nodes

- name: Create k8s Kind Cluster
if: ${{ steps.cluster-exists.outcome == 'failure' }}
uses: helm/kind-action@v1
with:
kubeconfig: "${{ env.KUBECONFIG }}"

- name: Determine cluster flavor
timeout-minutes: 5
continue-on-error: true
run: |
set -x
if kubectl get scc; then
echo "CLUSTER=OPENSHIFT" | tee -a "$GITHUB_ENV"
else
echo "CLUSTER=K8S" | tee -a "$GITHUB_ENV"
fi
exit 0
# groovy tests require CLUSTER='OPENSHIFT' for ocp or ='K8S' for GKE.
if [[ "$(infractl get "$CLUSTER_NAME" --json | jq -r '.Flavor')" == *"openshift"* ]]; then
echo "CLUSTER=OPENSHIFT" | tee -a "$GITHUB_ENV"
# default is "K8S"
fi

- name: Check tag lookup
timeout-minutes: 0.5
continue-on-error: true
run: |
set -x
while [[ "$(git describe --match='*.x' --tags --abbrev=10 --always --dirty --long --exclude '*-nightly-*')" \
!= *".x-"* ]]; do
sleep 1
pgrep -F /tmp/git.fetching.pid || break
done
git describe --tags --abbrev=10 --always --dirty --long --exclude '*-nightly-*' || true
set +e
# example: 4.9.x-457-g9867327a52
MAIN_IMAGE_TAG=$(git describe --match="*.x" --tags --abbrev=10 --long --exclude '*-nightly-*' "${MAIN_IMAGE_TAG:-master}")
echo "MAIN_IMAGE_TAG=${MAIN_IMAGE_TAG}" | tee -a "$GITHUB_ENV"
echo "TAG=${MAIN_IMAGE_TAG}" | tee -a "$GITHUB_ENV"

#- name: Remove existing Stackrox
# continue-on-error: true
# if: ${{ steps.cluster-exists.outcome != 'failure' }}
# run: |
# kubectl delete namespace stackrox

- name: Find or Deploy Stackrox
id: rox-exists
continue-on-error: true
env:
DEPLOY_STACKROX_VIA_OPERATOR: "false"
# LOAD_BALANCER: "lb"
# SCANNER_SUPPORT: "true"
SENSOR_HELM_DEPLOY: "true"
ROX_SCANNER_V4: "false"
MONITORING_SUPPORT: "false"
LOCAL_DEPLOYMENT: "true"
ROX_BASELINE_GENERATION_DURATION: "1m"
ROX_NETWORK_BASELINE_OBSERVATION_PERIOD: "2m"
run: |
kubectl get namespace stackrox \
|| {
if [[ "${CLUSTER,,}" == "openshift" ]]; then
kubectl get scc qatest-anyuid \
|| {
kubectl create ns stackrox;
kubectl create -f "qa-tests-backend/src/k8s/scc-qatest-anyuid.yaml";
}
fi
tests/e2e/run-e2e-tests.sh -t "${MAIN_IMAGE_TAG}" --config-only qa && exit 1
# CI= ./deploy/deploy-local.sh;
find deploy -name password;
echo "ROX_USERNAME=admin" >> "$GITHUB_ENV";
echo "ROX_ADMIN_PASSWORD=$(cat deploy/*/central-deploy/password)" >> "$GITHUB_ENV";
exit 1;
}

- name: Stackrox service and auth lookup
id: stackrox-api
if: ${{ steps.rox-exists.outcome != 'failure' }}
timeout-minutes: 5
continue-on-error: true
run: |
set +e
set -x
ls -latr /tmp/
if [[ -e "${KUBECONFIG:-}" ]]; then
if [[ -z "${ROX_ADMIN_PASSWORD:-}" ]]; then
password="${ROX_ADMIN_PASSWORD:-$(cat "${KUBECONFIG%kubeconfig}admin-password")}"
password="${password:-$(kubectl -n stackrox get secret admin-pass -o json | jq -er '.data.password // ""' | base64 -d)}"
password="${password:-$(kubectl -n stackrox get secret central-htpasswd -o json | jq -er '.data.password // ""' | base64 -d)}"
echo "ROX_USERNAME=admin" | tee -a "$GITHUB_ENV"
echo "ROX_ADMIN_PASSWORD=${password}" >> "$GITHUB_ENV"
fi
if [[ -z "${API_HOSTNAME:-}" || ( $API_HOSTNAME == 'localhost' && -z "$(pgrep -F /tmp/forward.pid)" ) ]]; then
API_HOSTNAME=$(kubectl -n stackrox get route central -o jsonpath='{.status.ingress[0].host}')
API_HOSTNAME=${API_HOSTNAME:-$(kubectl -n stackrox get service central-loadbalancer -o jsonpath='{.status.loadBalancer.ingress[0].ip}')}
API_HOSTNAME=${API_HOSTNAME:-localhost}
echo "API_HOSTNAME=${API_HOSTNAME}" | tee -a "$GITHUB_ENV"
API_PORT=${API_PORT:-$(kubectl -n stackrox get route central -o jsonpath='{.spec.port.targetPort}')}
API_PORT=${API_PORT:-$(kubectl -n stackrox get service central-loadbalancer -o jsonpath='{.status.loadBalancer.ingress[0].port}')}
API_PORT=${API_PORT//https/443}
if [[ "$API_HOSTNAME" == 'localhost' ]]; then
ps -ef|grep kubectl || true
nohup kubectl -n stackrox port-forward svc/central 8000:443 &
echo $! | tee /tmp/forward.pid
API_PORT=8000
fi
API_PORT=${API_PORT:-443}
echo "API_HOSTNAME=${API_HOSTNAME}" | tee -a "$GITHUB_ENV"
echo "API_PORT=${API_PORT}" | tee -a "$GITHUB_ENV"
fi
fi
echo "API_ENDPOINT=${API_HOSTNAME:-localhost}:${API_PORT:-8000}" | tee -a "$GITHUB_ENV"

- name: Stackrox API test
if: ${{ steps.stackrox-api.outcome != 'failure' }}
continue-on-error: true
run: |
if [[ "${API_HOSTNAME:-}" == 'localhost' || -e /tmp/forward.pid ]]; then
cat /tmp/forward.pid || true
ps -ef | grep kube || true
fi

curl -sk -u "${ROX_USERNAME}:${ROX_ADMIN_PASSWORD}" "https://${API_ENDPOINT}/v1/clusters" | jq '.'

# Only needed for Groovy
- name: Get secured cluster name
continue-on-error: true
if: ${{ steps.stackrox-api.outcome != 'failure' }}
run: |
echo "Groovy tests expect a secured cluster. Default name is 'remote' but the Infra demo clusters set names like 'production'. Look up what secured clusters exist:"
set -x
CLUSTER_INFO=$(curl -sk -u "${ROX_USERNAME}:${ROX_ADMIN_PASSWORD}" "https://${API_ENDPOINT}/v1/clusters")
echo "REMOTE_CLUSTER_NAME=$(jq -r '(.clusters[] | select(.name == "production") | .name) // .clusters[0].name' <<<"$CLUSTER_INFO")" | tee -a "$GITHUB_ENV"

- run: go get github.com/stackrox/scanner

- name: install oc cli
if: ${{ env.CLUSTER == 'OPENSHIFT' }}
run: |
# Some tests require `oc`.
curl --retry 5 --retry-all-errors -L -o /tmp/openshift-client-linux.tar.gz \
https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz
tar -C /tmp -xzf /tmp/openshift-client-linux.tar.gz
install --mode 755 /tmp/oc /usr/local/bin/
install --mode 755 /tmp/kubectl /usr/local/bin/

## UI e2e - Cypress tests
#- name: UI E2E
# timeout-minutes: 45
# run: |
# set +e
# ls -latr ${SHARED_DIR}**
# source tests/e2e/lib.sh
# setup_automation_flavor_e2e_cluster "${CI_JOB_NAME}"
# set -x
# export DEPLOY_STACKROX_VIA_OPERATOR=true
# export INSTALL_COMPLIANCE_OPERATOR=true
# export ORCHESTRATOR_FLAVOR="${CLUSTER}"

# #DEPLOY_DIR="deploy/${ORCHESTRATOR_FLAVOR}"
# #HOSTALIASES=/tmp/hostaliases
# #UI_BASE_URL (set to either "https://central-lb:443" or "https://localhost:${LOCAL_PORT}")
# #make -C ui test-e2e, so these environment variables will be available during that execution.

# export VERSION=$(echo "${MAIN_IMAGE_TAG}" | sed -E 's@^(([[:digit:]]+\.)+)x(-)?@\10\3@g') # operator/Makefile VERSION is CSV_TAG
# tests/e2e/run-ui-e2e.sh

# QA e2e - groovy tests
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: wrapper
#cache-read-only: false
cache-overwrite-existing: true
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/release' }}

- timeout-minutes: 10
run: |
make -C qa-tests-backend compile

- timeout-minutes: 35
continue-on-error: true
run: |
export TEST_TARGET="smoke-test"
cd qa-tests-backend && ./gradlew testSMOKE --fail-fast

- timeout-minutes: 35
continue-on-error: true
run: |
export TEST_TARGET="bat-test"
cd qa-tests-backend && ./gradlew testParallelBAT testBAT --fail-fast --warn

- timeout-minutes: 35
run: |
export TEST_TARGET="test"
cd qa-tests-backend && ./gradlew testParallel testRest --fail-fast --warn

- name: Check shared dir and artifacts
if: always()
run: |
set +e
set -x
tail /tmp/git.fetching.log
ls -latr ${ARTIFACT_DIR}**
ls -latr ${SHARED_DIR}**
echo "check daemon:"
{ pushd qa-tests-backend; ./gradlew --status || true; popd; }

- name: Publish Test Report
id: test-results
uses: test-summary/action@v2
continue-on-error: true
if: always()
with:
paths: 'qa-tests-backend/build/test-results/**/TEST-*.xml'
show: "all"

- name: Determine cluster flavor
if: ${{ steps.test-results.outcome == 'failure' }}
timeout-minutes: 5
run: |
tee -a "$GITHUB_STEP_SUMMARY" <<EOF
:boom: ${{ steps.test_summary.outputs.failed }}/${{ steps.test_summary.outputs.total }} failed
:seedling: ${{ steps.test_summary.outputs.passed }}/${{ steps.test_summary.outputs.total }} passed
:zzz: ${{ steps.test_summary.outputs.skipped }}/${{ steps.test_summary.outputs.total }} skipped
EOF
10 changes: 5 additions & 5 deletions .openshift-ci/base_qa_e2e_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
QaE2eDBBackupRestoreTest,
CustomSetTest,
)
from post_tests import PostClusterTest, CheckStackroxLogs, FinalPost
from post_tests import NullPostTest, PostClusterTest, CheckStackroxLogs, FinalPost
from runners import ClusterTestSetsRunner


def make_qa_e2e_test_runner(cluster):
def make_qa_e2e_test_runner(cluster, post_collect=True):
return ClusterTestSetsRunner(
cluster=cluster,
initial_pre_test=PreSystemTests(),
Expand All @@ -25,15 +25,15 @@ def make_qa_e2e_test_runner(cluster):
"post_test": PostClusterTest(
check_stackrox_logs=True,
artifact_destination_prefix="part-1",
),
) if post_collect else NullPostTest(),
},
{
"name": "QA tests part II",
"test": QaE2eTestPart2(),
"post_test": PostClusterTest(
check_stackrox_logs=True,
artifact_destination_prefix="part-2",
),
) if post_collect else NullPostTest(),
"always_run": False,
},
{
Expand All @@ -42,7 +42,7 @@ def make_qa_e2e_test_runner(cluster):
"post_test": CheckStackroxLogs(
check_for_errors_in_stackrox_logs=True,
artifact_destination_prefix="db-test",
),
) if post_collect else NullPostTest(),
"always_run": False,
},
],
Expand Down
2 changes: 2 additions & 0 deletions .openshift-ci/begin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ openshift_ci_import_creds
setup_gcp
set_ci_shared_export started_at "$(date -u +%s)"

#test_on_infra

if [[ -z "${SHARED_DIR:-}" ]]; then
echo "ERROR: There is no SHARED_DIR for step env sharing"
exit 0 # not fatal but worth highlighting
Expand Down
Loading
Loading