Skip to content

Commit

Permalink
Test and verify with tmt and TF (#301)
Browse files Browse the repository at this point in the history
Test and verify with tmt and TF

Reviewed-by: Maja Massarini
  • Loading branch information
softwarefactory-project-zuul[bot] authored Feb 14, 2025
2 parents 7da44b7 + e376915 commit a010261
Show file tree
Hide file tree
Showing 13 changed files with 163 additions and 16 deletions.
1 change: 1 addition & 0 deletions .fmf/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
23 changes: 18 additions & 5 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,20 @@ srpm_build_deps:
- python3-hatch-vcs

jobs:
- job: propose_downstream
trigger: release
dist_git_branches:
- fedora-all
# PR jobs
- job: copr_build
trigger: pull_request
targets:
- fedora-all
- epel-9

- job: tests
trigger: pull_request
targets:
- fedora-all
- epel-9

# Latest-greatest development build
- job: copr_build
trigger: commit
branch: main
Expand All @@ -54,6 +59,13 @@ jobs:
- epel-9
list_on_homepage: True
preserve_project: True

# Jobs on release
- job: propose_downstream
trigger: release
dist_git_branches:
- fedora-all

- job: copr_build
trigger: release
project: packit-releases
Expand All @@ -63,13 +75,14 @@ jobs:
list_on_homepage: True
preserve_project: True

# downstream automation:
# Downstream automation
- job: koji_build
trigger: commit
packit_instances: ["stg"]
dist_git_branches:
- fedora-all
- epel-9

- job: bodhi_update
trigger: commit
packit_instances: ["stg"]
Expand Down
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,10 @@ repos:
- LICENSE_HEADER.txt
- --comment-style
- "#"
- repo: https://github.com/teemtee/tmt.git
rev: 1.41.0
hooks:
- id: tmt-lint
# Do not run in pre-commit.ci as it requires an internet access
# for verifying imported tmt plans
stages: [manual, pre-push]
11 changes: 0 additions & 11 deletions ci.fmf

This file was deleted.

14 changes: 14 additions & 0 deletions plans/full.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
summary:
Unit & integration tests

discover+:
filter: tier:1

prepare:
# Enable packit-dev Copr repo to get the latest builds of packages
- how: install
copr: packit/packit-dev

# Make sure the Copr repo has higher priority than TF Tag Repository
- how: shell
script: sed -i -n '/^priority=/!p;$apriority=5' /etc/yum.repos.d/*:packit:packit-dev.repo
5 changes: 5 additions & 0 deletions plans/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
discover:
how: fmf

execute:
how: tmt
24 changes: 24 additions & 0 deletions plans/ogr-integration.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
discover:
how: fmf
url: https://github.com/packit/ogr
filter: tier:0 | tier:1

prepare:
- how: install
copr: packit/packit-dev

# make sure the Copr repo has higher priority than TF Tag Repository
- how: shell
script: sed -i -n '/^priority=/!p;$apriority=5' /etc/yum.repos.d/*:packit:packit-dev.repo

adjust:
- when: "how == integration"
because: "provide latest python-requre rpm when running locally"
prepare+:
- name: python3-requre rpm
how: install
directory: noarch/

- when: "distro == rhel-8 or distro == centos-8 or distro == centos-stream-8"
because: "ogr doesn't support EL 8"
enabled: false
32 changes: 32 additions & 0 deletions plans/packit-integration.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
discover:
how: fmf
url: https://github.com/packit/packit
filter: tier:0 | tier:1

prepare:
- how: install
copr: packit/packit-dev

# make sure the Copr repo has higher priority than TF Tag Repository
- how: shell
script: sed -i -n '/^priority=/!p;$apriority=5' /etc/yum.repos.d/*:packit:packit-dev.repo

adjust:
- when: "how == integration"
because: "provide latest python-requre rpm when running locally"
prepare+:
- name: python3-requre rpm
how: install
directory: noarch/

- when: "distro == rhel-9 or distro == centos-9 or distro == centos-stream-9"
because: "build and deepdiff are not in EPEL 9"
prepare+:
- how: install
package: python3-pip
- how: shell
script: pip3 install build 'deepdiff < 8.0.0' # version 8.0.0 depends on numpy, avoid it

- when: "distro == rhel-8 or distro == centos-8 or distro == centos-stream-8"
because: "packit doesn't support EL 8"
enabled: false
14 changes: 14 additions & 0 deletions plans/rpmlint.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
summary:
Run linters on source code and packaging files

prepare:
- name: packages
how: install
package:
- rpmlint

discover:
how: shell
tests:
- name: rpmlint
test: rpmlint fedora/python-requre.spec
5 changes: 5 additions & 0 deletions plans/smoke.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
summary:
Basic smoke test

discover+:
filter: tier:0
27 changes: 27 additions & 0 deletions tests/full.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
summary:
Unit & integration tests

require:
- python3-flexmock
- python3-pytest
- python3-pytest-cov

- python3-pyyaml

- python3-httpx
- python3-requests
- python3-urllib3

- python3-GitPython
- python3-ogr

component:
- requre
tier: 1
tag:
- basic

test: pytest-3 -v --cov=requre --cov-report=term-missing $TEST_TARGET
duration: 30m
environment:
TEST_TARGET: .
11 changes: 11 additions & 0 deletions tests/smoke.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
summary:
Basic smoke test

require:
- python3-requre

tag:
- smoke
tier: 0

test: ./smoke.sh
5 changes: 5 additions & 0 deletions tests/smoke.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

set -eux

python3 -c "import requre"

0 comments on commit a010261

Please sign in to comment.