Browse Source

test: support voluptuous 7.0+

Voluptuous 0.7.0 introduced a backward API incompatible change in
upstream commit 475adebc:

  https://github.com/alecthomas/voluptuous/commit/475adebc

The schema are precompiled and the validate_X have been removed,
voluptuous is now smart enough to detect the type of value being
validated and would call an internal validation method matching the
type.

Commit is contained since 0.7.0:

 $ git tag --contains 475adebc
 0.7.0
 0.7.1
 0.7.2
 0.8.1
 0.8.2
 $

I tested it using etc/layout.yaml-sample and added an inexistent
pipeline to the project. The test yield:

  voluptuous.MultipleInvalid: extra keys not allowed @
  data['projects'][0]['nonpipe']

Debian has recently accepted voluptuous 0.8.2 in testing, so if we want
to package Zuul, we better have to upgrade our voluptuous requirement as
well. Ref: http://packages.qa.debian.org/v/voluptuous.html

Change-Id: I117ea644863b2e4a4dc3429aa81e868573382877
changes/96/54696/1
Antoine Musso 9 years ago
parent
commit
b36f8658d8
  1. 2
      requirements.txt
  2. 2
      zuul/layoutvalidator.py

2
requirements.txt

@ -12,6 +12,6 @@ ordereddict
python-daemon
extras
statsd>=1.0.0,<3.0
voluptuous>=0.6,<0.7
voluptuous>=0.7
gear>=0.4.0,<1.0.0
apscheduler>=2.1.1,<3.0

2
zuul/layoutvalidator.py

@ -97,7 +97,7 @@ class LayoutSchema(object):
for k, v in value.items():
self.validateJob(v, path + [k])
else:
self.job_name.validate(path, self.job_name.schema, value)
self.job_name.schema(value)
def validateTemplateCalls(self, calls):
""" Verify a project pass the parameters required

Loading…
Cancel
Save