package/python-unitest-xml-reporting: new package
PATCH 1/1 package/python-unitest-xml-reporting: new package
Based on initial work from Nicolas Carrier <[email protected]>, with the following additions:
- Updated to a newer version
- Added proper license file handling
- Added runtime test case
- Restricted to Python 3.x
Signed-off-by Thomas Petazzoni <[email protected]>
--- DEVELOPERS | 6 +++++ package/Config.in | 1 + .../python-unittest-xml-reporting/Config.in | 9 ++++++++ .../python-unittest-xml-reporting.hash | 5 ++++ .../python-unittest-xml-reporting.mk | 23 +++++++++++++++++++ .../sample_python_unittest_xml_reporting.py | 9 ++++++++ .../test_python_unittest_xml_reporting.py | 23 +++++++++++++++++++ 7 files changed, 76 insertions(+) create mode 100644 package/python-unittest-xml-reporting/Config.in create mode 100644 package/python-unittest-xml-reporting/python-unittest-xml-reporting.hash create mode 100644 package/python-unittest-xml-reporting/python-unittest-xml-reporting.mk create mode 100644 support/testing/tests/package/sample_python_unittest_xml_reporting.py create mode 100644 support/testing/tests/package/test_python_unittest_xml_reporting.py
DEVELOPERS +6 -0
@@ -1983,14 +1983,17 @@ F: package/php-xdebug/ F: package/python-augeas/ F: package/python-flask-expects-json/ F: package/python-git/ +F: package/python-unittest-xml-reporting/ F: support/testing/tests/package/sample_bmap_tools.sh F: support/testing/tests/package/sample_python_augeas.py F: support/testing/tests/package/sample_python_flask_expects_json.py F: support/testing/tests/package/sample_python_git.py +F: support/testing/tests/package/sample_python_unittest_xml_reporting.py F: support/testing/tests/package/test_bmap_tools.py F: support/testing/tests/package/test_python_augeas.py F: support/testing/tests/package/test_python_flask_expects_json.py F: support/testing/tests/package/test_python_git.py +F: support/testing/tests/package/test_python_unittest_xml_reporting.py N: Nicolas Cavallari <[email protected]> F: package/libgit2/
@@ -2691,6 +2694,7 @@ F: package/python-flask-expects-json/ F: package/python-git/ F: package/python-mad/ F: package/python-serial/ +F: package/python-unittest-xml-reporting/ F: package/qextserialport/ F: package/riscv64-elf-toolchain/ F: package/rpcbind/
@@ -2706,10 +2710,12 @@ F: support/testing/tests/package/sample_python_augeas.py F: support/testing/tests/package/sample_python_flask.py F: support/testing/tests/package/sample_python_flask_expects_json.py F: support/testing/tests/package/sample_python_git.py +F: support/testing/tests/package/sample_python_unittest_xml_reporting.py F: support/testing/tests/package/test_python_augeas.py F: support/testing/tests/package/test_python_flask.py F: support/testing/tests/package/test_python_flask_expects_json.py F: support/testing/tests/package/test_python_git.py +F: support/testing/tests/package/test_python_unittest_xml_reporting.py F: toolchain/ N: Timo Ketola <[email protected]>
package/Config.in +1 -0
@@ -1251,6 +1251,7 @@ menu "External python modules" source "package/python-u-msgpack/Config.in" source "package/python-ubjson/Config.in" source "package/python-ujson/Config.in" + source "package/python-unittest-xml-reporting/Config.in" source "package/python-urllib3/Config.in" source "package/python-urwid/Config.in" source "package/python-uvloop/Config.in"
package/python-unittest-xml-reporting/Config.in new file +9 -0
@@ -0,0 +1,9 @@ +config BR2_PACKAGE_PYTHON_UNITTEST_XML_REPORTING + bool "python-unittest-xml-reporting" + depends on BR2_PACKAGE_PYTHON3 + select BR2_PACKAGE_PYTHON3_PYEXPAT + help + unittest-based test runner with Ant/JUnit like XML + reporting. + + http://github.com/xmlrunner/unittest-xml-reporting/
package/python-unittest-xml-reporting/python-unittest-xml-reporting.hash new file +5 -0
@@ -0,0 +1,5 @@ +# md5, sha256 from https://pypi.org/pypi/unittest-xml-reporting/json +md5 474cd89f9609828ef6039a0f00afd9db unittest-xml-reporting-3.0.4.tar.gz +sha256 984cebba69e889401bfe3adb9088ca376b3a1f923f0590d005126c1bffd1a695 unittest-xml-reporting-3.0.4.tar.gz +# Locally calculated +sha256 0596648105bee470f9cafd62753b931efe52392096439d88e2564cf7d7cf0e68 LICENSE
package/python-unittest-xml-reporting/python-unittest-xml-reporting.mk new file +23 -0
@@ -0,0 +1,23 @@ +################################################################################ +# +# python-unittest-xml-reporting +# +################################################################################ + +PYTHON_UNITTEST_XML_REPORTING_VERSION = 3.0.4 +PYTHON_UNITTEST_XML_REPORTING_SOURCE = unittest-xml-reporting-$(PYTHON_UNITTEST_XML_REPORTING_VERSION).tar.gz +PYTHON_UNITTEST_XML_REPORTING_SITE = https://files.pythonhosted.org/packages/bc/09/677086169c8e302b614de7d4a97c45c4446a382f31cc010fb31177258508 +# License file missing in Pypi tarball, download separately. Issue +# reported at +# https://github.com/xmlrunner/unittest-xml-reporting/issues/259 +PYTHON_UNITTEST_XML_REPORTING_EXTRA_DOWNLOADS = https://raw.githubusercontent.com/xmlrunner/unittest-xml-reporting/$(PYTHON_UNITTEST_XML_REPORTING_VERSION)/LICENSE +PYTHON_UNITTEST_XML_REPORTING_SETUP_TYPE = setuptools +PYTHON_UNITTEST_XML_REPORTING_LICENSE = BSD-2-Clause +PYTHON_UNITTEST_XML_REPORTING_LICENSE_FILES = LICENSE + +define PYTHON_UNITTEST_XML_REPORTING_ADD_LICENSE_FILE + $(INSTALL) -D -m 0644 $(PYTHON_UNITTEST_XML_REPORTING_DL_DIR)/LICENSE $(@D)/LICENSE +endef +PYTHON_UNITTEST_XML_REPORTING_POST_EXTRACT_HOOKS += PYTHON_UNITTEST_XML_REPORTING_ADD_LICENSE_FILE + +$(eval $(python-package))
support/testing/tests/package/sample_python_unittest_xml_reporting.py new file +9 -0
@@ -0,0 +1,9 @@ +import unittest +import xmlrunner + +class Test1(unittest.TestCase): + def test_something(self): + self.assertTrue(True) + +if __name__ == '__main__': + unittest.main(testRunner=xmlrunner.XMLTestRunner(output='test-reports'))
support/testing/tests/package/test_python_unittest_xml_reporting.py new file +23 -0
@@ -0,0 +1,23 @@ +from tests.package.test_python import TestPythonPackageBase +import os +import time + + +class TestPythonPy3UnitTestXmlReporting(TestPythonPackageBase): + __test__ = True + config = TestPythonPackageBase.config + \ + """ + BR2_PACKAGE_PYTHON3=y + BR2_PACKAGE_PYTHON_UNITTEST_XML_REPORTING=y + """ + sample_scripts = ["tests/package/sample_python_unittest_xml_reporting.py"] + timeout = 60 + + def test_run(self): + self.login() + self.check_sample_scripts_exist() + cmd = "%s %s" % (self.interpreter, os.path.basename(self.sample_scripts[0])) + self.assertRunOk(cmd) + # check if some tests results in XML were generated + cmd = "ls -1 test-reports/TEST-Test1-*.xml" + self.assertRunOk(cmd)
Signature · 6 lines
2.31.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Based on initial work from Nicolas Carrier <[email protected]>, with the following additions:
- Updated to a newer version
- Added proper license file handling
- Added runtime test case
- Restricted to Python 3.xSigned-off-by Thomas Petazzoni <[email protected]>
Committed, thanks.
Signature · 5 lines
Bye, Peter Korsgaard _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot