diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/gating.yaml b/gating.yaml index c190bde..c4035f6 100644 --- a/gating.yaml +++ b/gating.yaml @@ -1,6 +1,8 @@ --- !Policy + product_versions: - rhel-9 decision_context: osci_compose_gate rules: - - !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional} + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} + diff --git a/plan.fmf b/plan.fmf new file mode 100644 index 0000000..3d1f779 --- /dev/null +++ b/plan.fmf @@ -0,0 +1,54 @@ +execute: + how: tmt + +discover: + - name: same_repo + how: shell + dist-git-source: true + dist-git-download-only: true + tests: + - name: pythonabi + path: /tests + test: ./pythonabi.sh + - name: pythonname + path: /tests + test: ./pythonname.sh + - name: pythondist + path: /tests + test: ./pythondist.sh + - name: console_script + path: /tests + test: ./console_script.sh + - name: pytest + test: cd $TMT_SOURCE_DIR && ./tests/download_data_and_run_pytest.sh + +prepare: + - name: enable crb + how: feature + crb: enabled + - name: Get rid of 'rcmtools' repo and packages installed from there + how: shell + script: | + dnf config-manager --set-disabled rcmtools || true + dnf remove -y brewkoji koji python3-brewkoji python3-defusedxml python3-koji || true + dnf distrosync -y + - name: Install dependencies + how: install + package: + - rpm-build + - rpmdevtools + - python3-devel + - python3-pip + - python3-pytest + - python3-pyyaml + - python3-setuptools + - python3-wheel + - dnf + - name: Update packages + how: shell + script: dnf upgrade -y + - name: rpm_qa + order: 100 + how: shell + script: rpm -qa | sort | tee $TMT_PLAN_DATA/rpmqa.txt + diff --git a/tests/download_data_and_run_pytest.sh b/tests/download_data_and_run_pytest.sh new file mode 100755 index 0000000..79d54b5 --- /dev/null +++ b/tests/download_data_and_run_pytest.sh @@ -0,0 +1,15 @@ +#!/usr/bin/bash -eux +# Use update-test-sources.sh to update the test data + +# When the tests run in python-rpm-generators, +# the structure on disk does not match the dist-git repository. +# We apparently must use the standard-test-source role to grab the sources. +# OTOH in other packages, we must use fedpkg(-minimal) or centpkg(-minimal), +# depending on the destination OS. +# The --force flag is required in full-blown fedpkg/centpkg (the source is unused in spec), +# and it is ignored in fedpkg/centpkg-minimal (all sources are always downloaded). +test -f test-sources-*.tar.gz || fedpkg sources --force || centpkg sources --force + +tar -xvf test-sources-*.tar.gz -C ./tests/data/scripts_pythondistdeps/ +cd tests/ +python3 -m pytest -vvv diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index 668ff36..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,48 +0,0 @@ ---- -- hosts: localhost - tags: - - classic - tasks: - - dnf: - name: "*" - state: latest - -- hosts: localhost - tags: - - classic - pre_tasks: - - import_role: - name: standard-test-source - vars: - fetch_only: True - roles: - - role: standard-test-basic - tests: - - pythonabi: - dir: . - run: ./pythonabi.sh - - pythonname: - dir: . - run: ./pythonname.sh - - pythondist: - dir: . - run: ./pythondist.sh - - console_script: - dir: . - run: ./console_script.sh - - prepare-test-data: - dir: . - run: tar -xvf test-sources-*.tar.gz -C ./tests/data/scripts_pythondistdeps/ - - pytest: - dir: ./tests - # Use update-test-sources.sh to update the test data - run: python3 -m pytest --capture=no -vvv - required_packages: - - rpm-build - - rpmdevtools - - python3-devel - - python3-pip - - python3-pytest - - python3-pyyaml - - python3-setuptools - - python3-wheel