File tree Expand file tree Collapse file tree 3 files changed +28
-4
lines changed Expand file tree Collapse file tree 3 files changed +28
-4
lines changed Original file line number Diff line number Diff line change 1
1
# Image URL to use all building/pushing image targets
2
2
IMG ?= controller:latest
3
+
3
4
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
4
5
ENVTEST_K8S_VERSION = 1.31.0
5
6
@@ -77,7 +78,7 @@ test-e2e: manifests generate fmt vet ## Run the e2e tests. Expected an isolated
77
78
echo " No Kind cluster is running. Please start a Kind cluster before running the e2e tests." ; \
78
79
exit 1; \
79
80
}
80
- go test ./test/e2e/ -v -ginkgo.v
81
+ go test ./test/e2e/ -v -ginkgo.v -args -controller-image= ${IMG}
81
82
82
83
.PHONY : lint
83
84
lint : golangci-lint # # Run golangci-lint linter
Original file line number Diff line number Diff line change @@ -49,6 +49,18 @@ kubectl apply -k config/samples/
49
49
50
50
> ** NOTE** : Ensure that the samples has default values to test it out.
51
51
52
+ ** Run the e2e tests**
53
+
54
+ ``` sh
55
+ make test-e2e
56
+ ```
57
+
58
+ If you would like to run the tests with a given image, use the IMG parameter:
59
+
60
+ ``` sh
61
+ make test-e2e IMG=< some-registry> /workspace-controller:tag
62
+ ```
63
+
52
64
### To Uninstall
53
65
** Delete the instances (CRs) from the cluster:**
54
66
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ limitations under the License.
17
17
package e2e
18
18
19
19
import (
20
+ "flag"
20
21
"fmt"
21
22
"os/exec"
22
23
"path/filepath"
@@ -34,8 +35,8 @@ import (
34
35
35
36
const (
36
37
// controller configs
37
- controllerNamespace = "workspace-controller-system"
38
- controllerImage = "ghcr.io/kubeflow/notebooks/workspace-controller:latest"
38
+ controllerNamespace = "workspace-controller-system"
39
+ defaultControllerImage = "ghcr.io/kubeflow/notebooks/workspace-controller:latest"
39
40
40
41
// workspace configs
41
42
workspaceNamespace = "workspace-test"
@@ -60,13 +61,23 @@ const (
60
61
)
61
62
62
63
var (
63
- projectDir = ""
64
+ projectDir = ""
65
+ controllerImage = ""
64
66
)
65
67
68
+ func init () {
69
+ flag .StringVar (& controllerImage , "controller-image" ,
70
+ defaultControllerImage , "Workspace controller image to use for the test" )
71
+ }
72
+
66
73
var _ = Describe ("controller" , Ordered , func () {
67
74
68
75
BeforeAll (func () {
69
76
projectDir , _ = utils .GetProjectDir ()
77
+ // This ensures flags are parsed before tests run
78
+ if ! flag .Parsed () {
79
+ flag .Parse ()
80
+ }
70
81
71
82
By ("creating the controller namespace" )
72
83
cmd := exec .Command ("kubectl" , "create" , "ns" , controllerNamespace )
You can’t perform that action at this time.
0 commit comments