Skip minor version increment validation for branchless

Tempest plugins do not branch, therefore we do not need to enforce that
the minor version is incremented to leave room for stable releases.

Change-Id: I22ba5cb42070b5a450617872de2da337b327de1c
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
Sean McGinnis 2019-08-08 12:19:33 -05:00
parent 4295322c49
commit e5362d5d2c
No known key found for this signature in database
GPG Key ID: CE7EE4BFAF8D70C8
2 changed files with 33 additions and 0 deletions

View File

@ -252,6 +252,10 @@ def validate_series_open(deliv, context):
def validate_series_first(deliv, context):
"The first release in a series needs to end with '.0'."
if deliv.type == 'tempest-plugin':
print('this rule does not apply to branchless tempest plugins')
return
releases = deliv.releases
if len(releases) != 1:
# We only have to check this when the first release is being

View File

@ -2746,6 +2746,35 @@ class TestValidateSeriesFirst(base.BaseTestCase):
self.assertEqual(0, len(self.ctx.warnings))
self.assertEqual(0, len(self.ctx.errors))
def test_branchless(self):
series_a_dir = self.tmpdir + '/a'
series_a_filename = series_a_dir + '/sahara-tests.yaml'
os.makedirs(series_a_dir)
deliverable_data = textwrap.dedent('''
---
type: tempest-plugin
releases:
- version: 0.9.1
projects:
- repo: openstack/sahara-tests
hash: 1e016405f8dbdf265374700d2fb8f8e2a9460805
''')
with open(series_a_filename, 'w') as f:
f.write(deliverable_data)
deliv = deliverable.Deliverable(
team='team',
series='a',
name='name',
data=yamlutils.loads(deliverable_data),
)
validate.validate_series_first(
deliv,
self.ctx,
)
self.ctx.show_summary()
self.assertEqual(0, len(self.ctx.warnings))
self.assertEqual(0, len(self.ctx.errors))
class TestValidateSeriesFinal(base.BaseTestCase):