Contoh
Di halaman ini akan ditemukan beberapa inspirasi dari contoh nyata pengujian yang sudah diaktifkan di Fedora CI.
Python
Terdapat beberapa versi bahasa pemrograman Python yang tersedia di Fedora dan sejumlah subpaket terkait. Karena semuanya harus diuji (termasuk berbagai kombinasinya), kami share menyediakan cakupan pengujian untuk semuanya di namespace tests:
Pegujian repositori berisi pengujian asap dasar (pengujian kelayakan) untuk virtualenv beserta contoh pengujiannya Metadata yang tersimpan di Format Metadata Fleksibel:
Setelah pengujian tersedia di repositori pengujian bersama, pengujian tersebut dapat dengan mudah dihubungkan dari versi Python yang didukung:
Kami juga menguji implementasi Python tambahan:
Plus we ensure that essential tools for venv and virtualenv, such as setuptools, pip or virtualenv itself correctly work with all supported versions:
Perhatikan bahwa untuk contoh terakhir jalankan pengujian yang sama beberapa kali dengan lingkungan yang dimodifikasi. Contoh nya:
- name: tests_python
how: shell
url: https://src.fedoraproject.org/tests/python.git
tests:
- name: smoke36
path: /smoke
test: VERSION=3.6 INSTALL_OR_SKIP=true ./venv.sh
- name: smoke39
path: /smoke
test: VERSION=3.9 INSTALL_OR_SKIP=true ./venv.sh
- name: smoke310
path: /smoke
test: VERSION=3.10 INSTALL_OR_SKIP=true ./venv.sh
Dengan cara ini dibuat beberapa kasus uji virtual dari satu kode pengujian, yang mencegah duplikasi dan meminimalkan pemeliharaan di masa mendatang.
SELinux
There are several components related to SELinux. They are tightly connected so change in one of them can cause problems in other. That’s why their tests are shared and executed together:
Instead of listing relevant tests to be executed manually in each dist-git package repository Flexible Metadata Format is used, e.g. in libsepol:
summary: selinux tests - Tier 1 | libsepol
discover:
how: fmf
url: https://src.fedoraproject.org/tests/selinux
filter: "tier: 1 | component: libsepol"
execute:
how: tmt
The filter selects all tests relevant for the libsepol component plus all Tier 1 selinux tests.
The following six components are covered:
Use the fmf command line tool to quickly check which tests will be scheduled:
# dnf install -y fmf # fedpkg clone -a tests/selinux # cd selinux # fmf ls --filter "tier: 1 | component: libsepol" /checkpolicy/checkmodule /checkpolicy/checkpolicy /checkpolicy/checkpolicy-docs /kernel/selinux-testsuite /libselinux/matchpathcon-in-chroot-env /libselinux/realpath_not_final-function /libselinux/selabel-functions /libselinux/selabel_lookup-and-local-changes /libselinux/selinux_boolean_sub-function /libselinux/selinux_restorecon-functions /libselinux/selinux_sestatus-functions /libselinux/selinux_set_callback /libselinux/setenforce /libselinux/validatetrans ...
See the Flexible Metadata Format documentation for other options how to install fmf.
Want to help? Learn how to contribute to Fedora Docs ›