File tree 4 files changed +68
-2
lines changed
cmd/cluster-version-operator-tests
4 files changed +68
-2
lines changed Original file line number Diff line number Diff line change
1
+ # cluster-version-operator-tests
2
+
3
+ It integrates [ openshift-tests-extension] ( https://github.com/openshift-eng/openshift-tests-extension ) to
4
+ cluster-version-operator which allows openshift components to contribute tests to openshift-tests' suites with
5
+ extension binaries.
6
+
7
+
8
+ ## Run the tests locally
9
+
10
+ ## Using the framework
11
+ ``` console
12
+ $ hack/build-go.sh
13
+ $ _output/< OS> /< ARCH> /cluster-version-operator-tests run-suite cluster-version-operator
14
+ ```
15
+
16
+ ## Using ginko-cli
17
+
18
+ After [ installing-ginkgo] ( https://onsi.github.io/ginkgo/#installing-ginkgo ) :
19
+
20
+ ``` console
21
+ $ ginkgo ./test/...
22
+ ```
23
+
24
+ The output looks nicer this way.
Original file line number Diff line number Diff line change 1
1
package main
2
2
3
3
import (
4
+ "fmt"
4
5
"os"
5
6
6
7
"github.com/spf13/cobra"
7
8
8
9
"github.com/openshift-eng/openshift-tests-extension/pkg/cmd"
9
10
"github.com/openshift-eng/openshift-tests-extension/pkg/extension"
10
- "github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests"
11
+ g "github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo"
12
+
13
+ _ "github.com/openshift/cluster-version-operator/test/cvo"
11
14
)
12
15
13
16
func main () {
14
17
registry := extension .NewRegistry ()
15
18
ext := extension .NewExtension ("openshift" , "payload" , "cluster-version-operator" )
16
19
17
- var specs extensiontests.ExtensionTestSpecs
20
+ ext .AddSuite (extension.Suite {
21
+ Name : "cluster-version-operator" ,
22
+ })
23
+
24
+ // BuildExtensionTestSpecsFromOpenShiftGinkgoSuite is currently available only in the openshift fork of ginkgo
25
+ // See the "replace" directive in go.mod copied from
26
+ // https://github.com/openshift-eng/openshift-tests-extension/blob/8ef37c67e666954f9b95e52320c9c20d6b53d241/go.mod#L37
27
+ specs , err := g .BuildExtensionTestSpecsFromOpenShiftGinkgoSuite ()
28
+ if err != nil {
29
+ panic (fmt .Sprintf ("couldn't build extension test specs from ginkgo: %+v" , err .Error ()))
30
+ }
31
+
18
32
ext .AddSpecs (specs )
19
33
registry .Register (ext )
20
34
Original file line number Diff line number Diff line change
1
+ package cvo
2
+
3
+ import (
4
+ . "github.com/onsi/ginkgo/v2"
5
+ . "github.com/onsi/gomega"
6
+ )
7
+
8
+ // TODO this is a placeholder for the first test
9
+ var _ = Describe ("[cvo-testing] cluster-version-operator-tests" , func () {
10
+ It ("should support passing tests" , func () {
11
+ Expect (true ).To (BeTrue ())
12
+ })
13
+ })
Original file line number Diff line number Diff line change
1
+ // This file is to support running tests with ginkgo-cli:
2
+ // ginkgo ./test/...
3
+ package cvo
4
+
5
+ import (
6
+ "testing"
7
+
8
+ . "github.com/onsi/ginkgo/v2"
9
+ . "github.com/onsi/gomega"
10
+ )
11
+
12
+ func TestGinkgo (t * testing.T ) {
13
+ RegisterFailHandler (Fail )
14
+ RunSpecs (t , "CVO Suite" )
15
+ }
You can’t perform that action at this time.
0 commit comments