fix stable version cal (#466)
This commit is contained in:
Родитель
917ca544f1
Коммит
562ad15473
|
@ -2,6 +2,10 @@
|
|||
|
||||
Release History
|
||||
===============
|
||||
0.1.76
|
||||
++++++
|
||||
* `azdev extension cal-next-version`: Fix preview to stable version case.
|
||||
|
||||
0.1.75
|
||||
++++++
|
||||
* `azdev scan/mask`: Add `--include-pattern` and `--exclude-pattern` to support filtering files within directory
|
||||
|
|
|
@ -4,4 +4,4 @@
|
|||
# license information.
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
__VERSION__ = '0.1.75'
|
||||
__VERSION__ = '0.1.76'
|
||||
|
|
|
@ -123,6 +123,10 @@ class VersionUpgradeMod:
|
|||
self.next_version.init_preview_version()
|
||||
return
|
||||
|
||||
if self.next_version_pre_tag == VERSION_STABLE_TAG and self.is_preview:
|
||||
# 2.0.0bN -> stable > 2.0.0
|
||||
return
|
||||
|
||||
if self.next_version_segment_tag:
|
||||
if self.next_version_segment_tag == VERSION_MAJOR_TAG:
|
||||
self.next_version.major = self.version.major + 1
|
||||
|
|
|
@ -22,6 +22,15 @@ class MyTestCase(unittest.TestCase):
|
|||
self.assertEqual(True, version_test.get("is_stable"), "Version tag error")
|
||||
self.assertEqual(False, version_test.get("preview_tag", False), "Version tag error")
|
||||
|
||||
def test_version_preview_to_stable(self):
|
||||
# stable version update major
|
||||
version_test = cal_next_version(base_meta_file=os.path.join(TEST_DIR, "jsons", "az_monitor_meta_before.json"),
|
||||
diff_meta_file=os.path.join(TEST_DIR, "jsons", "az_monitor_meta_after.json"),
|
||||
current_version="3.11.0b12", next_version_pre_tag="stable")
|
||||
self.assertEqual("3.11.0", version_test.get("version"), "Version cal error")
|
||||
self.assertEqual(True, version_test.get("is_stable"), "Version tag error")
|
||||
self.assertEqual(False, version_test.get("preview_tag", False), "Version tag error")
|
||||
|
||||
def test_version_upgrade_major_was_preview(self):
|
||||
# preview version update major and add preview suffix
|
||||
version_test = cal_next_version(base_meta_file=os.path.join(TEST_DIR, "jsons", "az_monitor_meta_before.json"),
|
||||
|
|
Загрузка…
Ссылка в новой задаче