Skip to content

Commit d2986dc

Browse files
author
Sean Kelly
committed
Add language to the tests
1 parent a3abeb0 commit d2986dc

File tree

1 file changed

+52
-40
lines changed

1 file changed

+52
-40
lines changed

buildbot_travis/tests/test_travisyml.py

Lines changed: 52 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ def test_singleenv(self):
104104

105105
self.t.parse_matrix()
106106
self.assertEqual(
107-
self.t.matrix, [dict(python="2.7", env=dict(FOO='1', BAR='2'), os='linux', dist='precise'), ])
107+
self.t.matrix, [dict(python="2.7", env=dict(FOO='1', BAR='2'),
108+
os='linux', dist='precise', language='python'), ])
108109

109110
def test_multienv(self):
110111
self.t.config["env"] = ["FOO=1 BAR=2", "FOO=2 BAR=1"]
@@ -114,8 +115,10 @@ def test_multienv(self):
114115

115116
self.t.parse_matrix()
116117
self.assertEqual(self.t.matrix, [
117-
dict(python="2.7", env=dict(FOO='1', BAR='2'), os='linux', dist='precise'),
118-
dict(python="2.7", env=dict(FOO='2', BAR='1'), os='linux', dist='precise'),
118+
dict(python="2.7", env=dict(FOO='1', BAR='2'), os='linux',
119+
dist='precise', language='python'),
120+
dict(python="2.7", env=dict(FOO='2', BAR='1'), os='linux',
121+
dist='precise', language='python'),
119122
])
120123

121124
def test_globalenv(self):
@@ -126,8 +129,10 @@ def test_globalenv(self):
126129

127130
self.t.parse_matrix()
128131
self.assertEqual(self.t.matrix, [
129-
dict(python="2.7", env=dict(FOOBAR='0', FOO='1', BAR='2'), os='linux', dist='precise'),
130-
dict(python="2.7", env=dict(FOOBAR='0', FOO='2', BAR='1'), os='linux', dist='precise'),
132+
dict(python="2.7", env=dict(FOOBAR='0', FOO='1', BAR='2'),
133+
os='linux', dist='precise', language='python'),
134+
dict(python="2.7", env=dict(FOOBAR='0', FOO='2', BAR='1'),
135+
os='linux', dist='precise', language='python'),
131136
])
132137

133138
def test_emptymatrixlenv(self):
@@ -138,7 +143,8 @@ def test_emptymatrixlenv(self):
138143

139144
self.t.parse_matrix()
140145
self.assertEqual(self.t.matrix, [
141-
dict(python="2.7", env=dict(FOOBAR='0'), os='linux', dist='precise'),
146+
dict(python="2.7", env=dict(FOOBAR='0'), os='linux',
147+
dist='precise', language='python'),
142148
])
143149

144150

@@ -148,16 +154,16 @@ def test_default_language(self):
148154
matrix = self.t._build_matrix()
149155

150156
self.failUnlessEqual(matrix, [
151-
dict(python="2.7"),
157+
dict(language='python', python="2.7"),
152158
])
153159

154160
def test_default_multiple_options(self):
155161
self.t.config["python"] = ['2.7', '3.5']
156162
matrix = self.t._build_matrix()
157163

158164
self.failUnlessEqual(matrix, [
159-
dict(python="2.7"),
160-
dict(python="3.5"),
165+
dict(language='python', python="2.7"),
166+
dict(language='python', python="3.5"),
161167
])
162168

163169
def test_language_with_dict(self):
@@ -172,7 +178,7 @@ def test_language_with_dict(self):
172178
matrix = self.t._build_matrix()
173179

174180
self.failUnlessEqual(matrix, [
175-
dict(compiler='gcc'),
181+
dict(compiler='gcc', language='c'),
176182
])
177183

178184
# Now try again with multiple compilers to use.
@@ -181,9 +187,9 @@ def test_language_with_dict(self):
181187
matrix = self.t._build_matrix()
182188

183189
self.failUnlessEqual(matrix, [
184-
dict(compiler='gcc'),
185-
dict(compiler='clang'),
186-
dict(compiler='cc'),
190+
dict(compiler='gcc', language='c'),
191+
dict(compiler='clang', language='c'),
192+
dict(compiler='cc', language='c'),
187193
])
188194

189195
def test_language_multiple_options(self):
@@ -202,7 +208,7 @@ def test_language_multiple_options(self):
202208
matrix = self.t._build_matrix()
203209

204210
self.failUnlessEqual(matrix, [
205-
dict(gemfile='Gemfile', jdk='openjdk7', rvm='2.2'),
211+
dict(gemfile='Gemfile', jdk='openjdk7', rvm='2.2', language='ruby'),
206212
])
207213

208214
# Start exploding the matrix
@@ -211,58 +217,58 @@ def test_language_multiple_options(self):
211217
matrix = self.t._build_matrix()
212218

213219
self.failUnlessEqual(matrix, [
214-
dict(gemfile='Gemfile', jdk='openjdk7', rvm='2.2'),
215-
dict(gemfile='gemfiles/a', jdk='openjdk7', rvm='2.2'),
220+
dict(gemfile='Gemfile', jdk='openjdk7', rvm='2.2', language='ruby'),
221+
dict(gemfile='gemfiles/a', jdk='openjdk7', rvm='2.2', language='ruby'),
216222
])
217223

218224
self.t.config["rvm"] = ['2.2', 'jruby']
219225

220226
matrix = self.t._build_matrix()
221227

222228
self.failUnlessEqual(matrix, [
223-
dict(gemfile='Gemfile', jdk='openjdk7', rvm='2.2'),
224-
dict(gemfile='Gemfile', jdk='openjdk7', rvm='jruby'),
225-
dict(gemfile='gemfiles/a', jdk='openjdk7', rvm='2.2'),
226-
dict(gemfile='gemfiles/a', jdk='openjdk7', rvm='jruby'),
229+
dict(gemfile='Gemfile', jdk='openjdk7', rvm='2.2', language='ruby'),
230+
dict(gemfile='Gemfile', jdk='openjdk7', rvm='jruby', language='ruby'),
231+
dict(gemfile='gemfiles/a', jdk='openjdk7', rvm='2.2', language='ruby'),
232+
dict(gemfile='gemfiles/a', jdk='openjdk7', rvm='jruby', language='ruby'),
227233
])
228234

229235
self.t.config["jdk"] = ['openjdk7', 'oraclejdk7']
230236

231237
matrix = self.t._build_matrix()
232238

233239
self.failUnlessEqual(matrix, [
234-
dict(gemfile='Gemfile', jdk='openjdk7', rvm='2.2'),
235-
dict(gemfile='Gemfile', jdk='openjdk7', rvm='jruby'),
236-
dict(gemfile='Gemfile', jdk='oraclejdk7', rvm='2.2'),
237-
dict(gemfile='Gemfile', jdk='oraclejdk7', rvm='jruby'),
238-
dict(gemfile='gemfiles/a', jdk='openjdk7', rvm='2.2'),
239-
dict(gemfile='gemfiles/a', jdk='openjdk7', rvm='jruby'),
240-
dict(gemfile='gemfiles/a', jdk='oraclejdk7', rvm='2.2'),
241-
dict(gemfile='gemfiles/a', jdk='oraclejdk7', rvm='jruby'),
240+
dict(gemfile='Gemfile', jdk='openjdk7', rvm='2.2', language='ruby'),
241+
dict(gemfile='Gemfile', jdk='openjdk7', rvm='jruby', language='ruby'),
242+
dict(gemfile='Gemfile', jdk='oraclejdk7', rvm='2.2', language='ruby'),
243+
dict(gemfile='Gemfile', jdk='oraclejdk7', rvm='jruby', language='ruby'),
244+
dict(gemfile='gemfiles/a', jdk='openjdk7', rvm='2.2', language='ruby'),
245+
dict(gemfile='gemfiles/a', jdk='openjdk7', rvm='jruby', language='ruby'),
246+
dict(gemfile='gemfiles/a', jdk='oraclejdk7', rvm='2.2', language='ruby'),
247+
dict(gemfile='gemfiles/a', jdk='oraclejdk7', rvm='jruby', language='ruby'),
242248
])
243249

244250

245251
class TestOsMatrix(TravisYmlTestCase):
246252

247253
def test_os_matrix(self):
248-
build_matrix = [dict(python='2.7')]
254+
build_matrix = [dict(language='python', python='2.7')]
249255

250256
matrix = self.t._os_matrix(build_matrix)
251257

252258
self.failUnlessEqual(matrix, [
253-
dict(os='linux', dist='precise', python='2.7')
259+
dict(os='linux', dist='precise', language='python', python='2.7')
254260
])
255261

256262
def test_multiple_dists(self):
257-
build_matrix = [dict(python='2.7')]
263+
build_matrix = [dict(language='python', python='2.7')]
258264
self.t.config["dist"] = ["precise", "trusty", "xenial"]
259265

260266
matrix = self.t._os_matrix(build_matrix)
261267

262268
self.failUnlessEqual(matrix, [
263-
dict(os='linux', dist='precise', python='2.7'),
264-
dict(os='linux', dist='trusty', python='2.7'),
265-
dict(os='linux', dist='xenial', python='2.7'),
269+
dict(os='linux', dist='precise', language='python', python='2.7'),
270+
dict(os='linux', dist='trusty', language='python', python='2.7'),
271+
dict(os='linux', dist='xenial', language='python', python='2.7'),
266272
])
267273

268274

@@ -277,7 +283,8 @@ def test_exclude_match(self):
277283
self.t.parse_matrix()
278284

279285
self.assertEqual(self.t.matrix, [
280-
dict(python="2.7", env=dict(FOO='1', BAR='2'), os='linux', dist='precise'),
286+
dict(python="2.7", env=dict(FOO='1', BAR='2'), os='linux',
287+
dist='precise', language='python'),
281288
])
282289

283290
def test_exclude_subset_match(self):
@@ -289,7 +296,8 @@ def test_exclude_subset_match(self):
289296
self.t.parse_matrix()
290297

291298
self.assertEqual(self.t.matrix, [
292-
dict(python="2.7", env=dict(FOO='1', BAR='2'), os='linux', dist='precise'),
299+
dict(python="2.7", env=dict(FOO='1', BAR='2'), os='linux',
300+
dist='precise', language='python'),
293301
])
294302

295303
def test_exclude_nomatch(self):
@@ -301,8 +309,10 @@ def test_exclude_nomatch(self):
301309
self.t.parse_matrix()
302310

303311
self.assertEqual(self.t.matrix, [
304-
dict(python="2.7", env=dict(FOO='1', BAR='2'), os='linux', dist='precise'),
305-
dict(python="2.7", env=dict(FOO='2', BAR='1'), os='linux', dist='precise'),
312+
dict(python="2.7", env=dict(FOO='1', BAR='2'), os='linux',
313+
dist='precise', language='python'),
314+
dict(python="2.7", env=dict(FOO='2', BAR='1'), os='linux',
315+
dist='precise', language='python'),
306316
])
307317

308318
def test_include(self):
@@ -314,8 +324,10 @@ def test_include(self):
314324
self.t.parse_matrix()
315325

316326
self.assertEqual(self.t.matrix, [
317-
dict(python="2.7", env=dict(FOO='1', BAR='2'), os='linux', dist='precise'),
318-
dict(python="2.7", env=dict(FOO='2', BAR='1'), os='linux', dist='precise'),
327+
dict(python="2.7", env=dict(FOO='1', BAR='2'), os='linux',
328+
dist='precise', language='python'),
329+
dict(python="2.7", env=dict(FOO='2', BAR='1'), os='linux',
330+
dist='precise', language='python'),
319331
dict(python="2.7", env=dict(FOO='2', BAR='3')),
320332
])
321333

0 commit comments

Comments
 (0)