Skip to content

Commit 588eee7

Browse files
committed
fix topology-rbac and kubernetes-rbac tests in k8s jobs
1 parent 48954ea commit 588eee7

4 files changed

Lines changed: 30 additions & 23 deletions

File tree

.ci/pipelines/utils.sh

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -345,23 +345,26 @@ apply_yaml_files() {
345345
common::create_configmap_from_file "dynamic-global-header-config" "$project" \
346346
"dynamic-global-header-config.yaml" "$dir/resources/config_map/dynamic-global-header-config.yaml"
347347

348-
# Skip Tekton and Topology resources for K8s deployments (AKS/EKS/GKE)
348+
# Skip Tekton resources for K8s deployments (AKS/EKS/GKE)
349349
# Tekton tests are not executed in showcase-k8s or showcase-rbac-k8s projects
350350
if [[ "$JOB_NAME" != *"aks"* && "$JOB_NAME" != *"eks"* && "$JOB_NAME" != *"gke"* ]]; then
351351
# Create Pipeline run for tekton test case.
352352
oc apply -f "$dir/resources/pipeline-run/hello-world-pipeline.yaml"
353353
oc apply -f "$dir/resources/pipeline-run/hello-world-pipeline-run.yaml"
354354

355-
# Create Deployment and Pipeline for Topology test.
356-
oc apply -f "$dir/resources/topology_test/topology-test.yaml"
357-
if [[ -z "${IS_OPENSHIFT}" || "${IS_OPENSHIFT}" == "false" ]]; then
358-
kubectl apply -f "$dir/resources/topology_test/topology-test-ingress.yaml"
359-
else
360-
oc apply -f "$dir/resources/topology_test/topology-test-route.yaml"
361-
fi
362355
else
363-
log::info "Skipping Tekton Pipeline and Topology resources for K8s deployment (${JOB_NAME})"
356+
log::info "Skipping Tekton Pipeline resources for K8s deployment (${JOB_NAME})"
364357
fi
358+
359+
# Create Deployment and Pipeline for Topology test.
360+
oc apply -f "$dir/resources/topology_test/topology-test.yaml"
361+
362+
if [[ -z "${IS_OPENSHIFT}" || "${IS_OPENSHIFT}" == "false" ]]; then
363+
kubectl apply -f "$dir/resources/topology_test/topology-test-ingress.yaml"
364+
else
365+
oc apply -f "$dir/resources/topology_test/topology-test-route.yaml"
366+
fi
367+
365368
}
366369

367370
deploy_test_backstage_customization_provider() {
@@ -514,19 +517,29 @@ cluster_setup_ocp_operator() {
514517

515518
cluster_setup_k8s_operator() {
516519
operator::install_olm
517-
# Tekton not installed for K8s deployments (AKS/EKS/GKE)
518-
# Tekton tests are not executed in showcase-k8s or showcase-rbac-k8s projects
519-
# operator::install_tekton
520+
# Install Tekton Pipelines for K8s deployments (AKS/EKS/GKE) for topology tests to work
521+
operator::install_tekton
520522
# operator::install_postgres_k8s # Works with K8s but disabled in values file
523+
524+
# Wait for Tekton Pipelines to be ready before proceeding
525+
log::info "Waiting for Tekton Pipelines to be ready..."
526+
k8s_wait::deployment "tekton-pipelines" "tekton-pipelines-webhook" 30 10 || return 1
527+
k8s_wait::endpoint "tekton-pipelines-webhook" "tekton-pipelines" 1800 10 || return 1
528+
k8s_wait::crd "pipelines.tekton.dev" 120 5 || return 1
521529
}
522530

523531
cluster_setup_k8s_helm() {
524-
# Tekton not installed for K8s deployments (AKS/EKS/GKE)
525-
# Tekton tests are not executed in showcase-k8s or showcase-rbac-k8s projects
526-
log::info "Skipping Tekton installation for K8s Helm deployment"
532+
# Install Tekton Pipelines for K8s deployments (AKS/EKS/GKE) for topology tests to work
533+
log::info "Installing Tekton Pipelines for K8s Helm deployment"
527534
# operator::install_olm
528-
# operator::install_tekton
535+
operator::install_tekton
529536
# operator::install_postgres_k8s # Works with K8s but disabled in values file
537+
538+
# # Wait for Tekton Pipelines to be ready before proceeding
539+
log::info "Waiting for Tekton Pipelines to be ready..."
540+
k8s_wait::deployment "tekton-pipelines" "tekton-pipelines-webhook" 30 10 || return 1
541+
k8s_wait::endpoint "tekton-pipelines-webhook" "tekton-pipelines" 1800 10 || return 1
542+
k8s_wait::crd "pipelines.tekton.dev" 120 5 || return 1
530543
}
531544

532545
# ==============================================================================

e2e-tests/playwright/e2e/plugins/kubernetes/kubernetes-rbac.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import { KUBERNETES_COMPONENTS } from "../../../support/page-objects/page-obj";
66
import { KubernetesPage } from "../../../support/pages/kubernetes";
77

88
test.describe("Test Kubernetes Plugin", () => {
9-
// TODO: https://issues.redhat.com/browse/RHDHBUGS-2817
10-
test.fixme(() => process.env.IS_OPENSHIFT === "false");
119

1210
let common: Common;
1311
let uiHelper: UIhelper;

e2e-tests/playwright/e2e/plugins/topology/topology-rbac.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import { Catalog } from "../../../support/pages/catalog";
55
import { Topology } from "../../../support/pages/topology";
66

77
test.describe("Test Topology Plugin with RBAC", () => {
8-
// TODO: https://issues.redhat.com/browse/RHDHBUGS-2817
9-
test.fixme(() => process.env.IS_OPENSHIFT === "false");
108

119
let common: Common;
1210
let uiHelper: UIhelper;

e2e-tests/playwright/e2e/plugins/topology/topology.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,7 @@ async function testIngressResources(page: Page, uiHelper: UIhelper) {
119119
.first(),
120120
).toBeVisible();
121121
// Verify code block is visible (pre element containing configuration)
122-
await expect(
123-
page.getByText(/apiVersion:|kind:|metadata:/).first(),
124-
).toBeVisible();
122+
await expect(page.getByText(/rules:/).first()).toBeVisible();
125123
}
126124

127125
async function testRouteResources(page: Page, uiHelper: UIhelper) {

0 commit comments

Comments
 (0)