From b7368f919fdfe75dea585e13c5bad3911a34514a Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Tue, 12 Nov 2019 07:40:05 -0800 Subject: [PATCH] Add Invoke task for updating functional test output --- docs/contribute.rst | 9 ++------- tasks.py | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/docs/contribute.rst b/docs/contribute.rst index 752565f6..2f5ef873 100644 --- a/docs/contribute.rst +++ b/docs/contribute.rst @@ -86,14 +86,9 @@ output." If you have made changes that affect the HTML output generated by Pelican, and the changes to that output are expected and deemed correct given the nature of your changes, then you should update the output used by the functional tests. To do so, **make sure you have both** ``en_EN.utf8`` **and** -``fr_FR.utf8`` **locales installed**, and then run the following two commands:: +``fr_FR.utf8`` **locales installed**, and then run the following command:: - LC_ALL=en_US.utf8 pelican -o pelican/tests/output/custom/ \ - -s samples/pelican.conf.py samples/content/ - LC_ALL=fr_FR.utf8 pelican -o pelican/tests/output/custom_locale/ \ - -s samples/pelican.conf_FR.py samples/content/ - LC_ALL=en_US.utf8 pelican -o pelican/tests/output/basic/ \ - samples/content/ + invoke update-functional-tests You may also find that some tests are skipped because some dependency (e.g., Pandoc) is not installed. This does not automatically mean that these tests diff --git a/tasks.py b/tasks.py index 41ac2bde..8ecfc467 100644 --- a/tasks.py +++ b/tasks.py @@ -79,3 +79,17 @@ def setup(c): tools(c) c.run(f"{POETRY} install") precommit(c) + + +@task +def update_functional_tests(c): + """Update the generated functional test output""" + c.run( + f"bash -c 'LC_ALL=en_US.utf8 pelican -o {PKG_PATH}/tests/output/custom/ -s samples/pelican.conf.py samples/content/'" + ) + c.run( + f"bash -c 'LC_ALL=fr_FR.utf8 pelican -o {PKG_PATH}/tests/output/custom_locale/ -s samples/pelican.conf_FR.py samples/content/'" + ) + c.run( + f"bash -c 'LC_ALL=en_US.utf8 pelican -o {PKG_PATH}/tests/output/basic/ samples/content/'" + )