@@ -13,6 +13,11 @@ teardown() {
13
13
run kubectl delete buildruns.shipwright.io --all
14
14
}
15
15
16
+ <<< <<< < HEAD
17
+ =======
18
+ scheduler_name=" dolphinscheduler"
19
+
20
+ >>>>>>> 3ffe829c (new: add --scheduler-name to build and buildrun)
16
21
@test " shp build create --node-selector single label" {
17
22
# generate random names for our build
18
23
build_name=$( random_name)
@@ -50,6 +55,27 @@ teardown() {
50
55
assert_output --partial ' "kubernetes.io/os":"linux"'
51
56
}
52
57
58
+ <<< <<< < HEAD
59
+ =======
60
+ @test " shp build create --scheduler-name" {
61
+ # generate random names for our build
62
+ build_name=$( random_name)
63
+
64
+ # create a Build with node selector
65
+ run shp build create ${build_name} --source-git-url=https://github.com/shipwright-io/sample-go --output-image=my-fake-image --scheduler-name=${scheduler_name}
66
+ assert_success
67
+
68
+ # ensure that the build was successfully created
69
+ assert_output --partial " Created build \" ${build_name} \" "
70
+
71
+ # get the jsonpath of Build object .spec.nodeSelector
72
+ run kubectl get builds.shipwright.io/${build_name} -ojsonpath=" {.spec.schedulerName}"
73
+ assert_success
74
+
75
+ assert_output " ${scheduler_name} "
76
+ }
77
+
78
+ >>>>>>> 3ffe829c (new: add --scheduler-name to build and buildrun)
53
79
@test " shp buildrun create --node-selector single label" {
54
80
# generate random names for our buildrun
55
81
buildrun_name=$( random_name)
@@ -89,6 +115,28 @@ teardown() {
89
115
assert_output --partial ' "kubernetes.io/os":"linux"'
90
116
}
91
117
118
+ <<< <<< < HEAD
119
+ =======
120
+ @test " shp buildrun create --scheduler-name" {
121
+ # generate random names for our buildrun
122
+ buildrun_name=$( random_name)
123
+ build_name=$( random_name)
124
+
125
+ # create a Build with node selector
126
+ run shp buildrun create ${buildrun_name} --buildref-name=${build_name} --scheduler-name=${scheduler_name}
127
+ assert_success
128
+
129
+ # ensure that the build was successfully created
130
+ assert_output --partial " BuildRun created \" ${buildrun_name} \" for Build \" ${build_name} \" "
131
+
132
+ # get the jsonpath of Build object .spec.nodeSelector
133
+ run kubectl get buildruns.shipwright.io/${buildrun_name} -ojsonpath=" {.spec.schedulerName}"
134
+ assert_success
135
+
136
+ assert_output " ${scheduler_name} "
137
+ }
138
+
139
+ >>>>>>> 3ffe829c (new: add --scheduler-name to build and buildrun)
92
140
93
141
@test " shp build run --node-selector set" {
94
142
# generate random names for our build
@@ -111,4 +159,30 @@ teardown() {
111
159
run kubectl get buildruns.shipwright.io -ojsonpath=' {.items[*].spec.nodeSelector}'
112
160
assert_success
113
161
assert_output --partial ' "kubernetes.io/hostname":"node-1"'
162
+ <<< <<< < HEAD
163
+ =======
164
+ }
165
+
166
+ @test " shp build run --scheduler-name" {
167
+ # generate random names for our build
168
+ build_name=$( random_name)
169
+
170
+ # create a Build with node selector
171
+ run shp build create ${build_name} --source-git-url=https://github.com/shipwright-io/sample-go --output-image=my-fake-image
172
+ assert_success
173
+
174
+ # ensure that the build was successfully created
175
+ assert_output --partial " Created build \" ${build_name} \" "
176
+
177
+ # get the build object
178
+ run kubectl get builds.shipwright.io/${build_name}
179
+ assert_success
180
+
181
+ run shp build run ${build_name} --scheduler-name=${scheduler_name}
182
+
183
+ # get the jsonpath of Build object .spec.nodeSelector
184
+ run kubectl get buildruns.shipwright.io -ojsonpath=' {.items[*].spec.schedulerName}'
185
+ assert_success
186
+ assert_output --partial " ${scheduler_name} "
187
+ >>>>>>> 3ffe829c (new: add --scheduler-name to build and buildrun)
114
188
}
0 commit comments