From 0f12b4f389365dcde04823f9bb5aaf8a2ed34811 Mon Sep 17 00:00:00 2001 From: Alassane Yattara Date: Thu, 9 Nov 2023 16:55:45 +0100 Subject: bitbake: toaster: Added pytest.ini file The main reason for using pytest is to be able to generate a positive test report using the pytest-html plugin. Integrating Pytest with Tox is a straightforward process, this can be done using tox.ini instead of pytest.ini used to configure pytest, that is another reason for using pytest. Tox is a tool that automates testing across different virtual environments, it can help ensure application will be tested against multiple Python versions and environments. https://github.com/pytest-dev/pytest/blob/main/tox.ini Generated reports create a historical record of test results over time. This can help track the progress of the application's stability and quality Documentation and Transparency: Test reports provide us a clear and detailed documentation of the test results. They show what tests were executed, which ones passed, and which ones failed. This transparency is critical for understanding the current state of the application and its test coverage. Communication: Test reports are an effective means of communication among community to understand the testing progress and results. Debugging, Troubleshooting Historical Tracking and Regression Testing: In case of test failures, a detailed test report can be invaluable for debugging. It provides information about the specific test case that failed, the input data used, and any error messages. (Bitbake rev: 6ba046b8d0d821e304c14b78ef6b00945e0ab453) Signed-off-by: Alassane Yattara Signed-off-by: Richard Purdie --- bitbake/lib/toaster/pytest.ini | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 bitbake/lib/toaster/pytest.ini (limited to 'bitbake') diff --git a/bitbake/lib/toaster/pytest.ini b/bitbake/lib/toaster/pytest.ini new file mode 100644 index 0000000000..f07076b7ea --- /dev/null +++ b/bitbake/lib/toaster/pytest.ini @@ -0,0 +1,19 @@ +# -- FILE: pytest.ini (or tox.ini) +[pytest] +DJANGO_SETTINGS_MODULE = toastermain.settings_test + +python_files = db/test_*.py commands/test_*.py views/test_*.py browser/test_*.py functional/test_*.py + +# --create-db - force re creation of the test database +# https://pytest-django.readthedocs.io/en/latest/database.html#create-db-force-re-creation-of-the-test-database + +# --html=report.html --self-contained-html +# https://docs.pytest.org/en/latest/usage.html#creating-html-reports +# https://pytest-html.readthedocs.io/en/latest/user_guide.html#creating-a-self-contained-report +addopts = --create-db --html="Toaster Tests Report.html" --self-contained-html + +# Define environment variables using pytest-env +# A pytest plugin that enables you to set environment variables in the pytest.ini file. +# https://pypi.org/project/pytest-env/ +env = + TOASTER_BUILDSERVER=1 -- cgit v1.2.3-54-g00ecf