Skip to content

Commit 7cc84ff

Browse files
Merge pull request #1336 from jiajliu/tag_mapping
NO-JIRA: Add test migration guide for openshift-tests-private to CVO
2 parents a509210 + edc6736 commit 7cc84ff

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

cmd/cluster-version-operator-tests/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,48 @@ The output looks nicer this way.
4343

4444
See [docs](https://github.com/openshift/origin/tree/main/test/extended#test-labels) for details.
4545

46+
### Migrating from Custom Tags
47+
48+
When migrating cvo tests from [openshift-tests-private](https://github.com/openshift/openshift-tests-private/blob/main/test/extended/ota/cvo/cvo.go) that use custom-defined tags (based on OTP naming rule), use the following mapping to align with upstream test label conventions:
49+
50+
| Custom Tag | Action | Reason | New Label |
51+
|------------|--------|--------|-----------|
52+
| `NonPreRelease` | Drop | CI-scheduling concern, handled by job config in openshift-e2e-test, not by in-name tags | (none) |
53+
| `Longduration` | Replace | Upstream equivalent is `[Slow]` (test >5 min). Add `[Slow]` if not already present | `[Slow]` |
54+
| `ConnectedOnly` | Drop | Infrastructure constraint, not a test label. Handle via programmatic skip in test code (e.g., check connectivity and `g.Skip()`) | (runtime skip) |
55+
| `NonHyperShiftHOST` | Drop | Topology constraint, not a test label. Handle via programmatic skip in test code (e.g., detect HyperShift and `g.Skip()`) | (runtime skip) |
56+
| `[Serial]` | Keep | Standard upstream label | `[Serial]` |
57+
| `[Slow]` | Keep | Standard upstream label | `[Slow]` |
58+
| `[Disruptive]` | Keep | Standard upstream label (implies `[Serial]`) | `[Disruptive]` |
59+
60+
**Note**:
61+
- For infrastructure and topology constraints like `ConnectedOnly` and `NonHyperShiftHOST`, implement runtime skips like [utility functions](https://github.com/openshift/cluster-version-operator/blob/f25054a5800a34e3fd596b5d9a2c6c1bb5f5f628/test/cvo/cvo.go#L63-L66) to detect cluster type and skip appropriately.
62+
- The custom `author`, `priority`, and `caseID` fields are not migrated as they are not standard upstream labels.
63+
64+
#### Handling Dropped Fields
65+
66+
If we need to organize tests in ways that the standard test suites don't support, we can use Ginkgo labels to create custom test suites.
67+
68+
To create a custom test suite based on labels:
69+
70+
1. **Define the suite** in [main.go](main.go) by adding an `ext.AddSuite()` call with CEL qualifiers:
71+
```go
72+
ext.AddSuite(extension.Suite{
73+
Name: "openshift/cluster-version-operator/characteristicA",
74+
Qualifiers: []string{
75+
`"characteristicA" in labels`,
76+
},
77+
})
78+
```
79+
80+
2. **Label the tests** using `g.Label()` in the test definitions:
81+
```go
82+
g.It("should do something", g.Label("characteristicA"), func(ctx g.SpecContext) {
83+
// test code
84+
})
85+
```
86+
87+
4688
### Ownership
4789

4890
* A `[Jira:"Component"]` tag in the test name (e.g., [Jira:"Cluster Version Operator"]) is preferred to claim the ownership of the test. The component comes from [the list of components of Jira Project OCPBUGS](https://issues.redhat.com/projects/OCPBUGS?selectedItem=com.atlassian.jira.jira-projects-plugin:components-page). See [here](https://github.com/openshift/origin/blob/6b584254d53cdd1b5cd6471b69cb7c22f3e28ecd/test/extended/apiserver/rollout.go#L36) for example.

0 commit comments

Comments
 (0)