File tree Expand file tree Collapse file tree 5 files changed +79
-0
lines changed
Expand file tree Collapse file tree 5 files changed +79
-0
lines changed Original file line number Diff line number Diff line change 1+ summary:
2+ Functional tests
3+ discover+:
4+ filter: tier:2
5+ prepare:
6+ - how: install
7+ package: xz
8+ - how: shell
9+ script: |
10+ curl -O https://src.fedoraproject.org/lookaside/rpm-specs-latest.tar.xz
11+ tar -xf rpm-specs-latest.tar.xz -C /tmp
Original file line number Diff line number Diff line change 1+ summary:
2+ Functional tests
3+ require:
4+ - python3-pytest
5+ - python3-specfile
6+ - redhat-rpm-config
7+ - rpmautospec-rpm-macros
8+ - MUMPS-srpm-macros
9+ - ansible-srpm-macros
10+ - blis-srpm-macros
11+ - efi-srpm-macros
12+ - folly-srpm-macros
13+ - fonts-srpm-macros
14+ - fpc-srpm-macros
15+ - ghc-srpm-macros
16+ - gnat-srpm-macros
17+ - go-srpm-macros
18+ - kernel-srpm-macros
19+ - lua-srpm-macros
20+ - nbdkit-srpm-macros
21+ - ocaml-srpm-macros
22+ - openblas-srpm-macros
23+ - package-notes-srpm-macros
24+ - perl-srpm-macros
25+ - pyproject-srpm-macros
26+ - python-srpm-macros
27+ - qt5-srpm-macros
28+ - qt6-srpm-macros
29+ - rust-srpm-macros
30+ - typelib-srpm-macros
31+ tag:
32+ - functional
33+ tier: 2
34+ duration: 1h
35+ # running from the "tests" directory prevents pytest from processing "tests/functional/conftest.py"
36+ path: /
37+ test: python3 -m pytest --verbose --specdir=/tmp/rpm-specs tests/functional
Original file line number Diff line number Diff line change 1+ # Copyright Contributors to the Packit project.
2+ # SPDX-License-Identifier: MIT
Original file line number Diff line number Diff line change 1+ # Copyright Contributors to the Packit project.
2+ # SPDX-License-Identifier: MIT
3+
4+ from pathlib import Path
5+
6+
7+ def pytest_addoption (parser ):
8+ parser .addoption (
9+ "--specdir" ,
10+ action = "store" ,
11+ default = None ,
12+ help = "path to a directory containing spec files" ,
13+ )
14+
15+
16+ def pytest_generate_tests (metafunc ):
17+ if "spec_path" in metafunc .fixturenames :
18+ specdir = metafunc .config .getoption ("specdir" )
19+ specs = list (Path (specdir ).glob ("*.spec" )) if specdir else []
20+ metafunc .parametrize ("spec_path" , specs , ids = lambda p : p .name )
Original file line number Diff line number Diff line change 1+ # Copyright Contributors to the Packit project.
2+ # SPDX-License-Identifier: MIT
3+
4+ from specfile import Specfile
5+
6+
7+ def test_parse (spec_path ):
8+ spec = Specfile (spec_path , force_parse = True )
9+ assert spec .expanded_version
You can’t perform that action at this time.
0 commit comments