-
Notifications
You must be signed in to change notification settings - Fork 355
Mark openshift & xKS e2e tests #1216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
38ea8a1
aad3603
0889af7
90e3e2c
d56fb8c
dbcc49c
fdd6101
dcb7a8a
697e653
772ee9f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| kind: Cluster | ||
| apiVersion: kind.x-k8s.io/v1alpha4 | ||
| nodes: | ||
| - role: control-plane | ||
| - role: worker | ||
| - role: worker |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -94,6 +94,56 @@ SKIP_HA_TESTS=true LOCAL_RUN=true make e2e-tests-sequential-ginkgo | |
|
|
||
|
|
||
|
|
||
| ## Test Labels | ||
|
|
||
| Ginkgo [labels](https://onsi.github.io/ginkgo/#spec-labels) are used to categorize tests that are only supported on specific platforms or configurations. Labels allow the CI system to filter tests using `--label-filter` at runtime. | ||
|
|
||
| **Important**: Labels should only be applied to tests that are restricted to a specific platform or configuration. Do NOT add labels to generic tests that can run on any Kubernetes cluster (OpenShift, KinD, EKS, etc.). If a test works everywhere, it should remain unlabelled. | ||
|
|
||
| ### Available labels | ||
|
|
||
| | Label | Meaning | When to use | | ||
| |-------|---------|-------------| | ||
| | `openshfit` | Test requires OpenShift-specific features (Routes, ConsoleLinks, OLM Subscriptions, SCCs, etc.) and cannot run on vanilla Kubernetes (KinD, EKS, GKE, AKS). | Add when the test depends on OpenShift APIs or resources not available on non-OCP clusters. | | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Fix the typo in the OpenShift label name across all documentation and tests. The label is consistently misspelled as
🧰 Tools🪛 LanguageTool[grammar] ~107-~107: Ensure spelling is correct (QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1) 📍 Affects 8 files
🤖 Prompt for AI AgentsSource: Linked repositories |
||
| | `HA` | Test requires a cluster with at least 3 worker nodes for HA (High Availability) validation. | Add when the test creates HA Redis StatefulSets or validates pod anti-affinity across nodes. | | ||
| | `conversionWebhook` | Test requires the ArgoCD v1alpha1 ↔ v1beta1 conversion webhook to be running. | Add when the test exercises CRD conversion between API versions. | | ||
|
|
||
| ### How labels are used in CI | ||
|
|
||
| - **OpenShift CI**: Runs all tests (no label filter), so all labelled and unlabelled tests execute. | ||
| - **xKS/KinD CI** (`make e2e-xks-tests-sequential-ginkgo` / `make e2e-xks-tests-parallel-ginkgo`): Uses `--label-filter="!openshfit"` to exclude OpenShift-only tests. The `XKS_LABEL_FILTER` env var can further customize filtering (e.g., `XKS_LABEL_FILTER="!openshfit && !HA"`). | ||
|
|
||
| ### How to apply a label | ||
|
|
||
| Add the `Label(...)` decorator to `It`, `Context`, or `Describe` nodes: | ||
|
|
||
| ```go | ||
| // Single label — test requires OpenShift | ||
| It("verifies ConsoleLink is created for ArgoCD route", Label("openshfit"), func() { | ||
| // ... | ||
| }) | ||
|
|
||
| // Multiple labels — test requires OpenShift AND conversion webhook | ||
| It("verifies v1beta1 to v1alpha1 conversion", Label("conversionWebhook", "openshfit"), func() { | ||
| // ... | ||
| }) | ||
|
|
||
| // Label on Context — all specs inside inherit the label | ||
| Context("1-120_repo_server_system_ca_trust", Label("openshfit"), func() { | ||
| It("ensures that missing Secret aborts startup", func() { | ||
| // ... | ||
| }) | ||
| }) | ||
| ``` | ||
|
|
||
| ### Guidelines | ||
|
|
||
| - If your test uses OpenShift-specific resources (Routes, ConsoleLinks, SCCs, Subscriptions, CSVs, monitoring via prometheus-operator CRDs that are only present on OCP, etc.), add `Label("openshfit")`. | ||
| - If your test requires 3+ nodes for HA validation, add `Label("HA")`. | ||
| - If your test works on any conformant Kubernetes cluster, do NOT add any label. | ||
| - When in doubt, leave the test unlabelled — it will run everywhere, which provides broader coverage. | ||
|
|
||
|
|
||
| ## Test Code | ||
|
|
||
| gitops-operator E2E tests are defined within `test/openshift/e2e/ginkgo`. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.