From 0179b118df98d0180b1feb39f4d8766fcb0e50ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Wed, 31 May 2023 11:22:02 +0200 Subject: [PATCH 1/2] add test that tries to parse all Fedora packages --- tests/test-parsing/parse.py | 8 ++++++++ tests/test-parsing/run.sh | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100755 tests/test-parsing/parse.py create mode 100755 tests/test-parsing/run.sh diff --git a/tests/test-parsing/parse.py b/tests/test-parsing/parse.py new file mode 100755 index 00000000..23fbfb22 --- /dev/null +++ b/tests/test-parsing/parse.py @@ -0,0 +1,8 @@ +#!/usr/bin/python3 +from specfile import Specfile +import sys + +# this is dump, but do the work +filename = sys.argv[1] +print("Parsing {}".format(filename)) +specfile = Specfile(filename, force_parse=True) diff --git a/tests/test-parsing/run.sh b/tests/test-parsing/run.sh new file mode 100755 index 00000000..33a965f6 --- /dev/null +++ b/tests/test-parsing/run.sh @@ -0,0 +1,8 @@ +#!/usr/bin/bash +#rm -rf /tmp/rpm-specs/* + +#curl https://src.fedoraproject.org/lookaside/rpm-specs-latest.tar.xz > /tmp/rpm-specs-latest.tar.xz +tar axf /tmp/rpm-specs-latest.tar.xz --directory /tmp +for spec in /tmp/rpm-specs/*.spec; do + parse.py "$spec" || echo "Error parsing $(basename $spec)" >&2 +done | pv -ls $(ls /tmp/rpm-specs/*.spec | wc -l) >/dev/null From 7c73c1f78fac2d8179001962b126cf3876182265 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 31 May 2023 09:24:51 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/test-parsing/parse.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test-parsing/parse.py b/tests/test-parsing/parse.py index 23fbfb22..0e82819f 100755 --- a/tests/test-parsing/parse.py +++ b/tests/test-parsing/parse.py @@ -1,7 +1,8 @@ #!/usr/bin/python3 -from specfile import Specfile import sys +from specfile import Specfile + # this is dump, but do the work filename = sys.argv[1] print("Parsing {}".format(filename))