Skip to content

Commit e8a192b

Browse files
committed
NO-JIRA: Clarify test names in OTE
This pull add a section to clarify test names in OTE. It modifies `hack/update-test-metadata.sh` to give a hint of what to do to fix the issue.
1 parent 420e6d0 commit e8a192b

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed

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

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,40 @@ After [installing-ginkgo](https://onsi.github.io/ginkgo/#installing-ginkgo):
2121
$ ginkgo ./test/...
2222
```
2323

24-
The output looks nicer this way.
24+
The output looks nicer this way.
25+
26+
27+
## Test Names
28+
29+
### Test labels
30+
31+
See [docs](https://github.com/openshift/origin/tree/main/test/extended#test-labels) for details.
32+
33+
### Ownership
34+
35+
* 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.
36+
37+
* Or an entry in the [ci-test-mapping](https://github.com/openshift-eng/ci-test-mapping) repository, which maps tests to owning components. See [here](https://github.com/openshift-eng/ci-test-mapping/tree/main/pkg/components/clusterversionoperator) for example.
38+
39+
### Renaming
40+
41+
If a test is renamed, claim it with [specs.Walk](https://pkg.go.dev/github.com/openshift-eng/[email protected]/pkg/extension/extensiontests#ExtensionTestSpecs.Walk):
42+
43+
```go
44+
specs = specs.Walk(func(spec *et.ExtensionTestSpec) {
45+
if orig, ok := renamedTests[spec.Name]; ok {
46+
spec.OriginalName = orig
47+
}
48+
})
49+
```
50+
51+
### Deleting
52+
53+
If a test is renamed, claim it with [ext.IgnoreObsoleteTests](https://pkg.go.dev/github.com/openshift-eng/[email protected]/pkg/extension#Extension.IgnoreObsoleteTests)
54+
55+
```go
56+
ext.IgnoreObsoleteTests(
57+
"[sig-abc] My removed test",
58+
// Add more removed test names below
59+
)
60+
```

hack/update-test-metadata.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@ set -eu
55
source hack/build-info.sh
66

77
# Update test metadata
8-
eval "${BIN_PATH}/cluster-version-operator-tests" "update"
8+
if ! "${BIN_PATH}/cluster-version-operator-tests" "update"; then
9+
>&2 echo "run 'make update' to fix the metadata after going through the teest renaming process.
10+
See https://github.com/openshift/cluster-version-operator/blob/main/cmd/cluster-version-operator-tests/README.md#test-names for details."
11+
exit 1
12+
fi

0 commit comments

Comments
 (0)