Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
ec6a15d
RHIDP-13221 [operator] Add test for pluginDivisionMode: schema
Fortune-Ndlovu Apr 23, 2026
8428bc4
Merge branch 'main' into RHIDP-13221-operator-add-test-for-plugin-div…
Fortune-Ndlovu Apr 23, 2026
acfb7a8
Merge branch 'main' into RHIDP-13221-operator-add-test-for-plugin-div…
Fortune-Ndlovu Apr 24, 2026
6b2bf45
Merge branch 'main' into RHIDP-13221-operator-add-test-for-plugin-div…
Fortune-Ndlovu Apr 27, 2026
68dfd51
Merge branch 'main' into RHIDP-13221-operator-add-test-for-plugin-div…
Fortune-Ndlovu Apr 27, 2026
231d2e2
Merge branch 'main' into RHIDP-13221-operator-add-test-for-plugin-div…
Fortune-Ndlovu Apr 27, 2026
d8a114c
Merge branch 'main' into RHIDP-13221-operator-add-test-for-plugin-div…
Fortune-Ndlovu Apr 28, 2026
4a12b90
Merge branch 'main' into RHIDP-13221-operator-add-test-for-plugin-div…
Fortune-Ndlovu Apr 29, 2026
f15fd10
Merge branch 'main' into RHIDP-13221-operator-add-test-for-plugin-div…
Fortune-Ndlovu May 5, 2026
59754bf
Merge branch 'main' into RHIDP-13221-operator-add-test-for-plugin-div…
Fortune-Ndlovu May 6, 2026
8dfc119
Merge branch 'main' into RHIDP-13221-operator-add-test-for-plugin-div…
Fortune-Ndlovu May 7, 2026
0917ea8
Removed the dependencies: [PW_PROJECT.SHOWCASE_RUNTIME_DB] line from …
Fortune-Ndlovu May 7, 2026
e21e304
Enhance test execution order in CI scripts by running external-db tes…
Fortune-Ndlovu May 7, 2026
f35b8f3
Merge branch 'main' into RHIDP-13221-operator-add-test-for-plugin-div…
Fortune-Ndlovu May 7, 2026
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: 3 additions & 1 deletion .ci/pipelines/jobs/ocp-nightly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ run_runtime_config_change_tests() {
fi

local runtime_url="https://${RELEASE_NAME}-developer-hub-${NAME_SPACE_RUNTIME}.${K8S_CLUSTER_ROUTER_BASE}"
# Run tests - allow failures since schema-mode tests are opt-in
# Run external-db tests first (independent of schema-mode tests)
testing::run_tests "${RELEASE_NAME}" "${NAME_SPACE_RUNTIME}" "${PW_PROJECT_SHOWCASE_RUNTIME_DB}" "${runtime_url}" || true
# Run runtime tests (config-map and schema-mode)
testing::run_tests "${RELEASE_NAME}" "${NAME_SPACE_RUNTIME}" "${PW_PROJECT_SHOWCASE_RUNTIME}" "${runtime_url}" || true
}

Expand Down
31 changes: 27 additions & 4 deletions .ci/pipelines/jobs/ocp-operator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ source "$DIR"/install-methods/operator.sh
source "$DIR"/lib/testing.sh
# shellcheck source=.ci/pipelines/playwright-projects.sh
source "$DIR"/playwright-projects.sh
# shellcheck source=.ci/pipelines/lib/schema-mode-env.sh
source "$DIR"/lib/schema-mode-env.sh

initiate_operator_deployments() {
log::info "Initiating Operator-backed deployments on OCP"
Expand Down Expand Up @@ -85,20 +87,41 @@ initiate_operator_deployments_osd_gcp() {
run_operator_runtime_config_change_tests() {
# Deploy `showcase-runtime` to run tests that require configuration changes at runtime
namespace::configure "${NAME_SPACE_RUNTIME}"

# Deploy external PostgreSQL (Crunchy) and create real secrets in the runtime namespace
namespace::configure "${NAME_SPACE_POSTGRES_DB}"
configure_external_postgres_db "${NAME_SPACE_RUNTIME}"

config::create_app_config_map "$DIR/resources/postgres-db/rds-app-config.yaml" "${NAME_SPACE_RUNTIME}"
# Pre-create placeholder secrets so the operator accepts the Backstage CR (enableLocalDb=false).
# The E2E tests (RDS/Azure DB) will overwrite these with real credentials at runtime.

# Add RHDH_RUNTIME_URL to postgres-cred (configure_external_postgres_db doesn't include it,
# but rds-app-config.yaml references it for app/backend baseUrl)
local runtime_url="https://backstage-${RELEASE_NAME}-${NAME_SPACE_RUNTIME}.${K8S_CLUSTER_ROUTER_BASE}"
create_postgres_cred_secret "${NAME_SPACE_RUNTIME}" "tmp" "tmp" "RHDH_RUNTIME_URL=${runtime_url}"
oc apply -f "$DIR/resources/postgres-db/postgres-crt.yaml" -n "${NAME_SPACE_RUNTIME}"
oc patch secret postgres-cred -n "${NAME_SPACE_RUNTIME}" --type merge \
-p "{\"stringData\":{\"RHDH_RUNTIME_URL\":\"${runtime_url}\"}}"

deploy_rhdh_operator "${NAME_SPACE_RUNTIME}" "${DIR}/resources/rhdh-operator/rhdh-start-runtime.yaml" "true"

export INSTALL_METHOD=operator

# Configure schema-mode environment (opt-in: tests skip if env not configured)
if configure_schema_mode_runtime_env "${NAME_SPACE_RUNTIME}" "${RELEASE_NAME}" operator; then
log::info "Schema-mode environment configured successfully; schema-mode tests will run"
else
log::warn "Schema-mode environment not configured; schema-mode tests will skip (this is expected if PostgreSQL is not available)"
fi

# Run external-db tests first (independent of schema-mode tests)
testing::run_tests "${RELEASE_NAME}" "${NAME_SPACE_RUNTIME}" "${PW_PROJECT_SHOWCASE_RUNTIME_DB}" "${runtime_url}" || true
# Run runtime tests (config-map and schema-mode)
testing::run_tests "${RELEASE_NAME}" "${NAME_SPACE_RUNTIME}" "${PW_PROJECT_SHOWCASE_RUNTIME}" "${runtime_url}" || true
}

handle_ocp_operator() {
export NAME_SPACE="${NAME_SPACE:-showcase}"
export NAME_SPACE_RBAC="${NAME_SPACE_RBAC:-showcase-rbac}"
export NAME_SPACE_RUNTIME="${NAME_SPACE_RUNTIME:-showcase-runtime}"
export NAME_SPACE_POSTGRES_DB="${NAME_SPACE_POSTGRES_DB:-postgress-external-db}"

common::oc_login

Expand Down
13 changes: 7 additions & 6 deletions .ci/pipelines/lib/schema-mode-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ readonly SCHEMA_MODE_ENV_LIB_SOURCED=1
configure_schema_mode_runtime_env() {
local runtime_namespace=$1
local release_name=$2
local install_method=${3:-helm}

if [[ -z "${runtime_namespace}" || -z "${release_name}" ]]; then
log::error "configure_schema_mode_runtime_env: runtime_namespace and release_name are required"
Expand Down Expand Up @@ -60,32 +61,32 @@ configure_schema_mode_runtime_env() {
local crunchy_cluster="${SCHEMA_MODE_CRUNCHY_CLUSTER_NAME:-postgress-external-db}"
if oc get svc postgress-external-db-primary -n "${pdb}" &> /dev/null; then
forward_namespace="${pdb}"
log::info "Schema-mode (helm): no in-cluster Postgres Service in ${runtime_namespace}; using Crunchy cluster in ${pdb}"
log::info "Schema-mode (${install_method}): no in-cluster Postgres Service in ${runtime_namespace}; using Crunchy cluster in ${pdb}"
local crunchy_admin_secret="${crunchy_cluster}-pguser-janus-idp"
if oc get secret "${crunchy_admin_secret}" -n "${pdb}" &> /dev/null; then
admin_password=$(oc get secret "${crunchy_admin_secret}" -n "${pdb}" -o jsonpath='{.data.password}' 2> /dev/null | base64 -d || true)
fi
if [[ -z "${admin_password}" ]]; then
log::warn "Schema-mode (helm): could not read ${crunchy_admin_secret} password in ${pdb}; schema tests remain opt-in."
log::warn "Schema-mode (${install_method}): could not read ${crunchy_admin_secret} password in ${pdb}; schema tests remain opt-in."
return 1
fi
postgres_service=$(oc get pods -n "${pdb}" \
-l "postgres-operator.crunchydata.com/cluster=${crunchy_cluster},postgres-operator.crunchydata.com/data=postgres" \
--field-selector=status.phase=Running \
-o jsonpath='{.items[0].metadata.name}' 2> /dev/null)
if [[ -z "${postgres_service}" ]]; then
log::warn "Schema-mode (helm): no Running Postgres pod in ${pdb} for cluster ${crunchy_cluster}; schema tests remain opt-in."
log::warn "Schema-mode (${install_method}): no Running Postgres pod in ${pdb} for cluster ${crunchy_cluster}; schema tests remain opt-in."
return 1
fi
forward_via_pod=1
else
log::warn "Schema-mode (helm): PostgreSQL service not found in ${runtime_namespace} and no postgress-external-db-primary in ${pdb}; schema tests remain opt-in."
log::warn "Schema-mode (${install_method}): PostgreSQL service not found in ${runtime_namespace} and no postgress-external-db-primary in ${pdb}; schema tests remain opt-in."
return 1
fi
fi

if [[ -z "${admin_password}" ]]; then
log::warn "Schema-mode (helm): unable to resolve PostgreSQL admin password; schema tests remain opt-in."
log::warn "Schema-mode (${install_method}): unable to resolve PostgreSQL admin password; schema tests remain opt-in."
return 1
fi

Expand All @@ -109,5 +110,5 @@ configure_schema_mode_runtime_env() {
export SCHEMA_MODE_DB_PASSWORD="${SCHEMA_MODE_DB_PASSWORD:-test_password_123}"
export SCHEMA_MODE_DB_USER="${SCHEMA_MODE_DB_USER:-bn_backstage}"

log::info "Schema-mode env configured (helm): Playwright will port-forward ${pf_target} in ${forward_namespace}"
log::info "Schema-mode env configured (${install_method}): Playwright will port-forward ${pf_target} in ${forward_namespace}"
}
1 change: 0 additions & 1 deletion e2e-tests/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ export default defineConfig({
{
name: PW_PROJECT.SHOWCASE_RUNTIME,
workers: 1,
dependencies: [PW_PROJECT.SHOWCASE_RUNTIME_DB],
testMatch: [
"**/playwright/e2e/configuration-test/config-map.spec.ts",
"**/playwright/e2e/plugin-division-mode-schema/verify-schema-mode.spec.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Tests skip when:
### CI Behavior

- **OCP Helm nightly jobs**: Tests run (env auto-configured by `schema-mode-env.sh`)
- **OCP Operator nightly jobs**: Tests skip (operator runtime tests disabled, tracked by [RHDHBUGS-2608](https://issues.redhat.com/browse/RHDHBUGS-2608))
- **OCP Operator nightly jobs**: Tests run (env auto-configured by `schema-mode-env.sh` with `INSTALL_METHOD=operator`)
- **PR jobs**: Tests skip (env not configured by default)
- **Non-OCP jobs (AKS, EKS, GKE)**: Tests skip (no PostgreSQL deployment)

Expand All @@ -57,7 +57,7 @@ Set `DEBUG_SCHEMA_MODE_PF=1` to log port-forward output.

Tests run in the `showcase-runtime` Playwright project together with `config-map.spec.ts` (see [`playwright.config.ts`](../../../playwright.config.ts)).

**Pipeline entrypoint**: [`.ci/pipelines/openshift-ci-tests.sh`](../../../../.ci/pipelines/openshift-ci-tests.sh) → `jobs/ocp-nightly.sh`
**Pipeline entrypoint**: [`.ci/pipelines/openshift-ci-tests.sh`](../../../../.ci/pipelines/openshift-ci-tests.sh) → `jobs/ocp-nightly.sh` (Helm) or `jobs/ocp-operator.sh` (Operator)

**Environment baseline**: [`.ci/pipelines/env_variables.sh`](../../../../.ci/pipelines/env_variables.sh)

Expand Down
Loading