-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(tmt): run the tests on Testing Farm
Signed-off-by: Matej Focko <[email protected]>
- Loading branch information
Showing
8 changed files
with
125 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
packit_instances: ["prod", "stg"] | ||
|
||
packages: | ||
packit-service: | ||
downstream_package_name: packit-service | ||
upstream_package_name: packit-service | ||
upstream_project_url: https://github.com/packit/packit-service | ||
paths: | ||
- ./ | ||
specfile_path: none.spec | ||
|
||
issue_repository: https://github.com/packit/packit-service | ||
|
||
actions: | ||
pre-sync: | ||
# FMF has to be installed on system where you are calling this tool. | ||
- python3 plans/git_reference.py | ||
|
||
srpm_build_deps: [] | ||
|
||
jobs: | ||
- job: tests | ||
trigger: pull_request | ||
targets: | ||
- epel-9 | ||
skip_build: true | ||
tf_extra_params: | ||
environments: | ||
# to run the container specified in the tests | ||
- os: {} | ||
packages: | ||
- packit-service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Run tests locally: | ||
|
||
$ tmt -v run -a provision -h local | ||
|
||
Run tests in a container using podman: | ||
|
||
$ sudo dnf install tmt-provision-container | ||
$ tmt -v run -a provision -h container | ||
|
||
For more info see: | ||
|
||
- https://packit.dev/docs/testing-farm/ | ||
- [tmt @ DevConf 2021 slides](https://static.sched.com/hosted_files/devconfcz2021/37/tmt-slides.pdf) | ||
- [fmf docs](https://fmf.readthedocs.io) | ||
- [tmt docs](https://tmt.readthedocs.io) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
summary: Unit, integration & functional tests. | ||
|
||
discover+: | ||
filter: tag:full | ||
|
||
provision: | ||
how: container | ||
image: quay.io/packit/packit-service-tests:stg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/python | ||
|
||
# Copyright Contributors to the Packit project. | ||
# SPDX-License-Identifier: MIT | ||
|
||
import subprocess | ||
from pathlib import Path | ||
|
||
import fmf | ||
|
||
tree_root = Path.cwd().absolute() | ||
node = fmf.Tree(tree_root).find("/plans") | ||
with node as data: | ||
data["discover"]["url"] = "https://github.com/packit/packit-service.git" | ||
data["discover"]["ref"] = ( | ||
subprocess.check_output(["git", "rev-parse", "HEAD"]).decode().strip() | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
discover: | ||
how: fmf | ||
|
||
execute: | ||
how: tmt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
summary: | ||
Full test suite of the Packit Service | ||
|
||
component: | ||
- packit-service | ||
tier: 1 | ||
tag: | ||
- full | ||
|
||
adjust+: | ||
- when: initiator == packit | ||
environment+: | ||
COLOR: "no" | ||
CONTAINER_RUN_INTERACTIVE: "" | ||
|
||
path: / | ||
test: 'make check "TEST_TARGET=$TEST_TARGET"' | ||
duration: 30m | ||
|
||
/custom-target: | ||
summary: Custom tests | ||
description: | | ||
Custom tests that are useful for debugging as it is much easier to override | ||
the ‹TEST_TARGET› environment variable, disabled in CI as it is split into | ||
the separate test suites. | ||
tag: manual | ||
adjust: | ||
- when: initiator != human | ||
enabled: false | ||
because: "This test suite is for manually specifying the target and to be run locally" | ||
|
||
/unit: | ||
summary: Unit tests | ||
order: 1 | ||
environment+: | ||
TEST_TARGET: tests/unit/ | ||
|
||
/integration: | ||
summary: Integration tests | ||
order: 2 | ||
environment+: | ||
TEST_TARGET: tests/integration/ |