File tree Expand file tree Collapse file tree 8 files changed +125
-0
lines changed
Expand file tree Collapse file tree 8 files changed +125
-0
lines changed Original file line number Diff line number Diff line change 1+ 1
Original file line number Diff line number Diff line change 1+ ---
2+ packit_instances : ["prod", "stg"]
3+
4+ packages :
5+ packit-service :
6+ downstream_package_name : packit-service
7+ upstream_package_name : packit-service
8+ upstream_project_url : https://github.com/packit/packit-service
9+ paths :
10+ - ./
11+ specfile_path : none.spec
12+
13+ issue_repository : https://github.com/packit/packit-service
14+
15+ actions :
16+ pre-sync :
17+ # FMF has to be installed on system where you are calling this tool.
18+ - python3 plans/git_reference.py
19+
20+ srpm_build_deps : []
21+
22+ jobs :
23+ - job : tests
24+ trigger : pull_request
25+ targets :
26+ # Is not taken into consideration because of the ‹tf_extra_params› below
27+ # Could be utilized after fixing TFT-2521
28+ - fedora-latest
29+ skip_build : true
30+ tf_extra_params :
31+ environments :
32+ # to run the container specified in the tests
33+ - os : null
34+ packages :
35+ - packit-service
Original file line number Diff line number Diff line change @@ -118,3 +118,7 @@ repos:
118118 - LICENSE_HEADER.txt
119119 - --comment-style
120120 - " #"
121+ - repo : https://github.com/teemtee/tmt.git
122+ rev : 1.29.0
123+ hooks :
124+ - id : tmt-lint
Original file line number Diff line number Diff line change 1+ Run tests locally:
2+
3+ $ tmt -v run -a provision -h local
4+
5+ Run tests in a container using podman:
6+
7+ $ sudo dnf install tmt-provision-container
8+ $ tmt -v run -a provision -h container
9+
10+ For more info see:
11+
12+ - https://packit.dev/docs/testing-farm/
13+ - [ tmt @ DevConf 2021 slides] ( https://static.sched.com/hosted_files/devconfcz2021/37/tmt-slides.pdf )
14+ - [ fmf docs] ( https://fmf.readthedocs.io )
15+ - [ tmt docs] ( https://tmt.readthedocs.io )
Original file line number Diff line number Diff line change 1+ summary: Unit, integration & functional tests.
2+
3+ discover+:
4+ filter: tag:full
5+
6+ provision:
7+ how: container
8+ image: quay.io/packit/packit-service-tests:stg
Original file line number Diff line number Diff line change 1+ #!/usr/bin/python
2+
3+ # Copyright Contributors to the Packit project.
4+ # SPDX-License-Identifier: MIT
5+
6+ import subprocess
7+ from pathlib import Path
8+
9+ import fmf
10+
11+ tree_root = Path .cwd ().absolute ()
12+ node = fmf .Tree (tree_root ).find ("/plans" )
13+ with node as data :
14+ data ["discover" ]["url" ] = "https://github.com/packit/packit-service.git"
15+ data ["discover" ]["ref" ] = subprocess .check_output (["git" , "rev-parse" , "HEAD" ]).decode ().strip ()
Original file line number Diff line number Diff line change 1+ discover:
2+ how: fmf
3+
4+ execute:
5+ how: tmt
Original file line number Diff line number Diff line change 1+ summary:
2+ Full test suite of the Packit Service
3+
4+ component:
5+ - packit-service
6+ tier: 1
7+ tag:
8+ - full
9+
10+ adjust+:
11+ - when: initiator == packit
12+ environment+:
13+ COLOR: "no"
14+ CONTAINER_RUN_INTERACTIVE: ""
15+
16+ path: /
17+ test: 'make check "TEST_TARGET=$TEST_TARGET"'
18+ duration: 30m
19+
20+ /custom-target:
21+ summary: Custom tests
22+ description: |
23+ Custom tests that are useful for debugging as it is much easier to override
24+ the ‹TEST_TARGET› environment variable, disabled in CI as it is split into
25+ the separate test suites.
26+ tag: manual
27+ adjust:
28+ - when: initiator != human
29+ enabled: false
30+ because: "This test suite is for manually specifying the target and to be run locally"
31+
32+ /unit:
33+ summary: Unit tests
34+ order: 1
35+ environment+:
36+ TEST_TARGET: tests/unit/
37+
38+ /integration:
39+ summary: Integration tests
40+ order: 2
41+ environment+:
42+ TEST_TARGET: tests/integration/
You can’t perform that action at this time.
0 commit comments