Make sure -em tag is on last release

We don't want to allow tagging EM if there were no releases. We also
want to make sure the -em tag is on the last official release that was
done.

Change-Id: I7afb3a52cf2ec47d8e0154b51825b500806aa590
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
Sean McGinnis
2020-03-06 17:08:09 -06:00
parent 4ed0d612f0
commit 05f5aed7fa
3 changed files with 131 additions and 2 deletions

View File

@@ -3258,6 +3258,10 @@ class TestValidateSeriesEM(base.BaseTestCase):
---
team: Release Management
releases:
- version: 1.2.3
projects:
- repo: openstack/automaton
hash: be2885f544637e6ee6139df7dc7bf937925804dd
- version: newton-em
projects:
- repo: openstack/automaton
@@ -3277,15 +3281,111 @@ class TestValidateSeriesEM(base.BaseTestCase):
self.assertEqual(0, len(self.ctx.warnings))
self.assertEqual(0, len(self.ctx.errors))
def test_em_no_releases(self):
deliverable_data = yamlutils.loads(textwrap.dedent('''
---
team: Release Management
releases:
- version: newton-em
projects:
- repo: openstack/automaton
hash: be2885f544637e6ee6139df7dc7bf937925804dd
'''))
deliv = deliverable.Deliverable(
None,
'newton',
'test',
deliverable_data,
)
validate.validate_series_em(
deliv,
self.ctx,
)
self.ctx.show_summary()
self.assertEqual(0, len(self.ctx.warnings))
self.assertEqual(1, len(self.ctx.errors))
def test_em_not_matching_last_release(self):
deliverable_data = yamlutils.loads(textwrap.dedent('''
---
team: Release Management
releases:
- version: 1.2.3
projects:
- repo: openstack/automaton
hash: be2885f544637e6ee6139df7dc7bf937925804dd
- version: 1.2.4
projects:
- repo: openstack/automaton
hash: beef85f544637e6ee6139df7dc7bf937925804dd
- version: newton-em
projects:
- repo: openstack/automaton
hash: be2885f544637e6ee6139df7dc7bf937925804dd
repository-settings:
openstack/automaton: {}
'''))
deliv = deliverable.Deliverable(
None,
'newton',
'test',
deliverable_data,
)
validate.validate_series_em(
deliv,
self.ctx,
)
self.ctx.show_summary()
self.assertEqual(0, len(self.ctx.warnings))
self.assertEqual(1, len(self.ctx.errors))
def test_em_matches_last_release(self):
deliverable_data = yamlutils.loads(textwrap.dedent('''
---
team: Release Management
releases:
- version: 1.2.3
projects:
- repo: openstack/automaton
hash: be2885f544637e6ee6139df7dc7bf937925804dd
- version: 1.2.4
projects:
- repo: openstack/automaton
hash: beef85f544637e6ee6139df7dc7bf937925804dd
- version: newton-em
projects:
- repo: openstack/automaton
hash: beef85f544637e6ee6139df7dc7bf937925804dd
repository-settings:
openstack/automaton: {}
'''))
deliv = deliverable.Deliverable(
None,
'newton',
'test',
deliverable_data,
)
validate.validate_series_em(
deliv,
self.ctx,
)
self.ctx.show_summary()
self.assertEqual(0, len(self.ctx.warnings))
self.assertEqual(0, len(self.ctx.errors))
def test_em_missing_repo(self):
deliverable_data = yamlutils.loads(textwrap.dedent('''
---
team: Release Management
releases:
- version: 1.2.3
projects:
- repo: openstack/automaton
hash: be2885f544637e6ee6139df7dc7bf937925804dd
- version: newton-em
projects:
- repo: openstack/automaton
hash: ce2885f544637e6ee6139df7dc7bf937925804dd
hash: be2885f544637e6ee6139df7dc7bf937925804dd
repository-settings:
openstack/automaton: {}
openstack/release-test: {}