summaryrefslogtreecommitdiff
path: root/bin/gen_release_notes_test.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2019-09-25 14:56:21 -0700
committerDylan Baker <dylan@pnwbakers.com>2019-10-03 20:15:19 +0000
commit86079447da1e00d49db0cbff9a102eb4e71e8702 (patch)
tree15dd622552400001041a90b8a32f262140229008 /bin/gen_release_notes_test.py
parent7ff49c25ed39921e855d22a23e6d64db42134f2d (diff)
scripts: Add a gen_release_notes.py script
This script is responsible for generating an entire page in the docs/relnotes/ directory. It includes a template for the page, and uses mako to fill in the necessary bits. It is designed to be purely fire and forget, calculating previous versions, shortlogs, bug fixes, and dates. Acked-by: Eric Engestrom <eric.engestrom@intel.com> Acked-by: Juan A. Suarez <jasuarez@igalia.com>
Diffstat (limited to 'bin/gen_release_notes_test.py')
-rw-r--r--bin/gen_release_notes_test.py62
1 files changed, 62 insertions, 0 deletions
diff --git a/bin/gen_release_notes_test.py b/bin/gen_release_notes_test.py
new file mode 100644
index 00000000000..b3ff60268b7
--- /dev/null
+++ b/bin/gen_release_notes_test.py
@@ -0,0 +1,62 @@
+# Copyright © 2019 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+from unittest import mock
+
+import pytest
+
+from .gen_release_notes import *
+
+
+@pytest.mark.parametrize(
+ 'current, is_point, expected',
+ [
+ ('19.2.0', True, '19.2.1'),
+ ('19.3.6', True, '19.3.7'),
+ ('20.0.0-rc4', False, '20.0.0'),
+ ])
+def test_next_version(current: str, is_point: bool, expected: str) -> None:
+ assert calculate_next_version(current, is_point) == expected
+
+
+@pytest.mark.parametrize(
+ 'current, is_point, expected',
+ [
+ ('19.3.6', True, '19.3.6'),
+ ('20.0.0-rc4', False, '19.3.0'),
+ ])
+def test_previous_version(current: str, is_point: bool, expected: str) -> None:
+ assert calculate_previous_version(current, is_point) == expected
+
+
+@pytest.mark.asyncio
+async def test_get_shortlog():
+ # Certainly not perfect, but it's something
+ version = '19.2.0'
+ out = await get_shortlog(version)
+ assert out
+
+
+@pytest.mark.asyncio
+async def test_gather_commits():
+ # Certainly not perfect, but it's something
+ version = '19.2.0'
+ out = await gather_commits(version)
+ assert out