From e611c797fc1f9a6d1f447774b301f2bb63f4566f Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Tue, 17 Oct 2017 15:22:10 -0400 Subject: [PATCH] fix some flakey tests The check for stable branches needs to be more flexible about where "stable/" appears in the names. The version number computation needs to take into account trailing zeros so we don't end up with invalid version numbers. Change-Id: I3c9c82f85810f84ebeac20a4ae26eb31aa8c6f5d Signed-off-by: Doug Hellmann --- openstack_releases/tests/test_validate.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openstack_releases/tests/test_validate.py b/openstack_releases/tests/test_validate.py index 7580ff4535..e6b98242c8 100644 --- a/openstack_releases/tests/test_validate.py +++ b/openstack_releases/tests/test_validate.py @@ -657,7 +657,7 @@ class TestValidateReleases(base.BaseTestCase): stable_branches = list(sorted( b for b in known_branches - if b.startswith('stable/') + if 'origin/' in b # be flexible remotes/origin/, origin/, etc. )) # Pick an early branch, find the most recent tagged release, # get the version, then get the sha of that commit. @@ -680,7 +680,9 @@ class TestValidateReleases(base.BaseTestCase): 'openstack/automaton', branch2, ) - version2 = version1 + '9' + # We don't want a version number like 1.13.09 because that + # fails the canonical-form check. + version2 = version1.rstrip('0') + '9' deliverable_info = { 'artifact-link-mode': 'none', 'releases': [