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
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@ tests:
test:
- ref: monitoring-plugin-tests-alerts-ui
workflow: ipi-aws
- always_run: false
as: e2e-management-api
optional: true
steps:
cluster_profile: openshift-org-aws
test:
- ref: monitoring-plugin-tests-management-api
workflow: ipi-aws
- always_run: false
as: e2e-dashboards
optional: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,94 @@ presubmits:
secret:
secretName: result-aggregator
trigger: (?m)^/test( | .* )e2e-incidents,?($|\s.*)
- agent: kubernetes
always_run: false
branches:
- ^main$
- ^main-
cluster: build01
context: ci/prow/e2e-management-api
decorate: true
decoration_config:
sparse_checkout_files:
- .ci-operator.yaml
- Dockerfile
- Dockerfile.mcp
- Dockerfile.test
- web/cypress/Dockerfile
labels:
ci-operator.openshift.io/cloud: aws
ci-operator.openshift.io/cloud-cluster-profile: openshift-org-aws
ci.openshift.io/generator: prowgen
pj-rehearse.openshift.io/can-be-rehearsed: "true"
name: pull-ci-openshift-monitoring-plugin-main-e2e-management-api
optional: true
rerun_command: /test e2e-management-api
spec:
containers:
- args:
- --gcs-upload-secret=/secrets/gcs/service-account.json
- --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson
- --lease-server-credentials-file=/etc/boskos/credentials
- --report-credentials-file=/etc/report/credentials
- --secret-dir=/secrets/ci-pull-credentials
- --target=e2e-management-api
command:
- ci-operator
env:
- name: HTTP_SERVER_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
image: quay-proxy.ci.openshift.org/openshift/ci:ci_ci-operator_latest
imagePullPolicy: Always
name: ""
ports:
- containerPort: 8080
name: http
resources:
requests:
cpu: 10m
volumeMounts:
- mountPath: /etc/boskos
name: boskos
readOnly: true
- mountPath: /secrets/ci-pull-credentials
name: ci-pull-credentials
readOnly: true
- mountPath: /secrets/gcs
name: gcs-credentials
readOnly: true
- mountPath: /secrets/manifest-tool
name: manifest-tool-local-pusher
readOnly: true
- mountPath: /etc/pull-secret
name: pull-secret
readOnly: true
- mountPath: /etc/report
name: result-aggregator
readOnly: true
serviceAccountName: ci-operator
volumes:
- name: boskos
secret:
items:
- key: credentials
path: credentials
secretName: boskos-credentials
- name: ci-pull-credentials
secret:
secretName: ci-pull-credentials
- name: manifest-tool-local-pusher
secret:
secretName: manifest-tool-local-pusher
- name: pull-secret
secret:
secretName: registry-pull-credentials
- name: result-aggregator
secret:
secretName: result-aggregator
trigger: (?m)^/test( | .* )e2e-management-api,?($|\s.*)
- agent: kubernetes
always_run: false
branches:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
approvers:
- etmurasaki
- jan--f
- jgbernalp
- kyoto
- peteryurkovich
- zhuje
options: {}
reviewers:
- etmurasaki
- jgbernalp
- kyoto
- peteryurkovich
- zhuje
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash

set -o nounset
set -o errexit
set -o pipefail

if [ -f "${SHARED_DIR}/proxy-conf.sh" ] ; then
source "${SHARED_DIR}/proxy-conf.sh"
fi

# Run the plugin backend directly in this step container (which has the Go
# source and toolchain via from: src). The backend only needs kube API access
# to manage PrometheusRule CRDs — it does not need the full console plugin
# stack. KUBECONFIG is injected by ci-operator from the provisioned cluster.

PORT=9001

unset GOFLAGS
export GOCACHE=/tmp/go-build
export GOMODCACHE=/tmp/go-mod

echo "Starting monitoring-plugin backend on port ${PORT}..."
go run ./cmd/plugin-backend.go \
-port="${PORT}" \
-config-path="./config" \
-static-path="./web/dist" &
BACKEND_PID=$!
# Single quotes: $BACKEND_PID must expand at signal time, not at registration
trap 'kill ${BACKEND_PID} 2>/dev/null || true' EXIT

# Wait for the backend to be ready
echo "Waiting for backend to be ready..."
ready=false
for i in $(seq 1 15); do
if curl -sf "http://localhost:${PORT}/health" > /dev/null 2>&1; then
echo "Backend is ready"
ready=true
break
fi
echo " attempt ${i}/15..."
sleep 2
done
Comment thread
coderabbitai[bot] marked this conversation as resolved.

if [ "${ready}" != "true" ]; then
echo "ERROR: Backend did not become ready after 15 attempts"
exit 1
fi

echo "Running management API e2e tests..."
export PLUGIN_URL="http://localhost:${PORT}"

make test-e2e
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"path": "monitoring-plugin/tests/management-api/monitoring-plugin-tests-management-api-ref.yaml",
"owners": {
"approvers": [
"etmurasaki",
"jan--f",
"jgbernalp",
"kyoto",
"peteryurkovich",
"zhuje"
],
"reviewers": [
"etmurasaki",
"jgbernalp",
"kyoto",
"peteryurkovich",
"zhuje"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ref:
as: monitoring-plugin-tests-management-api
from: src
commands: monitoring-plugin-tests-management-api-commands.sh
timeout: 30m0s
grace_period: 60s
resources:
requests:
cpu: "2"
memory: 4Gi
limits:
memory: 8Gi
documentation: |-
The monitoring-plugin-tests-management-api step starts the
monitoring-plugin backend directly from source (go run) inside the
step container, then runs the Go e2e tests in test/e2e/ against the
live Alerting Management API (make test-e2e). KUBECONFIG is injected
by ci-operator from the provisioned cluster so the tests can create
namespaces and verify PrometheusRule CRDs.