@@ -15,7 +15,9 @@ import (
15
15
exutil "github.com/openshift/origin/test/extended/util"
16
16
)
17
17
18
- type SampleRepoConfig struct {
18
+ var htmlCountValueNonZeroRegexp = `<span class="code" id="count-value">[^0][0-9]*</span>`
19
+
20
+ type sampleRepoConfig struct {
19
21
repoName string
20
22
templateURL string
21
23
buildConfigName string
@@ -30,7 +32,7 @@ type SampleRepoConfig struct {
30
32
// NewSampleRepoTest creates a function for a new ginkgo test case that will instantiate a template
31
33
// from a url, kick off the buildconfig defined in that template, wait for the build/deploy,
32
34
// and then confirm the application is serving an expected string value.
33
- func NewSampleRepoTest (c SampleRepoConfig ) func () {
35
+ func NewSampleRepoTest (c sampleRepoConfig ) func () {
34
36
return func () {
35
37
defer g .GinkgoRecover ()
36
38
var oc = exutil .NewCLI (c .repoName + "-repo-test" , exutil .KubeConfigPath ())
@@ -114,7 +116,7 @@ func NewSampleRepoTest(c SampleRepoConfig) func() {
114
116
e2e .Logf ("url check got %s, expected it to contain %s" , response , c .expectedString )
115
117
return false , nil
116
118
})
117
- o .Expect (response ).Should (o .ContainSubstring (c .expectedString ))
119
+ o .Expect (response ).Should (o .MatchRegexp (c .expectedString ))
118
120
})
119
121
})
120
122
})
@@ -124,129 +126,129 @@ func NewSampleRepoTest(c SampleRepoConfig) func() {
124
126
var _ = g .Describe ("[image_ecosystem][Slow] openshift sample application repositories" , func () {
125
127
126
128
g .Describe ("[image_ecosystem][ruby] test ruby images with rails-ex db repo" , NewSampleRepoTest (
127
- SampleRepoConfig {
128
- "rails-postgresql" ,
129
- "https://raw.githubusercontent.com/openshift/rails-ex/master/openshift/templates/rails-postgresql.json" ,
130
- "rails-postgresql-example" ,
131
- "rails-postgresql-example" ,
132
- "rails-postgresql-example" ,
133
- "Listing articles" ,
134
- "/articles" ,
135
- "postgresql" ,
136
- "postgresql" ,
129
+ sampleRepoConfig {
130
+ repoName : "rails-postgresql" ,
131
+ templateURL : "https://raw.githubusercontent.com/openshift/rails-ex/master/openshift/templates/rails-postgresql.json" ,
132
+ buildConfigName : "rails-postgresql-example" ,
133
+ serviceName : "rails-postgresql-example" ,
134
+ deploymentConfigName : "rails-postgresql-example" ,
135
+ expectedString : "Listing articles" ,
136
+ appPath : "/articles" ,
137
+ dbDeploymentConfigName : "postgresql" ,
138
+ dbServiceName : "postgresql" ,
137
139
},
138
140
))
139
141
140
142
g .Describe ("[image_ecosystem][python] test python images with django-ex db repo" , NewSampleRepoTest (
141
- SampleRepoConfig {
142
- "django-psql" ,
143
- "https://raw.githubusercontent.com/openshift/django-ex/master/openshift/templates/django-postgresql.json" ,
144
- "django-psql-example" ,
145
- "django-psql-example" ,
146
- "django-psql-example" ,
147
- "Page views: 1" ,
148
- "" ,
149
- "postgresql" ,
150
- "postgresql" ,
143
+ sampleRepoConfig {
144
+ repoName : "django-psql" ,
145
+ templateURL : "https://raw.githubusercontent.com/openshift/django-ex/master/openshift/templates/django-postgresql.json" ,
146
+ buildConfigName : "django-psql-example" ,
147
+ serviceName : "django-psql-example" ,
148
+ deploymentConfigName : "django-psql-example" ,
149
+ expectedString : "Page views: 1" ,
150
+ appPath : "" ,
151
+ dbDeploymentConfigName : "postgresql" ,
152
+ dbServiceName : "postgresql" ,
151
153
},
152
154
))
153
155
154
156
g .Describe ("[image_ecosystem][nodejs] test nodejs images with nodejs-ex db repo" , NewSampleRepoTest (
155
- SampleRepoConfig {
156
- "nodejs-mongodb" ,
157
- "https://raw.githubusercontent.com/openshift/nodejs-ex/master/openshift/templates/nodejs-mongodb.json" ,
158
- "nodejs-mongodb-example" ,
159
- "nodejs-mongodb-example" ,
160
- "nodejs-mongodb-example" ,
161
- "<span class= \" code \" id= \" count-value \" >1</span>" ,
162
- "" ,
163
- "mongodb" ,
164
- "mongodb" ,
157
+ sampleRepoConfig {
158
+ repoName : "nodejs-mongodb" ,
159
+ templateURL : "https://raw.githubusercontent.com/openshift/nodejs-ex/master/openshift/templates/nodejs-mongodb.json" ,
160
+ buildConfigName : "nodejs-mongodb-example" ,
161
+ serviceName : "nodejs-mongodb-example" ,
162
+ deploymentConfigName : "nodejs-mongodb-example" ,
163
+ expectedString : htmlCountValueNonZeroRegexp ,
164
+ appPath : "" ,
165
+ dbDeploymentConfigName : "mongodb" ,
166
+ dbServiceName : "mongodb" ,
165
167
},
166
168
))
167
169
168
170
var _ = g .Describe ("[image_ecosystem][php] test php images with cakephp-ex db repo" , NewSampleRepoTest (
169
- SampleRepoConfig {
170
- "cakephp-mysql" ,
171
- "https://raw.githubusercontent.com/openshift/cakephp-ex/master/openshift/templates/cakephp-mysql.json" ,
172
- "cakephp-mysql-example" ,
173
- "cakephp-mysql-example" ,
174
- "cakephp-mysql-example" ,
175
- "<span class= \" code \" id= \" count-value \" >1</span>" ,
176
- "" ,
177
- "mysql" ,
178
- "mysql" ,
171
+ sampleRepoConfig {
172
+ repoName : "cakephp-mysql" ,
173
+ templateURL : "https://raw.githubusercontent.com/openshift/cakephp-ex/master/openshift/templates/cakephp-mysql.json" ,
174
+ buildConfigName : "cakephp-mysql-example" ,
175
+ serviceName : "cakephp-mysql-example" ,
176
+ deploymentConfigName : "cakephp-mysql-example" ,
177
+ expectedString : htmlCountValueNonZeroRegexp ,
178
+ appPath : "" ,
179
+ dbDeploymentConfigName : "mysql" ,
180
+ dbServiceName : "mysql" ,
179
181
},
180
182
))
181
183
182
184
var _ = g .Describe ("[image_ecosystem][perl] test perl images with dancer-ex db repo" , NewSampleRepoTest (
183
- SampleRepoConfig {
184
- "dancer-mysql" ,
185
- "https://raw.githubusercontent.com/openshift/dancer-ex/master/openshift/templates/dancer-mysql.json" ,
186
- "dancer-mysql-example" ,
187
- "dancer-mysql-example" ,
188
- "dancer-mysql-example" ,
189
- "<span class= \" code \" id= \" count-value \" >1</span>" ,
190
- "" ,
191
- "database" ,
192
- "database" ,
185
+ sampleRepoConfig {
186
+ repoName : "dancer-mysql" ,
187
+ templateURL : "https://raw.githubusercontent.com/openshift/dancer-ex/master/openshift/templates/dancer-mysql.json" ,
188
+ buildConfigName : "dancer-mysql-example" ,
189
+ serviceName : "dancer-mysql-example" ,
190
+ deploymentConfigName : "dancer-mysql-example" ,
191
+ expectedString : htmlCountValueNonZeroRegexp ,
192
+ appPath : "" ,
193
+ dbDeploymentConfigName : "database" ,
194
+ dbServiceName : "database" ,
193
195
},
194
196
))
195
197
196
198
// test the no-db templates too
197
199
g .Describe ("[image_ecosystem][python] test python images with django-ex repo" , NewSampleRepoTest (
198
- SampleRepoConfig {
199
- "django" ,
200
- "https://raw.githubusercontent.com/openshift/django-ex/master/openshift/templates/django.json" ,
201
- "django-example" ,
202
- "django-example" ,
203
- "django-example" ,
204
- "Welcome" ,
205
- "" ,
206
- "" ,
207
- "" ,
200
+ sampleRepoConfig {
201
+ repoName : "django" ,
202
+ templateURL : "https://raw.githubusercontent.com/openshift/django-ex/master/openshift/templates/django.json" ,
203
+ buildConfigName : "django-example" ,
204
+ serviceName : "django-example" ,
205
+ deploymentConfigName : "django-example" ,
206
+ expectedString : "Welcome" ,
207
+ appPath : "" ,
208
+ dbDeploymentConfigName : "" ,
209
+ dbServiceName : "" ,
208
210
},
209
211
))
210
212
211
213
g .Describe ("[image_ecosystem][nodejs] images with nodejs-ex repo" , NewSampleRepoTest (
212
- SampleRepoConfig {
213
- "nodejs" ,
214
- "https://raw.githubusercontent.com/openshift/nodejs-ex/master/openshift/templates/nodejs.json" ,
215
- "nodejs-example" ,
216
- "nodejs-example" ,
217
- "nodejs-example" ,
218
- "Welcome" ,
219
- "" ,
220
- "" ,
221
- "" ,
214
+ sampleRepoConfig {
215
+ repoName : "nodejs" ,
216
+ templateURL : "https://raw.githubusercontent.com/openshift/nodejs-ex/master/openshift/templates/nodejs.json" ,
217
+ buildConfigName : "nodejs-example" ,
218
+ serviceName : "nodejs-example" ,
219
+ deploymentConfigName : "nodejs-example" ,
220
+ expectedString : "Welcome" ,
221
+ appPath : "" ,
222
+ dbDeploymentConfigName : "" ,
223
+ dbServiceName : "" ,
222
224
},
223
225
))
224
226
225
227
var _ = g .Describe ("[image_ecosystem][php] test php images with cakephp-ex repo" , NewSampleRepoTest (
226
- SampleRepoConfig {
227
- "cakephp" ,
228
- "https://raw.githubusercontent.com/openshift/cakephp-ex/master/openshift/templates/cakephp.json" ,
229
- "cakephp-example" ,
230
- "cakephp-example" ,
231
- "cakephp-example" ,
232
- "Welcome" ,
233
- "" ,
234
- "" ,
235
- "" ,
228
+ sampleRepoConfig {
229
+ repoName : "cakephp" ,
230
+ templateURL : "https://raw.githubusercontent.com/openshift/cakephp-ex/master/openshift/templates/cakephp.json" ,
231
+ buildConfigName : "cakephp-example" ,
232
+ serviceName : "cakephp-example" ,
233
+ deploymentConfigName : "cakephp-example" ,
234
+ expectedString : "Welcome" ,
235
+ appPath : "" ,
236
+ dbDeploymentConfigName : "" ,
237
+ dbServiceName : "" ,
236
238
},
237
239
))
238
240
239
241
var _ = g .Describe ("[image_ecosystem][perl] test perl images with dancer-ex repo" , NewSampleRepoTest (
240
- SampleRepoConfig {
241
- "dancer" ,
242
- "https://raw.githubusercontent.com/openshift/dancer-ex/master/openshift/templates/dancer.json" ,
243
- "dancer-example" ,
244
- "dancer-example" ,
245
- "dancer-example" ,
246
- "Welcome" ,
247
- "" ,
248
- "" ,
249
- "" ,
242
+ sampleRepoConfig {
243
+ repoName : "dancer" ,
244
+ templateURL : "https://raw.githubusercontent.com/openshift/dancer-ex/master/openshift/templates/dancer.json" ,
245
+ buildConfigName : "dancer-example" ,
246
+ serviceName : "dancer-example" ,
247
+ deploymentConfigName : "dancer-example" ,
248
+ expectedString : "Welcome" ,
249
+ appPath : "" ,
250
+ dbDeploymentConfigName : "" ,
251
+ dbServiceName : "" ,
250
252
},
251
253
))
252
254
0 commit comments