Skip to content

Commit

Permalink
Onboard TMT
Browse files Browse the repository at this point in the history
Signed-off-by: Nicola Sella <[email protected]>
  • Loading branch information
inknos committed Jan 22, 2025
1 parent b20360f commit 5943848
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 0 deletions.
1 change: 1 addition & 0 deletions .fmf/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
33 changes: 33 additions & 0 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,36 @@ jobs:
packages: [python-podman-fedora]
dist_git_branches:
- fedora-branched # rawhide updates are created automatically

# Test linting on the codebase
# This test might break based on the OS and lint used, so we follow fedora-latest as a reference
- job: tests
trigger: pull_request
tmt_plan: /upstream/lint
packages: [python-podman-fedora]
targets:
- fedora-latest-stable
skip_build: true

# Test integration on all the targets
- job: tests
trigger: pull_request
tmt_plan: /upstream
packages: [python-podman-fedora]
targets:
- fedora-all

- job: tests
trigger: pull_request
tmt_plan: /upstream
packages: [python-podman-centos]
targets:
- centos-stream-9
- centos-stream-10

- job: tests
packages: [python-podman-rhel]
tmt_plan: /upstream
trigger: pull_request
targets:
- epel-9
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ repos:
args: [ --fix ]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/teemtee/tmt.git
rev: 1.39.0
hooks:
- id: tmt-lint
48 changes: 48 additions & 0 deletions plans/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
summary: Run Python Podman Tests

discover:
how: fmf
execute:
how: tmt
prepare:
- name: pkg dependencies
how: install
package:
- make
- python3-pip

- name: pip dependencies
how: shell
script:
- make

- name: ssh configuration
how: shell
script:
- ssh-keygen -t ecdsa -b 521 -f /root/.ssh/id_ecdsa -P ""
- cp /root/.ssh/authorized_keys /root/.ssh/authorized_keys%
- cat /root/.ssh/id_ecdsa.pub >>/root/.ssh/authorized_keys

/upstream:
/lint:
summary: Run Python Podman Tests on upstream PRs
discover+:
test: /tests/lint

/integration_tests:
summary: Run Python Podman Tests on upstream PRs
discover+:
test: /tests/integration_tests

adjust+:
enabled: false
when: initiator is not defined or initiator != packit

/downstream:
summary: Run Python Podman Tests on bodhi / errata and dist-git PRs
discover+:
test: /tests/integration_tests

adjust+:
enabled: false
when: initiator == packit
3 changes: 3 additions & 0 deletions tests/integration.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
PYTHON ?= $(shell command -v python3 2>/dev/null || command -v python || which python3)
tox -e coverage,py39,py310,py311,py312,py313
3 changes: 3 additions & 0 deletions tests/lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
PYTHON ?= $(shell command -v python3 2>/dev/null || command -v python || which python3)
python3 -m tox -e format,lint
13 changes: 13 additions & 0 deletions tests/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require:
- make
- python3-pip

/lint:
tag: [ upstream ]
summary: Run Linting on the whole codebase
test: lint.sh

/integration_tests:
tag: [ upstream, downstream ]
summary: Run integration tests
test: integration.sh

0 comments on commit 5943848

Please sign in to comment.